mirror of
https://github.com/apache/httpd.git
synced 2025-08-07 04:02:58 +03:00
mod_proxy_http: follow up to r1853409.
Don't send two final 0-size chunks when the last read brigade is a single EOS. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1853518 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -336,10 +336,10 @@ static int stream_reqbody_chunked(proxy_http_req_t *req)
|
|||||||
}
|
}
|
||||||
|
|
||||||
apr_brigade_length(input_brigade, 1, &bytes);
|
apr_brigade_length(input_brigade, 1, &bytes);
|
||||||
|
if (bytes) {
|
||||||
hdr_len = apr_snprintf(chunk_hdr, sizeof(chunk_hdr),
|
hdr_len = apr_snprintf(chunk_hdr, sizeof(chunk_hdr),
|
||||||
"%" APR_UINT64_T_HEX_FMT CRLF,
|
"%" APR_UINT64_T_HEX_FMT CRLF,
|
||||||
(apr_uint64_t)bytes);
|
(apr_uint64_t)bytes);
|
||||||
|
|
||||||
ap_xlate_proto_to_ascii(chunk_hdr, hdr_len);
|
ap_xlate_proto_to_ascii(chunk_hdr, hdr_len);
|
||||||
e = apr_bucket_transient_create(chunk_hdr, hdr_len,
|
e = apr_bucket_transient_create(chunk_hdr, hdr_len,
|
||||||
bucket_alloc);
|
bucket_alloc);
|
||||||
@@ -351,6 +351,18 @@ static int stream_reqbody_chunked(proxy_http_req_t *req)
|
|||||||
e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc);
|
e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc);
|
||||||
APR_BRIGADE_INSERT_TAIL(input_brigade, e);
|
APR_BRIGADE_INSERT_TAIL(input_brigade, e);
|
||||||
}
|
}
|
||||||
|
else if (APR_BRIGADE_EMPTY(header_brigade)) {
|
||||||
|
if (!seen_eos) {
|
||||||
|
/* Metadata only (shouldn't happen), read more */
|
||||||
|
apr_brigade_cleanup(input_brigade);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* At EOS, we are done since the trailing 0-size is handled
|
||||||
|
* outside this loop.
|
||||||
|
*/
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* If we never sent the header brigade, so go ahead and
|
/* If we never sent the header brigade, so go ahead and
|
||||||
* take care of that now by prepending it.
|
* take care of that now by prepending it.
|
||||||
|
Reference in New Issue
Block a user