[jboss-jira] [JBoss JIRA] (JBWEB-238) HTTP Upgrade API Broken
Mike Brock (JIRA)
jira-events at lists.jboss.org
Fri Apr 13 16:30:49 EDT 2012
[ https://issues.jboss.org/browse/JBWEB-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12684081#comment-12684081 ]
Mike Brock commented on JBWEB-238:
----------------------------------
With Remy's proposed solution this is what tcpdump observed on the socket:
{noformat}
3"u03"u.HTTP/1.1 101 Switching Protocols
Server: Apache-Coyote/1.1
Upgrade: WebSocket
Connection: Upgrade
Sec-WebSocket-Protocol: J.REP1.0/ErraiBus
Sec-WebSocket-Origin: http://localhost:8080
Sec-WebSocket-Location: ws://localhost:8080/cdidemo2/in.erraiBusWS
Date: Fri, 13 Apr 2012 20:27:51 GMT
16:27:52.046258 IP localhost,unused.51722 > localhost,unused.http-alt: Flags [P.], seq 269:475, ack 314, win 40830, options [nop,nop,TS val 857896241 ecr 857896240], length 206
{noformat}
The magic string is not there. It appears Safari hung up before it had a chance to read it.
Now, with my patch applied:
{noformat}
3$$.3$$.HTTP/1.1 101 Switching Protocols
Server: Apache-Coyote/1.1
Upgrade: WebSocket
Connection: Upgrade
Sec-WebSocket-Protocol: J.REP1.0/ErraiBus
Sec-WebSocket-Origin: http://localhost:8080
Sec-WebSocket-Location: ws://localhost:8080/cdidemo2/in.erraiBusWS
Date: Fri, 13 Apr 2012 20:29:42 GMT
g......./^-.....
16:29:42.778277 IP localhost,unused.51774 > localhost,unused.http-alt: Flags [P.], seq 288:491, ack 314, win 40830, options [nop,nop,TS val 858006737 ecr 858006732], length 203
{noformat}
Hey, there it is!
> HTTP Upgrade API Broken
> -----------------------
>
> Key: JBWEB-238
> URL: https://issues.jboss.org/browse/JBWEB-238
> Project: JBoss Web
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: JBossWeb-7.0.13.GA
> Environment: Any
> Reporter: Mike Brock
> Assignee: Remy Maucherat
> Attachments: cdidemo2.war, JBossWeb.patch, Upgrade00ServletTest.java
>
>
> The HTTP Upgrade API currently does not permit reading and writing to the ServetOutputStream and ServletInputStream during the initial negotiation. All of the data is swallowed until after the negotiation and head exchange.
> Unfortunately this is insufficient as some WebSocket Draft Specification rely on data within the body of the request and response as part of the handshake.
> The attached patch fixes this problem.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list