perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [mp2] Problems with $r->bytes_sent and $r->status in log handler
Date Mon, 18 Apr 2005 20:57:18 GMT
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?

It's not even a wrapper in mp2, it's just an accessor to the r->bytes_sent 
record entry:

bytes_sent(obj, val=0)
     Apache2::RequestRec obj
     apr_off_t val


     RETVAL = (apr_off_t) obj->bytes_sent;

     if (items > 1) {

          obj->bytes_sent = (apr_off_t) val;


So you should probably ask at httpd-dev, Markus.

> If I add mod_ssl to the mix, $r->status acts wonky, too. When it should 
> be 200 (and $r->status_line contains the correct "200 OK"), it's the 
> apparently nonsensical 104. When it should be 206 for a byte range 
> request (and $r->status_line contains the correct "206 Partial 
> Content"), it's 200. Other people with the same user agent managed to 
> produce other combinations, though. Any ideas?

Same here:

status(obj, val=0)
     Apache2::RequestRec obj
     int val


     RETVAL = (int) obj->status;

     if (items > 1) {

          obj->status = (int) val;


Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message