https://issues.apache.org/bugzilla/show_bug.cgi?id=55638
Bug ID: 55638 Summary: [websocket] Tomcat corrupts binary websocket messages when using the NIO connector Product: Tomcat 8 Version: trunk Hardware: PC Status: NEW Severity: normal Priority: P2 Component: WebSocket Assignee: dev@tomcat.apache.org Reporter: kpreis...@apache.org Created attachment 30907 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30907&action=edit Test case When writing a binary websocket message with about 25 KB, the client will get corrupted data starting on Offset 0x2000 when running Tomcat with the NIO connector. To reproduce: 1) Checkout current trunk (r1529816) and apply the attached patch locally. This will modify the Echo example so that the JavaScript sends a Base64-encoded String to Tomcat, and Tomcat will decode it as byte[] array and send it back using a binary websocket message. The JavaScript will then compare each byte and report if differences are found. 2) Start Tomcat using the NIO connector on 64-Bit Windows with a 64-bit JVM. 3) Open the Echo example (http://localhost:8080/examples/websocket/echo.xhtml) with Firefox or Chrome. 4) The page will print lines such as the following: Offset 0x2000: Excepted [0x80] but got [0x89] Offset 0x2001: Excepted [0xE4] but got [0x50] Offset 0x2002: Excepted [0x69] but got [0x4E] Offset 0x2003: Excepted [0xDD] but got [0x47] Offset 0x2004: Excepted [0x8F] but got [0x0D] Offset 0x2005: Excepted [0x9A] but got [0x0A] [...] This indicates that there were differences between the sent and the received message. 5) If you try this with the APR connector, the page will print: "No errors found." so with APR the problems don't occur. If you try this with the BIO connector (and repeatedly press F5 in Firefox), the page will sometimes print "No errors found", but sometimes it will print nothing as then Tomcat did not call the EchoAnnotation#echoMessage method. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org