If any preread body bytes were sent in the first chain, chunk size was
incorrectly added before the whole chain, including header, resulting in
an invalid request sent to upstream. Fixed to properly add chunk size
after the header.
u_char *chunk;
ngx_int_t rc;
ngx_buf_t *b;
- ngx_chain_t *out, *cl, *tl, **ll;
+ ngx_chain_t *out, *cl, *tl, **ll, **fl;
ngx_http_proxy_ctx_t *ctx;
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
size = 0;
cl = in;
+ fl = ll;
for ( ;; ) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
b->pos = chunk;
b->last = ngx_sprintf(chunk, "%xO" CRLF, size);
- tl->next = out;
- out = tl;
+ tl->next = *fl;
+ *fl = tl;
}
if (cl->buf->last_buf) {