Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 42896 invoked from network); 18 Apr 2005 20:57:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Apr 2005 20:57:36 -0000 Received: (qmail 2970 invoked by uid 500); 18 Apr 2005 20:57:23 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 2955 invoked by uid 500); 18 Apr 2005 20:57:23 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 2939 invoked by uid 99); 18 Apr 2005 20:57:23 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.logilune.com (HELO mail.logilune.com) (195.80.154.36) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 18 Apr 2005 13:57:22 -0700 Received: from [127.0.0.1] (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id 371A11E17AB; Mon, 18 Apr 2005 22:57:19 +0200 (CEST) Message-ID: <42641F2E.3020903@stason.org> Date: Mon, 18 Apr 2005 16:57:18 -0400 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050322 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: Markus Wichitill Cc: modperl Subject: Re: [mp2] Problems with $r->bytes_sent and $r->status in log handler References: <42641D46.7010505@gmx.de> In-Reply-To: <42641D46.7010505@gmx.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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: apr_off_t bytes_sent(obj, val=0) Apache2::RequestRec obj apr_off_t val PREINIT: /*nada*/ CODE: RETVAL = (apr_off_t) obj->bytes_sent; if (items > 1) { obj->bytes_sent = (apr_off_t) val; } OUTPUT: RETVAL 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: int status(obj, val=0) Apache2::RequestRec obj int val PREINIT: /*nada*/ CODE: RETVAL = (int) obj->status; if (items > 1) { obj->status = (int) val; } OUTPUT: RETVAL -- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com