summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2005-12-11 00:50:21 +0000
committerRuediger Pluem <rpluem@apache.org>2005-12-11 00:50:21 +0000
commitc666adbbaec3bdcb062d7e2f157d9b8a91a005ce (patch)
treeb7b9ac23a1b496e29240686690d6ecd41b13f1c8
parent614df45f1e658368c3bb112433e9f306b70ab94f (diff)
downloadhttpd-c666adbbaec3bdcb062d7e2f157d9b8a91a005ce.tar.gz
* Let the proxy handler know that the backend connection broke after we have
sent the headers. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@355837 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/proxy/mod_proxy_ajp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c
index 22e7cefcd7..7d79eba713 100644
--- a/modules/proxy/mod_proxy_ajp.c
+++ b/modules/proxy/mod_proxy_ajp.c
@@ -138,6 +138,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
int havebody = 1;
int isok = 1;
apr_off_t bb_len;
+ int data_sent = 0;
#ifdef FLUSHING_BANDAID
apr_int32_t conn_poll_fd;
apr_pollfd_t *conn_poll;
@@ -348,6 +349,8 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
"proxy: error processing body");
isok = 0;
}
+ /* memorize that we sent data */
+ data_sent = 1;
apr_brigade_cleanup(output_brigade);
}
else {
@@ -363,6 +366,8 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
"proxy: error processing body");
isok = 0;
}
+ /* memorize that we sent data */
+ data_sent = 1;
break;
default:
isok = 0;
@@ -409,7 +414,15 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
"proxy: send body failed to %pI (%s)",
conn->worker->cp->addr,
conn->worker->hostname);
- return HTTP_SERVICE_UNAVAILABLE;
+ /*
+ * If we have sent data (and thus the headers) we must let the
+ * others know.
+ */
+ if (data_sent) {
+ return PROXY_BACKEND_BROKEN;
+ } else {
+ return HTTP_SERVICE_UNAVAILABLE;
+ }
}
/* Nice we have answer to send to the client */