Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 45651 invoked from network); 10 Feb 2009 20:17:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Feb 2009 20:17:15 -0000 Received: (qmail 19574 invoked by uid 500); 10 Feb 2009 20:17:09 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 19499 invoked by uid 500); 10 Feb 2009 20:17:08 -0000 Mailing-List: contact dev-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 dev@httpd.apache.org Received: (qmail 19490 invoked by uid 99); 10 Feb 2009 20:17:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Feb 2009 12:17:08 -0800 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of apache-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Feb 2009 20:17:01 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LWz21-00057U-SR for dev@httpd.apache.org; Tue, 10 Feb 2009 20:16:33 +0000 Received: from bi01p1.nc.us.ibm.com ([129.33.49.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Feb 2009 20:16:33 +0000 Received: from poirier by bi01p1.nc.us.ibm.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Feb 2009 20:16:33 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: dev@httpd.apache.org From: Dan Poirier Subject: Logging bytes sent Date: Tue, 10 Feb 2009 15:16:25 -0500 Lines: 17 Message-ID: <87eiy69heu.fsf@poir9.raleigh.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: bi01p1.nc.us.ibm.com User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:XSFet2zc5seRmST93yBm/mbRWTc= Sender: news X-Virus-Checked: Checked by ClamAV on apache.org It appears that %b logging of bytes sent can be wrong if something happens to the connection during the request processing. The number logged by mod_log_config is r->bytes_sent, which is computed in ap_content_length_filter(). If something goes wrong (maybe I pull Apache's network cable) while sending the response, the connection gets aborted, but r->bytes_sent isn't changed, and so the access log shows that the full length of the response was sent. You can add %X to the logging to see whether the connection was aborted, but the number of bytes sent logged is still wrong. I'm wondering if there's some good reason for this that I'm missing? Or maybe it's just an oversight I've noticed since I happen to be looking at that part of the code right now. Thanks, Dan