<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;">&nbsp;&nbsp; Each SIP message MUST be carried within a single WebSocket message,</div><div style="margin: 0px; font-size: 13px; font-family: Courier;">&nbsp;&nbsp; and a WebSocket message MUST NOT contain more than one SIP message.</div><div style="margin: 0px; font-size: 13px; font-family: Courier;">&nbsp;&nbsp; Because the WebSocket transport preserves message boundaries, the use</div><div style="margin: 0px; font-size: 13px; font-family: Courier;">&nbsp;&nbsp; of the Content-Length header in SIP messages is not necessary when</div><div style="margin: 0px; font-size: 13px; font-family: Courier;">&nbsp;&nbsp; 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;">&nbsp; &nbsp; &nbsp; This simplifies the parsing of SIP messages for both clients and</div><div style="margin: 0px; font-size: 13px; font-family: Courier;">&nbsp; &nbsp; &nbsp; servers.&nbsp; There is no need to establish message boundaries using</div><div style="margin: 0px; font-size: 13px; font-family: Courier;">&nbsp; &nbsp; &nbsp; Content-Length headers between messages.&nbsp; Other SIP transports,</div><div style="margin: 0px; font-size: 13px; font-family: Courier;">&nbsp; &nbsp; &nbsp; such as UDP and the Stream Control Transmission Protocol (SCTP)</div><div style="margin: 0px; font-size: 13px; font-family: Courier;">&nbsp; &nbsp; &nbsp; [<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&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0433ff">private</span>&nbsp;<span style="color: #0433ff">void</span>&nbsp;<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&amp;path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">handleUpgrade</a>(<span style="color: #0433ff">final</span>&nbsp;<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&amp;path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">HttpUpgradeParser</a>&nbsp;<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&amp;path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">parser</a>)&nbsp;{</div><div style="margin: 0px; color: rgb(35, 35, 35);"><span style="color: #a9a9a9">336&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0433ff">final</span>&nbsp;<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&amp;path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">String</a>&nbsp;<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&amp;path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">contentLength</a>&nbsp;=&nbsp;<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&amp;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&amp;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&amp;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&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0433ff">if</span>&nbsp;(!<span style="color: #ffa501">"0"</span>.<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&amp;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&amp;path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">contentLength</a>))&nbsp;{</div><div style="margin: 0px; color: rgb(255, 165, 1);"><span style="color: #a9a9a9">338&nbsp;</span><span style="color: #232323">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&amp;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&amp;path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">setException</a>(</span><span style="color: #0433ff">new</span><span style="color: #232323">&nbsp;<a href="http://codenav.org/code.html?project=/org/jboss/xnio/xnio-api/3.2.0.Beta3&amp;path=/Source%20Packages/org.xnio.http/HttpUpgrade.java#hyperlink">IOException</a>(</span>"For&nbsp;now&nbsp;upgrade&nbsp;responses&nbsp;must&nbsp;have&nbsp;a&nbsp;content&nbsp;length&nbsp;of&nbsp;zero."<span style="color: #232323">));</span></div><div style="margin: 0px; color: rgb(35, 35, 35);"><span style="color: #a9a9a9">339&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0433ff">return</span>;</div><div style="margin: 0px; color: rgb(35, 35, 35);"><span style="color: #a9a9a9">340&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">by that:</div><div style="margin: 0px;">&nbsp;&nbsp; &nbsp; &nbsp; private void handleUpgrade(final HttpUpgradeParser parser) {</div><div style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Map&lt;String, String&gt; simpleHeaders = new HashMap&lt;&gt;();</div><div style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(Map.Entry&lt;String, List&lt;String&gt;&gt; e : parser.getHeaders().entrySet()) {</div><div style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; simpleHeaders.put(e.getKey(), e.getValue().get(0));</div><div style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; final String contentLength = simpleHeaders.get("content-length");</div><div style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (contentLength != null) {</div><div style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!"0".equals(contentLength)) {</div><div style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; future.setException(new IOException("Upgrade responses must have a content length of zero."));</div><div style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</div><div style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</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 &lt;<a href="mailto:fruehbeck@aon.at">fruehbeck@aon.at</a>&gt; 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">&lt;<a moz-do-not-send="true" href="mailto:fruehbeck@aon.at" target="_blank">fruehbeck@aon.at</a>&gt;</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>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:92)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:77)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:155)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:115)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:47)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:271)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at
                org.jboss.ejb.client.EJBClient.createSession(EJBClient.java:200)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.jboss.ejb.client.naming.ejb.EjbNamingContext.doCreateProxy(EjbNamingContext.java:216)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:193)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
org.jboss.ejb.client.naming.ejb.EjbNamingContext.lookup(EjbNamingContext.java:176)<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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>