From 7b8bf24e401c633fca71e4480c0f1a24a8350c83 Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Fri, 21 Jun 2019 21:57:45 +0800 Subject: [PATCH] v2.8.1 --- gost.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gost.go b/gost.go index 8e1efbf..471945f 100644 --- a/gost.go +++ b/gost.go @@ -11,6 +11,7 @@ import ( "io" "math/big" "net" + "net/http" "strings" "sync" "time" @@ -19,7 +20,7 @@ import ( ) // Version is the gost version. -const Version = "2.8.0" +const Version = "2.8.1" // Debug is a flag that enables the debug log. var Debug bool @@ -200,3 +201,11 @@ func splitLine(line string) []string { } return ss } + +func connStateCallback(conn net.Conn, cs http.ConnState) { + switch cs { + case http.StateNew: + conn.SetReadDeadline(time.Now().Add(30 * time.Second)) + default: + } +}