-
Bug
-
Resolution: Done
-
Medium
-
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.