<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div style="margin: 0px;">Jason G. commented out XNIO-222 to see the spec about the content-lenght.</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">I found this:</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;"><a href="https://tools.ietf.org/html/rfc7118">https://tools.ietf.org/html/rfc7118</a></div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: Courier;"> Each SIP message MUST be carried within a single WebSocket message,</div><div style="margin: 0px; font-size: 13px; font-family: Courier;"> and a WebSocket message MUST NOT contain more than one SIP message.</div><div style="margin: 0px; font-size: 13px; font-family: Courier;"> Because the WebSocket transport preserves message boundaries, the use</div><div style="margin: 0px; font-size: 13px; font-family: Courier;"> of the Content-Length header in SIP messages is not necessary when</div><div style="margin: 0px; font-size: 13px; font-family: Courier;"> they are transported using the WebSocket subprotocol.</div><div style="margin: 0px; font-size: 13px; font-family: Courier; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: Courier;"> This simplifies the parsing of SIP messages for both clients and</div><div style="margin: 0px; font-size: 13px; font-family: Courier;"> servers. There is no need to establish message boundaries using</div><div style="margin: 0px; font-size: 13px; font-family: Courier;"> Content-Length headers between messages. Other SIP transports,</div><div style="margin: 0px; font-size: 13px; font-family: Courier;"> such as UDP and the Stream Control Transmission Protocol (SCTP)</div><div style="margin: 0px; font-size: 13px; font-family: Courier;"> [<a href="https://tools.ietf.org/html/rfc4168"><span style="color: rgb(4, 46, 238);">RFC4168</span></a>], also provide this benefit.</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">It was fixed, so the previous problem it is not present anymore:</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">This was replaced:</div><div style="margin: 0px;"><br></div><div style="margin: 0px; color: rgb(35, 35, 35);"><span style="color: #a9a9a9">335 </span> <span style="color: #0433ff">private</span> <span style="color: #0433ff">void</span> <a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">handleUpgrade</a>(<span style="color: #0433ff">final</span> <a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">HttpUpgradeParser</a> <a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">parser</a>) {</div><div style="margin: 0px; color: rgb(35, 35, 35);"><span style="color: #a9a9a9">336 </span> <span style="color: #0433ff">final</span> <a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">String</a> <a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">contentLength</a> = <a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">parser</a>.<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">getHeaders</a>().<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">get</a>(<span style="color: #ffa501">"content-length"</span>);</div><div style="margin: 0px; color: rgb(35, 35, 35);"><span style="color: #a9a9a9">337 </span> <span style="color: #0433ff">if</span> (!<span style="color: #ffa501">"0"</span>.<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">equals</a>(<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">contentLength</a>)) {</div><div style="margin: 0px; color: rgb(255, 165, 1);"><span style="color: #a9a9a9">338 </span><span style="color: #232323"> <a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">future</a>.<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">setException</a>(</span><span style="color: #0433ff">new</span><span style="color: #232323"> <a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">IOException</a>(</span>"For now upgrade responses must have a content length of zero."<span style="color: #232323">));</span></div><div style="margin: 0px; color: rgb(35, 35, 35);"><span style="color: #a9a9a9">339 </span> <span style="color: #0433ff">return</span>;</div><div style="margin: 0px; color: rgb(35, 35, 35);"><span style="color: #a9a9a9">340 </span> }</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">by that:</div><div style="margin: 0px;"> private void handleUpgrade(final HttpUpgradeParser parser) {</div><div style="margin: 0px;"> Map<String, String> simpleHeaders = new HashMap<>();</div><div style="margin: 0px;"> for(Map.Entry<String, List<String>> e : parser.getHeaders().entrySet()) {</div><div style="margin: 0px;"> simpleHeaders.put(e.getKey(), e.getValue().get(0));</div><div style="margin: 0px;"> }</div><div style="margin: 0px;"> final String contentLength = simpleHeaders.get("content-length");</div><div style="margin: 0px;"> if (contentLength != null) {</div><div style="margin: 0px;"> if (!"0".equals(contentLength)) {</div><div style="margin: 0px;"> future.setException(new IOException("Upgrade responses must have a content length of zero."));</div><div style="margin: 0px;"> return;</div><div style="margin: 0px;"> }</div><div style="margin: 0px;">}</div></div><div style="margin: 0px;"><br></div><div style="margin: 0px;"><div><div style="margin: 0px;">Seems to me that the content length should not be informed in your case, or if it is in the header the value should be 0 to the upgrade operation.</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">Thx</div><div style="margin: 0px;">Eduardo Sant'Ana da Silva</div><div style="margin: 0px; min-height: 14px;"><br></div></div></div><div style="margin: 0px;"><br></div><div><div>On Nov 24, 2015, at 10:34 PM, Thomas Frühbeck <<a href="mailto:fruehbeck@aon.at">fruehbeck@aon.at</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<div bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">you nailed it, thanks!<br>
unfortunate though :-/<br>
<br>
Am 25.11.2015 um 01:30 schrieb Eduardo Sant´Ana da Silva:<br>
</div>
<blockquote cite="mid:CAFVp3Z7r8+E2ro3HUhh7KNHBs-fi9jO9LwSXffLVuV4Jx3xqAA@mail.gmail.com" type="cite">
<div dir="ltr">Maybe this could help:
<div><br>
</div>
<div><a moz-do-not-send="true" href="https://issues.jboss.org/browse/XNIO-222">https://issues.jboss.org/browse/XNIO-222</a></div>
<div><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-11-24 20:33 GMT-02:00 Thomas
Frühbeck <span dir="ltr"><<a moz-do-not-send="true" href="mailto:fruehbeck@aon.at" target="_blank">fruehbeck@aon.at</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
I wanted to experiment with Wildfly 10.0.0.CR4 and
Remoting and got the<br>
followin error on client side. I know, that my client
works perfectly<br>
with 9.0.2.Final.<br>
Can you guide me to the relevant changes, is this a
known problem?<br>
<br>
WARN: Could not register a EJB receiver for connection
to localhost:8080<br>
java.lang.RuntimeException: java.io.IOException: For now
upgrade<br>
responses must have a content length of zero.<br>
at<br>
org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:92)<br>
at<br>
org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:77)<br>
at<br>
org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51)<br>
at<br>
org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:155)<br>
at<br>
org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:115)<br>
at<br>
org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:47)<br>
at<br>
org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:271)<br>
at<br>
org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281)<br>
at
org.jboss.ejb.client.EJBClient.createSession(EJBClient.java:200)<br>
at<br>
org.jboss.ejb.client.naming.ejb.EjbNamingContext.doCreateProxy(EjbNamingContext.java:216)<br>
at<br>
org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:193)<br>
at<br>
org.jboss.ejb.client.naming.ejb.EjbNamingContext.lookup(EjbNamingContext.java:176)<br>
at
javax.naming.InitialContext.lookup(InitialContext.java:417)<br>
<br>
Thanks,<br>
Thomas<br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a moz-do-not-send="true" href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
<a moz-do-not-send="true" href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div><font size="1"><span style="font-family:Arial">________________</span><span style="font-family:Arial">__________</span><br>
</font></div>
<div>
<div style="font-family:Arial" align="left"><font size="1">Eduardo Sant'Ana da Silva - Dr.</font></div>
<div style="font-family:Arial"><font face="Arial" size="1">Pesquisador / Consultor de TI<br>
</font></div>
<div style="font-family:Arial;font-size:small"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</div>
</blockquote></div><br></body></html>