mirror of
https://github.com/nginx/nginx.git
synced 2026-02-03 20:29:27 -05:00
Output chain: clear the last_buf flag unless inherited.
Some checks failed
buildbot / buildbot (push) Has been cancelled
Some checks failed
buildbot / buildbot (push) Has been cancelled
For instance, the last_buf flag is used in the http proxy module when creating HTTP/2 requests to indicate the output is closed. The flag is inherited in ngx_output_chain() to a destination buffer when reading the buffered request body. Then it is used in the proxy output filter to mark the last HTTP/2 DATA frame with END_STREAM. The problem happens when reusing the destination buffer, such as to re-read the buffered request body on next upstream, because this buffer may contain a dirty last_buf value, which breaks sending HTTP/2 request body in multiple output filter calls. The flush and last_in_chain flags are cleared for consistency.
This commit is contained in:
parent
cd12dc4f12
commit
3afd85e4b5
1 changed files with 10 additions and 0 deletions
|
|
@ -552,6 +552,11 @@ ngx_output_chain_copy_buf(ngx_output_chain_ctx_t *ctx)
|
||||||
dst->flush = src->flush;
|
dst->flush = src->flush;
|
||||||
dst->last_buf = src->last_buf;
|
dst->last_buf = src->last_buf;
|
||||||
dst->last_in_chain = src->last_in_chain;
|
dst->last_in_chain = src->last_in_chain;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
dst->flush = 0;
|
||||||
|
dst->last_buf = 0;
|
||||||
|
dst->last_in_chain = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -648,6 +653,11 @@ ngx_output_chain_copy_buf(ngx_output_chain_ctx_t *ctx)
|
||||||
dst->flush = src->flush;
|
dst->flush = src->flush;
|
||||||
dst->last_buf = src->last_buf;
|
dst->last_buf = src->last_buf;
|
||||||
dst->last_in_chain = src->last_in_chain;
|
dst->last_in_chain = src->last_in_chain;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
dst->flush = 0;
|
||||||
|
dst->last_buf = 0;
|
||||||
|
dst->last_in_chain = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue