Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for all of the WebSocketUpgradeResponse to accumulate in the inputBuffer before validating it #9

Conversation

SreeramGarlapati
Copy link
Contributor

@@ -275,7 +277,8 @@ private boolean sendToUnderlyingInput() {
private void processInput() throws TransportException {
switch (webSocketState) {
case PN_WS_CONNECTING:
if (webSocketHandler.validateUpgradeReply(inputBuffer)) {
if ((inputBuffer.remaining() > MIN_WEB_SOCKET_UPGRADE_RESPONSE_SIZE)
&& webSocketHandler.validateUpgradeReply(inputBuffer)) {
Copy link
Member

Choose a reason for hiding this comment

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

Have we checked why inputBuffer didn't contain full payloads (handshake HTTP response) from a WebSocket server? Checking if the size of handshake payload is greater than 100 bytes doesn't guarantee that response header is fully retrieved. For instance, what if size is 101 and response is still partially retrieved?

@JamesBirdsall
Copy link
Contributor

Replaced by #12

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.

3 participants