]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Apply backport
authorJim Jagielski <jim@apache.org>
Tue, 28 Aug 2007 13:30:39 +0000 (13:30 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 28 Aug 2007 13:30:39 +0000 (13:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@570416 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/proxy/mod_proxy_http.c

diff --git a/STATUS b/STATUS
index 47c73c722aac681693829dcd19b468eec821ae4e..2b1c46c1ebdda34651ab906b1345a2bef172f9f4 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -79,13 +79,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-    * mod_proxy: Improve traces in ap_proxy_http_process_response()
-      to investigate PR37770.
-      Trunk version of patch:
-        http://svn.apache.org/viewvc?view=rev&rev=549420
-        http://svn.apache.org/viewvc?view=rev&rev=561778
-      +1: jfclere, rpluem, jim
-
     * mod_ssl: Version reporting update; displays 'compiled against'
       Apache and build-time SSL Library versions at loglevel [info],
       while reporting the run-time SSL Library version in the server
index ba19810a25e09f7d33fa2aefe9c37101ea4ffebe..c8fd8c5d8dc0ac0a6b44450b580c5140e87be7d4 100644 (file)
@@ -1190,6 +1190,28 @@ static int addit_dammit(void *v, const char *key, const char *val)
     return 1;
 }
 
+static
+apr_status_t ap_proxygetline(apr_bucket_brigade *bb, char *s, int n, request_rec *r,
+                             int fold, int *writen)
+{
+    char *tmp_s = s;
+    apr_status_t rv;
+    apr_size_t len;
+
+    rv = ap_rgetline(&tmp_s, n, &len, r, fold, bb);
+    apr_brigade_cleanup(bb);
+
+    if (rv == APR_SUCCESS) {
+        *writen = (int) len;
+    } else if (rv == APR_ENOSPC) {
+        *writen = n;
+    } else {
+        *writen = -1;
+    }
+
+    return rv;
+}
+
 static
 apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                                             proxy_conn_rec *backend,
@@ -1202,7 +1224,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
     char keepchar;
     request_rec *rp;
     apr_bucket *e;
-    apr_bucket_brigade *bb;
+    apr_bucket_brigade *bb, *tmp_bb;
     int len, backasswards;
     int interim_response; /* non-zero whilst interim 1xx responses
                            * are being read. */
@@ -1221,16 +1243,19 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
      * response.
      */
     rp->proxyreq = PROXYREQ_RESPONSE;
+    tmp_bb = apr_brigade_create(p, c->bucket_alloc);
     do {
+        apr_status_t rc;
+
         apr_brigade_cleanup(bb);
 
-        len = ap_getline(buffer, sizeof(buffer), rp, 0);
+        rc = ap_proxygetline(tmp_bb, buffer, sizeof(buffer), rp, 0, &len);
         if (len == 0) {
             /* handle one potential stray CRLF */
-            len = ap_getline(buffer, sizeof(buffer), rp, 0);
+            rc = ap_proxygetline(tmp_bb, buffer, sizeof(buffer), rp, 0, &len);
         }
         if (len <= 0) {
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r,
                           "proxy: error reading status line from remote "
                           "server %s", backend->hostname);
             return ap_proxyerror(r, HTTP_BAD_GATEWAY,