]> granicus.if.org Git - apache/commitdiff
Use ap_log_rdata() to dump the FastCGI header, axing a bunch
authorJeff Trawick <trawick@apache.org>
Sat, 21 Sep 2013 18:59:47 +0000 (18:59 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 21 Sep 2013 18:59:47 +0000 (18:59 +0000)
of custom data dumping code.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1525281 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_fcgi.c

index ab2e83dc835e3d250aa97589f75206e9df6fc1bb..ee7029002ca5fd70dad245c46fef4f6211185221 100644 (file)
@@ -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_rec *conn, proxy_dir_conf *conf,
                 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);