Skip to content

Commit

Permalink
fix reusing buffers from hijack
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Mar 14, 2017
1 parent 56f7e37 commit 2e9a720
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions libcentrifugo/server/httpserver/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,8 @@ func (s *HTTPServer) runHTTPServer() error {
wsWriteBufferSize := s.config.WebsocketWriteBufferSize
s.RUnlock()

if wsReadBufferSize > 0 {
sockjs.WebSocketReadBufSize = wsReadBufferSize
}
if wsWriteBufferSize > 0 {
sockjs.WebSocketWriteBufSize = wsWriteBufferSize
}
sockjs.WebSocketReadBufSize = wsReadBufferSize
sockjs.WebSocketWriteBufSize = wsWriteBufferSize

sockjsOpts := sockjs.DefaultOptions

Expand Down Expand Up @@ -367,13 +363,6 @@ func (s *HTTPServer) RawWebsocketHandler(w http.ResponseWriter, r *http.Request)
wsWriteBufferSize := s.config.WebsocketWriteBufferSize
s.RUnlock()

if wsReadBufferSize == 0 {
wsReadBufferSize = sockjs.WebSocketReadBufSize
}
if wsWriteBufferSize == 0 {
wsWriteBufferSize = sockjs.WebSocketWriteBufSize
}

upgrader := websocket.Upgrader{
ReadBufferSize: wsReadBufferSize,
WriteBufferSize: wsWriteBufferSize,
Expand Down

1 comment on commit 2e9a720

@FZambia
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shame on me.. 😕

Please sign in to comment.