httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r549420 - /httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
Date Thu, 21 Jun 2007 08:01:31 GMT
Author: jfclere
Date: Thu Jun 21 01:01:30 2007
New Revision: 549420

URL: http://svn.apache.org/viewvc?view=rev&rev=549420
Log:
Improve traces in ap_proxy_http_process_response().
That will help to investigate PR 37770. (errors from backend :-)).

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_http.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_http.c?view=diff&rev=549420&r1=549419&r2=549420
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_http.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_http.c Thu Jun 21 01:01:30 2007
@@ -1184,6 +1184,28 @@
 }
 
 static
+apr_status_t ap_proxygetline(char *s, int n, request_rec *r,
+                             int fold, int *writen)
+{
+    char *tmp_s = s;
+    apr_status_t rv;
+    apr_size_t len;
+    apr_bucket_brigade *tmp_bb;
+
+    tmp_bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
+    rv = ap_rgetline(&tmp_s, n, &len, r, fold, tmp_bb);
+    apr_brigade_destroy(tmp_bb);
+
+    if (rv == APR_SUCCESS) {
+        *writen = (int) len;
+    } 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,
                                             conn_rec *origin,
@@ -1215,15 +1237,17 @@
      */
     rp->proxyreq = PROXYREQ_RESPONSE;
     do {
+        apr_status_t rc;
+
         apr_brigade_cleanup(bb);
 
-        len = ap_getline(buffer, sizeof(buffer), rp, 0);
+        rc = ap_proxygetline(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(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,



Mime
View raw message