Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 82414 invoked from network); 4 Jan 2006 04:35:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Jan 2006 04:35:29 -0000 Received: (qmail 16861 invoked by uid 500); 4 Jan 2006 04:35:27 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 16838 invoked by uid 500); 4 Jan 2006 04:35:27 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 16827 invoked by uid 99); 4 Jan 2006 04:35:27 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jan 2006 20:35:27 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 03 Jan 2006 20:35:26 -0800 Received: (qmail 82277 invoked by uid 65534); 4 Jan 2006 04:35:06 -0000 Message-ID: <20060104043506.82273.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r365824 - /httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c Date: Wed, 04 Jan 2006 04:35:06 -0000 To: cvs@httpd.apache.org From: ianh@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ianh Date: Tue Jan 3 20:35:03 2006 New Revision: 365824 URL: http://svn.apache.org/viewcvs?rev=365824&view=rev Log: show me the header please Modified: httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c Modified: httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c?rev=365824&r1=365823&r2=365824&view=diff ============================================================================== --- httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c (original) +++ httpd/httpd/branches/fcgi-proxy-dev/modules/proxy/mod_proxy_fcgi.c Tue Jan 3 20:35:03 2006 @@ -311,6 +311,53 @@ 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 @@ 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; }