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

QHttpServer HTTP chunked request body handling

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.12.2
    • Fix Version/s: None
    • Component/s: Network
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      Related to QTBUG-60105 (Jesus Fernandez)

      I have been playing a bit with QHttpServer and noticed that it does not handle the HTTP body correctly, for chunked requests - for example if I send HTTP POST, with body that is just plain binary data, the QHttpServerRequest::body() contains only the last chunk received.

      Just from a quick browse through the code:

      int QHttpServerRequestPrivate::onBody(http_parser *httpParser, const char *at, size_t length)
      {
          qCDebug(lc) << httpParser << QString::fromUtf8(at, int(length));
          auto i = instance(httpParser);
          i->state = State::OnBody;
          i->body = QByteArray(at, int(length));
          return 0;
      }
      

      The code should probably check that part of the body was already received? 

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              mikhailsvetkin Mikhail Svetkin
              Reporter:
              dimitar Dimitar Gospodinov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes