Re: [mp2] Problems with $r->bytes_sent and $r->status in log handler

[prev] [thread] [next] [Date index for 2005/04/19]

From: Joe Orton
Subject: Re: [mp2] Problems with $r->bytes_sent and $r->status in log handler
Date: 12:27 on 19 Apr 2005
On Mon, Apr 18, 2005 at 10:49:10PM +0200, Markus Wichitill wrote:
> Hi,
> 
> I have a log handler that is supposed to log whether certain 
> HTTP-authenticated customers were able to completely download their digital 
> deliveries. The mod_perl 1.x version works just fine.
> 
> Now under SuSE Linux 9.2/Apache 2.0.53/mod_perl 2.0 RC4, $r->bytes_sent 
> seems to always contain the full size of the file resource, not the bytes 
> really sent to the client on an interrupted download. Unless it's a byte 
> range request, in which case it contains the full size of the range. Does 
> anybody know whether this is perhaps expected behaviour under Apache2, 
> maybe a result of its fancy filter architecture? Could it be a mod_perl 
> bug,  or is mod_perl only a thin wrapper around the C structures in this 
> case, and therefore most likely innocent?

Yes, r->bytes_sent is a misnomer, it's just set to the size of the
response body in 2.0 as you surmise.  IIRC the issue is that buckets
from one request may get buffered and not sent during the lifetime of
the request, so it's not easy to give a truly accurate count of "bytes
sent to the network for this response".

I don't know about your r->status issue, if you think this is some
mod_ssl issue and can make a C module which reproduces it I'll take a
look, preferably filed in bugzilla.

Regards,

joe

Re: [mp2] Problems with $r->bytes_sent and $r->status in log handler
Joe Orton 12:27 on 19 Apr 2005

Generated at 09:30 on 27 Apr 2005 by mariachi v0.52