You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Lijf <li...@edge-china.com> on 2001/06/28 15:21:47 UTC

Q:how to get the byte amounts

I want to get the byte amounts that sent to the client via Apache, so I write the following code

#!/usr/bin/perl
use strict;
package Apache::GetByte;
use Apache::Constants qw(:response);
use Apache ();
sub handler{
    my $r = shift;
    my $byte=$r->bytes_sent;
    warn "BYTE = $byte \n";
    return DECLINED;
 }
1;

In apache httpd.conf 
<Directory "public_html">
  SetHandler perl-script
  PerlLogHandler Apache::GetByte
</Directory>


but the result is BYTE = 0 in apache error_log. Why? What shall I do? 


Yours sincerely

Li junfeng
        Livin' on the Edge(Dalian)CO.Ltd
        Room 106, A Bldg. 1 Huoju Road
        Hi-Tech Zone, Dalian, China Zip:116023
        Tel:86-0411-4753511 Fax:86-0411-4753577
        E-mail lijunfeng@edge-china.com