kaazing / gateway

Kaazing Gateway
Apache License 2.0
141 stars 84 forks source link

wsn transport is reacting incorrectly to case where maximum ws message size is exceeded #463

Closed cmebarrow closed 8 years ago

cmebarrow commented 8 years ago

As @Anisotrop remarked in comments in https://github.com/kaazing/gateway/pull/445, the server (wsn transport) continues to read incoming data after detecting that the incoming WebSocket frame size exceeds the configured limit. This results in further protocol decoder errors and is also in violation of RFC 6455, which states (in section 7.1.7 Fail the WebSocket connection

An endpoint MUST NOT continue to attempt to
   process data (including a responding Close frame) from the remote
   endpoint after being instructed to _Fail the WebSocket Connection_.

and section 10.4. Implementation-Specific Limits implies that when the limit is exceeded the server should fail the WebSocket connection.

To reproduce:

    public void shouldRefuseBinaryFrameWithPayloadLengthExceeding128KiB() throws Exception {
        k3po.finish();
        throw new Exception("TEMP");
    }
sbadugu commented 8 years ago

@cmebarrow It seems like you already have the fix for this bug based on your comment. You can post the PR here and close this issue, when you are back :)

cmebarrow commented 8 years ago

Fix is in my branch gateway_issue_463

cmebarrow commented 8 years ago

This was fixed by PR https://github.com/kaazing/gateway/pull/466 which was merged on 28-Mar-16