In particular, properly output partial match at the end of a subrequest
response (much like we do at the end of a response), and reset/set the
last_in_chain flag as appropriate.
Reported by KAWAHARA Masashi.
b->last = ctx->copy_end;
b->shadow = NULL;
b->last_buf = 0;
+ b->last_in_chain = 0;
b->recycled = 0;
if (b->in_file) {
continue;
}
- if (ctx->buf->last_buf && ctx->looked.len) {
+ if (ctx->looked.len
+ && (ctx->buf->last_buf || ctx->buf->last_in_chain))
+ {
cl = ngx_chain_get_free_buf(r->pool, &ctx->free);
if (cl == NULL) {
return NGX_ERROR;
ctx->looked.len = 0;
}
- if (ctx->buf->last_buf || ctx->buf->flush
+ if (ctx->buf->last_buf || ctx->buf->flush || ctx->buf->sync
|| ngx_buf_in_memory(ctx->buf))
{
if (b == NULL) {
}
b->last_buf = ctx->buf->last_buf;
+ b->last_in_chain = ctx->buf->last_in_chain;
b->flush = ctx->buf->flush;
b->shadow = ctx->buf;