summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2004-01-12 14:08:08 +0000
committerJoe Orton <jorton@apache.org>2004-01-12 14:08:08 +0000
commit7f52c2bfe4a05a1581b3195f5231e641f414343c (patch)
tree104fcab32c8d6a7b9ae61529a58081cb4bddce6e /modules
parent3b97e32bf775a47b3d3d1391a83b0038c0c41038 (diff)
downloadhttpd-7f52c2bfe4a05a1581b3195f5231e641f414343c.tar.gz
* modules/proxy/proxy_http.c (ap_proxy_http_process_response): Handle
all 1xx interim responses the same, one of the two 2616 compliance issues in PR 19442. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102283 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/proxy/proxy_http.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c
index 5b9154c372..7dc8e87275 100644
--- a/modules/proxy/proxy_http.c
+++ b/modules/proxy/proxy_http.c
@@ -794,11 +794,8 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
apr_bucket *e;
apr_bucket_brigade *bb;
int len, backasswards;
- int received_continue = 1; /* flag to indicate if we should
- * loop over response parsing logic
- * in the case that the origin told us
- * to HTTP_CONTINUE
- */
+ int interim_response; /* non-zero whilst interim 1xx responses
+ * are being read. */
bb = apr_brigade_create(p, c->bucket_alloc);
@@ -812,7 +809,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
*/
rp->proxyreq = PROXYREQ_RESPONSE;
- while (received_continue) {
+ do {
apr_brigade_cleanup(bb);
len = ap_getline(buffer, sizeof(buffer), rp, 0);
@@ -935,11 +932,11 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
p_conn->close += 1;
}
- if ( r->status != HTTP_CONTINUE ) {
- received_continue = 0;
- } else {
+ interim_response = ap_is_HTTP_INFO(r->status);
+ if (interim_response) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL,
- "proxy: HTTP: received 100 CONTINUE");
+ "proxy: HTTP: received interim %d response",
+ r->status);
}
/* we must accept 3 kinds of date, but generate only 1 kind of date */
@@ -999,7 +996,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
/* send body - but only if a body is expected */
if ((!r->header_only) && /* not HEAD request */
- (!ap_is_HTTP_INFO(r->status)) && /* not any 1xx response */
+ !interim_response && /* not any 1xx response */
(r->status != HTTP_NO_CONTENT) && /* not 204 */
(r->status != HTTP_RESET_CONTENT) && /* not 205 */
(r->status != HTTP_NOT_MODIFIED)) { /* not 304 */
@@ -1078,7 +1075,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"proxy: header only");
}
- }
+ } while (interim_response);
if ( conf->error_override ) {
/* the code above this checks for 'OK' which is what the hook expects */
@@ -1092,8 +1089,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
int status = r->status;
r->status = HTTP_OK;
/* Discard body, if one is expected */
- if ((status > 199) && /* not any 1xx response */
- (status != HTTP_NO_CONTENT) && /* not 204 */
+ if ((status != HTTP_NO_CONTENT) && /* not 204 */
(status != HTTP_RESET_CONTENT) && /* not 205 */
(status != HTTP_NOT_MODIFIED)) { /* not 304 */
ap_discard_request_body(rp);