httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject Re: apache 2.0.43: %b not showing "bytes sent" but "bytes requested"
Date Sat, 12 Oct 2002 10:19:47 GMT
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


Mime
View raw message