Commit a16c4b6
Fix chunked pipelined requests (#12071)
* Fix pipelined request for chunked bodies
This addresses a variety of bugs concerning pipelined requests. In
particular, the HttpTunnel logic had fundamentally assumed that it could
consume all bytes available in the producer's reader. If a request was
pipelined after a previous request that had a chunked body, this would
result in the second request being unparsed and either sent along to the
origin or dropped on the floor, depening on configuration. This adds an
explicit autest for pipelined requests and addresses these issues.
This patch largely does the following:
1. Updates the copy_partial_post_data data to take the number of bytes
it consumes rather than consuming all bytes in the reader. It also
now returns the number of bytes it consumes, which the tunnel needs
to keep track of the number of bytes it processes.
2. Previous to this patch, the HttpTunnel assumed that it could consume
all bytes in the reader originally passed to it (all bytes in
init_bytes_done). This simply will not work for pipelined requests.
This addresses this issue by adding a new variable to the tunnel:
bytes_consumed. This way the tunnel can keep track of how many bytes
it consumed while processing the request body, which allows the
HttpSM to later process just the right number of bytes from its
reader rather than eating into any pipelined requests that follow it.
3. The HttpSM must not consume bytes from its client reader that are
pipelined requests. It now uses the tunnel's processing
bytes_consumed to process bytes from its reader rather than simply
consuming all read_available() bytes from it.
* Fix bytes consumed chunk computation
Fix a possible miscalculation of bytes consumed while parsing chunked
content.
* is_read_closed fix
* Verify expected responses are received.
* Updated formatting
---------
Co-authored-by: Brian Neradt <brian.neradt@gmail.com>1 parent 1cca4a2 commit a16c4b6
File tree
15 files changed
+796
-116
lines changed- proxy
- http2
- http
- src/traffic_server
- tests/gold_tests
- pipeline
- redirect
- timeout
15 files changed
+796
-116
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
241 | 247 | | |
242 | 248 | | |
243 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
973 | 973 | | |
974 | 974 | | |
975 | 975 | | |
976 | | - | |
977 | | - | |
| 976 | + | |
978 | 977 | | |
979 | | - | |
980 | 978 | | |
981 | 979 | | |
982 | 980 | | |
| |||
3633 | 3631 | | |
3634 | 3632 | | |
3635 | 3633 | | |
3636 | | - | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
3637 | 3652 | | |
3638 | 3653 | | |
3639 | 3654 | | |
| |||
6095 | 6110 | | |
6096 | 6111 | | |
6097 | 6112 | | |
6098 | | - | |
6099 | | - | |
| 6113 | + | |
| 6114 | + | |
6100 | 6115 | | |
6101 | 6116 | | |
6102 | 6117 | | |
| |||
6125 | 6140 | | |
6126 | 6141 | | |
6127 | 6142 | | |
6128 | | - | |
6129 | | - | |
6130 | 6143 | | |
6131 | | - | |
6132 | | - | |
6133 | | - | |
| 6144 | + | |
| 6145 | + | |
| 6146 | + | |
| 6147 | + | |
| 6148 | + | |
| 6149 | + | |
| 6150 | + | |
| 6151 | + | |
| 6152 | + | |
| 6153 | + | |
| 6154 | + | |
| 6155 | + | |
| 6156 | + | |
| 6157 | + | |
| 6158 | + | |
| 6159 | + | |
| 6160 | + | |
| 6161 | + | |
| 6162 | + | |
| 6163 | + | |
6134 | 6164 | | |
6135 | 6165 | | |
6136 | 6166 | | |
| |||
6847 | 6877 | | |
6848 | 6878 | | |
6849 | 6879 | | |
| 6880 | + | |
| 6881 | + | |
6850 | 6882 | | |
6851 | 6883 | | |
6852 | 6884 | | |
| |||
8564 | 8596 | | |
8565 | 8597 | | |
8566 | 8598 | | |
8567 | | - | |
8568 | | - | |
| 8599 | + | |
| 8600 | + | |
8569 | 8601 | | |
8570 | 8602 | | |
8571 | | - | |
| 8603 | + | |
8572 | 8604 | | |
8573 | | - | |
8574 | | - | |
8575 | | - | |
8576 | | - | |
| 8605 | + | |
| 8606 | + | |
| 8607 | + | |
| 8608 | + | |
| 8609 | + | |
| 8610 | + | |
8577 | 8611 | | |
8578 | 8612 | | |
8579 | 8613 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
317 | | - | |
| 316 | + | |
| 317 | + | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
| 334 | + | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| |||
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
753 | | - | |
754 | | - | |
| 753 | + | |
| 754 | + | |
755 | 755 | | |
756 | | - | |
| 756 | + | |
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
| |||
0 commit comments