httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1525281 - /httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c
Date Sat, 21 Sep 2013 18:59:47 GMT
Author: trawick
Date: Sat Sep 21 18:59:47 2013
New Revision: 1525281

URL: http://svn.apache.org/r1525281
Log:
Use ap_log_rdata() to dump the FastCGI header, axing a bunch
of custom data dumping code.

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

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c?rev=1525281&r1=1525280&r2=1525281&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c Sat Sep 21 18:59:47 2013
@@ -377,67 +377,6 @@ static int handle_headers(request_rec *r
     return 0;
 }
 
-static void dump_header_to_log(request_rec *r, unsigned char fheader[],
-                               apr_size_t length)
-{
-#ifdef FCGI_DUMP_HEADERS
-    apr_size_t posn = 0;
-    char asc_line[20];
-    char hex_line[60];
-    int i = 0;
-
-    memset(asc_line, 0, sizeof(asc_line));
-    memset(hex_line, 0, sizeof(hex_line));
-
-    while (posn < length) {
-        unsigned char c = fheader[posn];
-
-        if (i >= 20) {
-            i = 0;
-
-            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01064)
-                          "HEADER: %s %s", asc_line, hex_line);
-
-            memset(asc_line, 0, sizeof(asc_line));
-            memset(hex_line, 0, sizeof(hex_line));
-        }
-
-        if (isprint(c)) {
-            asc_line[i] = c;
-        }
-        else {
-            asc_line[i] = '.';
-        }
-
-        if ((c >> 4) >= 10) {
-            hex_line[i * 3] = 'a' + ((c >> 4) - 10);
-        }
-        else {
-            hex_line[i * 3] = '0' + (c >> 4);
-        }
-
-        if ((c & 0x0F) >= 10) {
-            hex_line[i * 3 + 1] = 'a' + ((c & 0x0F) - 10);
-        }
-        else {
-            hex_line[i * 3 + 1] = '0' + (c & 0xF);
-        }
-
-        hex_line[i * 3 + 2] = ' ';
-
-        i++;
-        posn++;
-    }
-
-    if (i != 1) {
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01065) "HEADER: %s %s",
-                      asc_line, hex_line);
-    }
-
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01066) "HEADER: -EOH-");
-#endif
-}
-
 static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf,
                              request_rec *r, apr_pool_t *setaside_pool,
                              apr_uint16_t request_id)
@@ -561,7 +500,10 @@ static apr_status_t dispatch(proxy_conn_
                 break;
             }
 
-            dump_header_to_log(r, farray, AP_FCGI_HEADER_LEN);
+#ifdef FCGI_DUMP_HEADERS
+            ap_log_rdata(APLOG_MARK, APLOG_DEBUG, r, "FastCGI header",
+                         farray, AP_FCGI_HEADER_LEN, 0);
+#endif
 
             ap_fcgi_header_fields_from_array(&version, &type, &rid,
                                              &clen, &plen, farray);



Mime
View raw message