Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-48184

QWebSocketServer disconnects a client if HTTP handshake arrives in multiple TCP segments

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 5.15.2, 6.3, 5.15
    • 5.5.1
    • WebSockets
    • None

    Description

      Looks really similar to QTBUG-40878, but in QWebSocketServer instead of QWebSocket,

      Attached main.cpp starts a simple QWebSocketServer and a simple netcat test shows that the connection is killed if the handshake arrives in multiple TCP segments, the client is disconnected after sending the first line:

      $ nc -v localhost 8080
      Connection to localhost 8080 port [tcp/http-alt] succeeded!
      GET / HTTP/1.1
      

      but if you send the whole handshake using netcat the handshake is handler properly:

      $ nc -v localhost 8080 < handshake.txt 
      Connection to localhost 8080 port [tcp/http-alt] succeeded!
      HTTP/1.1 101 Switching Protocols
      Upgrade: websocket
      Connection: Upgrade
      Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
      Server: main
      Access-Control-Allow-Credentials: false
      Access-Control-Allow-Methods: GET
      Access-Control-Allow-Headers: content-type
      Access-Control-Allow-Origin: http://127.0.0.1/
      Date: Wed, 09 Sep 2015 07:24:35 GMT
      
      you're being processed...
      

      Attachments

        1. handshake.txt
          0.2 kB
        2. main.cpp
          2 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              oyheskes Øystein Heskestad
              marko.silokunnas Marko Silokunnas
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes