summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Holsman <ianh@apache.org>2006-01-04 04:35:03 +0000
committerIan Holsman <ianh@apache.org>2006-01-04 04:35:03 +0000
commit82621236baefde8a998648ef8084566477f6aa55 (patch)
tree937aaa986badbc8889d42dc320dd1dd7552e38b8
parent17fe7b54b5957b9b65b7ef2434169969798317c4 (diff)
downloadhttpd-82621236baefde8a998648ef8084566477f6aa55.tar.gz
show me the header please
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/fcgi-proxy-dev@365824 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/proxy/mod_proxy_fcgi.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c
index fc32f04927..8cf96258c3 100644
--- a/modules/proxy/mod_proxy_fcgi.c
+++ b/modules/proxy/mod_proxy_fcgi.c
@@ -311,6 +311,53 @@ typedef struct {
apr_pool_t *scratch_pool;
} proxy_fcgi_baton_t;
+static void dump_header_to_log( request_rec *r, unsigned char fheader[], apr_size_t length)
+{
+ char asc_line[20];
+ char hex_line[60];
+ int i=0;
+ apr_size_t posn=0;
+ memset(asc_line,0,sizeof(asc_line));
+ memset(hex_line,0,sizeof(hex_line));
+ while (posn < length) {
+ unsigned char c = fheader[posn];
+ char hexval[3];
+ if (i >= 20) {
+ i=0;
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "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++;
+ }
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "HEADER: %s %s",
+ asc_line,
+ hex_line);
+}
static apr_status_t dispatch(proxy_conn_rec *conn, request_rec *r,
int request_id)
{
@@ -429,9 +476,12 @@ static apr_status_t dispatch(proxy_conn_rec *conn, request_rec *r,
break;
}
+
+ dump_header_to_log( r, fheader, readbuflen);
if (readbuflen != FCGI_HEADER_LEN) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
- "proxy: FCGI: Failed to read entire header");
+ "proxy: FCGI: Failed to read entire header got %d wanted %d",
+ readbuflen, FCGI_HEADER_LEN);
rv = APR_EINVAL;
break;
}