diff --git a/main.go b/main.go index 77d932b..e3f1aee 100644 --- a/main.go +++ b/main.go @@ -30,7 +30,7 @@ import ( _ "github.com/nadoo/glider/proxy/ws" ) -var version = "0.9.1" +var version = "0.9.2" func main() { // read configs diff --git a/proxy/http/request.go b/proxy/http/request.go index 1104b3b..cf627bf 100644 --- a/proxy/http/request.go +++ b/proxy/http/request.go @@ -3,6 +3,7 @@ package http import ( "bufio" "bytes" + "errors" "net/textproto" "net/url" "strings" @@ -45,7 +46,7 @@ func parseRequest(r *bufio.Reader) (*request, error) { method, uri, proto, ok := parseStartLine(line) if !ok { - return nil, err + return nil, errors.New("error in parseStartLine") } header, err := tpr.ReadMIMEHeader() diff --git a/proxy/http/server.go b/proxy/http/server.go index b91bb7b..30c2481 100644 --- a/proxy/http/server.go +++ b/proxy/http/server.go @@ -56,6 +56,7 @@ func (s *HTTP) Serve(cc net.Conn) { req, err := parseRequest(c.Reader()) if err != nil { + log.F("[http] can not parse request from %s", c.RemoteAddr()) return } diff --git a/proxy/mixed/mixed.go b/proxy/mixed/mixed.go index cbac5f6..e59e554 100644 --- a/proxy/mixed/mixed.go +++ b/proxy/mixed/mixed.go @@ -114,4 +114,5 @@ func (m *Mixed) Serve(c net.Conn) { } } + log.F("[mixed] unknown request from %s, ignored", c.RemoteAddr()) }