Commit e68020e
committed
mod_http2: RST_STREAM an incomplete response on the legacy c2 path
On the legacy c2 path, c2_process() always h2_beam_close()d the output
beam when the handler returned. A response whose body never completed,
e.g. a CGI that sent status, headers and a partial body and then timed
out, was closed with no EOS. h2_beam_is_complete() reports such a closed
beam complete, so s_c2_done() sends no reset.
The only remaining reset, stream_data_cb() on APR_EOF, is starved:
h2_beam_receive() returns APR_EOF only on a receive that transfers zero
buckets from a closed beam. The single wakeup at close drives one
receive, which usually transfers the response's trailing flush and
returns APR_SUCCESS, so the stream re-suspends; no further wakeup follows
and it parks, and the client hangs waiting for data that never comes.
Abort the beam instead when a final response was started but never
completed and is not header-only, the same test s_c2_done() applies. An
aborted beam returns APR_ECONNABORTED from the top of h2_beam_receive(),
before the transfer, so the terminal is observed on that one receive
regardless of any trailing buckets. Header-only responses (204/304/HEAD)
are still closed normally; only genuinely truncated responses are reset.1 parent 68447bc commit e68020e
3 files changed
Lines changed: 68 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
805 | 805 | | |
806 | 806 | | |
807 | 807 | | |
808 | | - | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
809 | 822 | | |
810 | 823 | | |
811 | 824 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
169 | 209 | | |
170 | 210 | | |
171 | 211 | | |
| |||
0 commit comments