Commit b150ae4
committed
BUG/MAJOR: mux-h1: Properly handle wrapping on obuf when dumping the first-line
The formatting of the first-line, for a request or a response, does not
properly handle the wrapping of the output buffer. This may lead to a data
corruption for the current response or eventually for the previous one.
Utility functions used to format the first-line of the request or the
response rely on the chunk API. So it is not expected to pass a buffer that
wraps. Unfortunatly, because of a change performed during the 2.9 dev cycle,
the output buffer was direclty used instead of a non-wrapping buffer created
from it with b_make() function. It is not an issue for the request because
its start-line is always the first block formatted in the output buffer. But
for the response, the output may be not empty and may wrap. In that case,
the response start-line is dumped at a random position in the buffer,
corrupting data. AFAIK, it is only an issue if the HTTP request pipelining
is used.
To fix the issue, we now take care to create a non-wapping buffer from the
output buffer.
This patch should fix issues #2779 and #2996. It must be backported as far as
2.9.1 parent c5d0342 commit b150ae4
2 files changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
| 954 | + | |
954 | 955 | | |
955 | 956 | | |
956 | 957 | | |
| |||
985 | 986 | | |
986 | 987 | | |
987 | 988 | | |
| 989 | + | |
988 | 990 | | |
989 | 991 | | |
990 | 992 | | |
| |||
1018 | 1020 | | |
1019 | 1021 | | |
1020 | 1022 | | |
| 1023 | + | |
1021 | 1024 | | |
1022 | 1025 | | |
1023 | 1026 | | |
| |||
1042 | 1045 | | |
1043 | 1046 | | |
1044 | 1047 | | |
| 1048 | + | |
1045 | 1049 | | |
1046 | 1050 | | |
1047 | 1051 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2341 | 2341 | | |
2342 | 2342 | | |
2343 | 2343 | | |
| 2344 | + | |
2344 | 2345 | | |
2345 | 2346 | | |
2346 | 2347 | | |
| |||
2365 | 2366 | | |
2366 | 2367 | | |
2367 | 2368 | | |
| 2369 | + | |
2368 | 2370 | | |
2369 | 2371 | | |
2370 | | - | |
| 2372 | + | |
2371 | 2373 | | |
2372 | 2374 | | |
| 2375 | + | |
| 2376 | + | |
2373 | 2377 | | |
2374 | 2378 | | |
2375 | 2379 | | |
| |||
2424 | 2428 | | |
2425 | 2429 | | |
2426 | 2430 | | |
| 2431 | + | |
2427 | 2432 | | |
2428 | 2433 | | |
2429 | 2434 | | |
| |||
2450 | 2455 | | |
2451 | 2456 | | |
2452 | 2457 | | |
| 2458 | + | |
2453 | 2459 | | |
2454 | 2460 | | |
2455 | | - | |
| 2461 | + | |
2456 | 2462 | | |
2457 | 2463 | | |
| 2464 | + | |
| 2465 | + | |
2458 | 2466 | | |
2459 | 2467 | | |
2460 | 2468 | | |
| |||
0 commit comments