Skip to content

Conversation

@feross
Copy link
Member

@feross feross commented Mar 7, 2017

Each time a websocket sends a request, parseWebSocketRequest is called. On the first parse, save important data from socket.upgradeReq and delete it to reduce memory usage.

cc @lpinca @DiegoRBaquero

@lpinca
Copy link
Contributor

lpinca commented Mar 7, 2017

Is parseWebSocketRequest() run multiple times for the same socket?

@feross
Copy link
Member Author

feross commented Mar 7, 2017

@lpinca Yes, it's run each time we get a message on the socket.

Copy link
Contributor

@lpinca lpinca left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@DiegoRBaquero DiegoRBaquero left a comment

Choose a reason for hiding this comment

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

LGTM

@lpinca
Copy link
Contributor

lpinca commented Mar 7, 2017

Maybe you can null the property in Server.prototype.onWebSocketConnection() instead of parseWebSocketRequest(). It's arguably cleaner so you can avoid the additional if in parseWebSocketRequest().

@lpinca
Copy link
Contributor

lpinca commented Mar 7, 2017

Anyway thank you for the invite @feross. I've accepted it but I know very little about this project and I doubt I can do any significant contribution :)

@feross feross merged commit 0c97366 into master Mar 8, 2017
@feross feross deleted the upgradereq branch March 8, 2017 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants