tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Ricles <>
Subject Error with finding of reserve bits in websocket frame tomcat 7.0.53?
Date Thu, 04 Dec 2014 15:26:19 GMT
I have tomcat 7.0.53 and have been having a problem with the following
error when sending a binary message "CloseReason: code [1002], reason
[The client frame set the reserved bits to [x] which was not supported
by this endpoint]" where x is between 1-7 when printed out. So I
remote debugged and stepped through the WsFrameBase.class source code.
This source code is what sets the reserve bit so I stepped through the
following piece of the code

      //further up in the code input buffer is set
      inputBuffer = new byte[Constants.DEFAULT_BUFFER_SIZE];

        //calculation of reserve
        int b = inputBuffer[readPos++];
        fin = (b & 0x80) > 0;
        rsv = (b & 0x70) >>> 4;
        if (rsv != 0) {
            // Note extensions may use rsv bits but currently no extensions are
            // supported
            throw new WsIOException(new CloseReason(
                    sm.getString("wsFrame.wrongRsv", Integer.valueOf(rsv))));

However I have noticed when the line "int b = inputBuffer[readPos++];"
it sometimes changes the value of the reserve bit from 0 to a number
between 1-7. Why would this be changing the reserve bit? Is this
possibly an error with what I am doing or an error due to the class
from tomcat that is running?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message