commit 176f87c99305ca3be5c5601d535a8bbe3f2cc35d Author: David Fifield david@bamsoftware.com Date: Wed Jul 17 20:11:15 2013 -0700
Move max message size to a constant. --- websocket-transport/websocket-server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/websocket-transport/websocket-server.go b/websocket-transport/websocket-server.go index 11e2daf..f5fed31 100644 --- a/websocket-transport/websocket-server.go +++ b/websocket-transport/websocket-server.go @@ -21,6 +21,8 @@ import (
const ptMethodName = "websocket" const requestTimeout = 10 * time.Second +// 16 kilobytes, possibly base64-encoded. +const maxMessageSize = 16*1024*4/3 + 1
var logFile = os.Stderr
@@ -186,8 +188,7 @@ func startListener(addr *net.TCPAddr) (*net.TCPListener, error) { go func() { var config WebsocketConfig config.Subprotocols = []string{"base64"} - // 16 kilobytes, possibly base64-encoded. - config.MaxMessageSize = 16*1024*4/3 + 1 + config.MaxMessageSize = maxMessageSize s := &http.Server{ Handler: config.Handler(websocketHandler), ReadTimeout: requestTimeout,