From 437cc2bfd1c9fb6b8f3bcda52af477f045b0ea37 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 8 Sep 2019 18:03:04 -0700 Subject: [PATCH] Remove debug lines --- websocket.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/websocket.go b/websocket.go index 34b4a40..5469f87 100644 --- a/websocket.go +++ b/websocket.go @@ -4,7 +4,6 @@ import ( "bytes" "encoding/json" "errors" - "fmt" "github.com/gorilla/websocket" "github.com/julienschmidt/httprouter" "github.com/pterodactyl/wings/config" @@ -82,9 +81,6 @@ func (rt *Router) AuthenticateWebsocket(h httprouter.Handle) httprouter.Handle { defer resp.Body.Close() if resp.StatusCode != http.StatusNoContent { - b, _ := ioutil.ReadAll(resp.Body) - - zap.S().Warnw("failed to validate token with server", zap.String("response", string(b))) http.Error(w, "failed to validate token with server", resp.StatusCode) return } @@ -103,8 +99,6 @@ func (rt *Router) routeWebsocket(w http.ResponseWriter, r *http.Request, ps http } defer c.Close() - fmt.Println("running websocket route") - s := rt.Servers.Get(ps.ByName("server")) handler := WebsocketHandler{ Server: s, @@ -146,7 +140,6 @@ func (rt *Router) routeWebsocket(w http.ResponseWriter, r *http.Request, ps http for { j := WebsocketMessage{inbound: true} - fmt.Println("running for{} loop...") if _, _, err := c.ReadMessage(); err != nil { if !websocket.IsCloseError(err, websocket.CloseNormalClosure, websocket.CloseGoingAway, websocket.CloseNoStatusReceived, websocket.CloseServiceRestart) { @@ -159,18 +152,13 @@ func (rt *Router) routeWebsocket(w http.ResponseWriter, r *http.Request, ps http // specific socket request. If we did a break here the client would get disconnected // from the socket, which is NOT what we want to do. if err := c.ReadJSON(&j); err != nil { - fmt.Println("ReadJSON() error") continue } if err := handler.HandleInbound(j); err != nil { zap.S().Warnw("error handling inbound websocket request", zap.Error(err)) break - } else { - zap.S().Debugw("handled event", zap.String("event", j.Event), zap.Strings("args", j.Args)) } - - fmt.Println("finished looping...") } }