From 4468aa69b69ec23fef8a00787b9562c59e7b4cb3 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 25 Apr 2018 17:28:08 +0200 Subject: [PATCH] remove debug --- cmd/gwstester/tester.go | 2 +- http/upgrade/request/private.go | 28 +++++++--------------------- http/upgrade/request/public.go | 1 - http/upgrade/response/types.go | 0 4 files changed, 8 insertions(+), 23 deletions(-) create mode 100644 http/upgrade/response/types.go diff --git a/cmd/gwstester/tester.go b/cmd/gwstester/tester.go index 733469d..343d5c1 100644 --- a/cmd/gwstester/tester.go +++ b/cmd/gwstester/tester.go @@ -48,7 +48,7 @@ func manageClient(sock net.Conn) { panic(err) } - fmt.Printf("Upgrade Request: %v\n", req) + fmt.Printf("%v\n", req) break; } diff --git a/http/upgrade/request/private.go b/http/upgrade/request/private.go index 01287a3..a63a297 100644 --- a/http/upgrade/request/private.go +++ b/http/upgrade/request/private.go @@ -37,27 +37,13 @@ func (r *T) parseHeader(b []byte) error { /* (2) Manage header */ switch head.Name { - - case header.HOST: fmt.Printf("[host] ") - err = r.extractHostPort(head.Values) - - case header.ORIGIN: fmt.Printf("[origin] ") - err = r.extractOrigin(head.Values) - - case header.UPGRADE: fmt.Printf("[upgrade] ") - err = r.checkUpgrade(head.Values) - - case header.CONNECTION: fmt.Printf("[connection] ") - err = r.checkConnection(head.Values) - - case header.WSVERSION: fmt.Printf("[sec-websocket-version] ") - err = r.checkVersion(head.Values) - - case header.WSKEY: fmt.Printf("[sec-websocket-key] ") - err = r.extractKey(head.Values) - - case header.WSPROTOCOL: fmt.Printf("[sec-websocket-protocol] ") - err = r.extractProtocols(head.Values) + case header.HOST: err = r.extractHostPort(head.Values) + case header.ORIGIN: err = r.extractOrigin(head.Values) + case header.UPGRADE: err = r.checkUpgrade(head.Values) + case header.CONNECTION: err = r.checkConnection(head.Values) + case header.WSVERSION: err = r.checkVersion(head.Values) + case header.WSKEY: err = r.extractKey(head.Values) + case header.WSPROTOCOL: err = r.extractProtocols(head.Values) default: return nil diff --git a/http/upgrade/request/public.go b/http/upgrade/request/public.go index 005a3a0..77ec7bc 100644 --- a/http/upgrade/request/public.go +++ b/http/upgrade/request/public.go @@ -26,7 +26,6 @@ func Build(r io.Reader) (request *T, err error) { line, err := cr.Read() if err == io.EOF { - fmt.Printf("END OF READING\n"); break } diff --git a/http/upgrade/response/types.go b/http/upgrade/response/types.go new file mode 100644 index 0000000..e69de29