Uploaded image for project: 'hicn'
  1. hicn
  2. HICN-520

Wrong number of bytes read on http-proxy

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 20.05
    • None
    • None
    • None

      The framing of HTTP header/payload perfomed by the http-proxy may fail in the following situation:

      The server send to the client 2 HTTP responses chained, as response of w http requests sent one after the other:

      -------------------------------------------------------------------------

        Headers1       Payload1              Headers2    Payload2                               

      -------------------------------------------------------------------------

              10B                  10B                         10B                          50B

      The libasio will store in the input buffer a number of bytes which may be the sum of the 2 HTTP responses: 10 + 10 + 10 + 50 = 80

      When the http proxy performs the framing, it will first reads the Headers1, from where it learns that the next payload1 is 10B. So it will read from the network 10B minus the bytes already received, in this case 40 Bytes (the total input buffer minus Headers1). This operation will result in an unexpected result (10 - 40 = -30), and the next read of payload1 will fail.

       

            mauro91 Mauro Sardara
            mauro91 Mauro Sardara
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: