-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve bufio handling in Upgrader.Upgrade
Use Reader.Size() (add in Go 1.10) to get the bufio.Reader's size instead of examining the return value from Reader.Peek. Use Writer.AvailableBuffer() (added in Go 1.18) to get the bufio.Writer's buffer instead of observing the buffer in the underlying writer. Allow client to send data before the handshake is complete. Previously, Upgrader.Upgrade rudely closed the connection.
- Loading branch information
Showing
3 changed files
with
95 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters