Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 41742 invoked by uid 500); 12 Oct 2002 10:11:57 -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: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 41729 invoked from network); 12 Oct 2002 10:11:56 -0000 Subject: Re: apache 2.0.43: %b not showing "bytes sent" but "bytes requested" From: Bojan Smojver To: Apache Dev List In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 12 Oct 2002 20:19:47 +1000 Message-Id: <1034417987.1205.57.camel@beast.rexursive.com> Mime-Version: 1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Sat, 2002-10-12 at 13:21, rbb@apache.org wrote: > What we are learning here is simple. We need to do the counting in the > core_output_filter. If that means adding a field to the conn_rec, or > somehow getting the request_rec in the core_output_filter doesn't > matter. The count needs to be done in the core_output_filter, by tallying > the amount of data actually written. On a more practical note... Looks like sendfile_it_all will have to change a bit (lucky it's not a public function). As it is, it doesn't seem to return the length actually sent (i.e. &unused_bytes_sent would have to be passed into it). Otherwise, we should be able to add up the unused_bytes_sent (and change the name of the variable at the same time :-) to get total bytes sent. Now, this would give us the total bytes sent but not in the sense of r->bytes_sent. However, it would be relatively easy to figure it out: r->bytes_sent = (total bytes sent) - ( (total size of brigades) - (content length) ) Total size of brigades is what mod_logio output filter does now, so that's easy. Content length is what what content_length_filter does now, that's easy too. The difference between them is obviously the length of the headers. If the end result (r->bytes_sent) is negative, we just toss it and keep r->bytes_sent = 0. Obviously, the functionality, or the filters themselves, from mod_logio could move into core.c and mod_log_config would make sure the counters are reset when the transaction ends. Bojan