mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andres Martinez Quijano (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRMINA-907) Create a WebSocket iofilter for use in Apache Mina TCP servers
Date Thu, 28 Nov 2013 13:47:43 GMT

    [ https://issues.apache.org/jira/browse/DIRMINA-907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13834843#comment-13834843

Andres Martinez Quijano commented on DIRMINA-907:

After a loooong time debugging I found another bug, that happens only on very specific messages.

in WebSocketEncoder.buildWSDataFrameBuffer it creates a new buffer and around line 66, when
setting the payload length it is:

if (buffer.capacity() <= 125) {

but it should be:

if (buf.capacity() <= 125) {

since otherwise it's checking on the size of the newly created buffer (which includes the
2 extra header bytes) and as such when the original payload is of size 124 or 125 it will
use 2 bytes as payload length, which makes the browser complain and close the connection [http://tools.ietf.org/html/rfc6455#section-5.2]

> Create a WebSocket iofilter for use in Apache Mina TCP servers
> --------------------------------------------------------------
>                 Key: DIRMINA-907
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-907
>             Project: MINA
>          Issue Type: New Feature
>          Components: Filter, Protocol - HTTP, Transport
>            Reporter: dhruv chopra
>         Attachments: MinaCodecUsage.png, WebSocketFilter.zip
> Shephertz has created a websocket iofilter that can be added in Apache mina tcp server
chain. The features of this codec are
> 1) Works with binary data sent/received over websocket
> 2) Abstracts the client details from the Handler code i.e. the handler need not be aware
that the remote endpoint is a browser or native client.
> 3) Tested with binary data sent/received on latest chrome and firefox browsers. IE 9
doesn't support websockets and we will make changes if required for IE 10 when its released
and if it supports websockets.

This message was sent by Atlassian JIRA

View raw message