You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Torbjörn Carlsson <to...@mobilitypartner.se> on 2003/05/13 16:15:42 UTC

Proposal: Header-size

Hi.
In the move from 1.3 to 2.0, a parameter in mod_log_config changed.
%B/%b changed from bytes *really* sent to the same value as the response-header 
Content-Length, regardless of how much data that was actually sent over the 
wire. 

I've seen comments on the list of the type "use mod_logio instead", but 
mod_logio is different in one aspect: It includes the header-size.

In an unreliable network (read wireless or mobile) I need the ability to 
confirm that all data has been sent to the client.
Because of the variable size of the response-header this is not really possible 
with mod_logio as is. The best I can get is an approximation. 
"If %O > %B => Download probably OK"

To fix this I've patched http_protocol to get the header-size data, (See 
included patch), to put the header-size in a note in the request_rec.
This data can then be picked up in the log-module with %{Header-Size}n
"%O - %{Header-Size}n => Bytes downloaded"

Are there any problems with this patch, have I missed some sideeffects, or is 
it something that can be added to the source-tree, for example to the mod_logio 
instrumentation ?

Regards
/Torbjörn

--
Torbjörn Carlsson                               Mobility Partner AB
email:  torbjorn.carlsson@mobilitypartner.se    Box 1117, Kungsbron 21
phone:  +46 730 40 68 10                        111 81 Stockholm




RE: Proposal: Header-size

Posted by David Burry <db...@tagnet.org>.
If you only want a boolean confirmation of whether the request was
successful you might be able to use %c to get that effect, but if you
need real bytes for billing purposes or some other reason a count of
actual amount transferred you'd need to use mod_logio instead yes (which
is actually better for my example purpose since headers do cost on the
wire).

In principle I'm not against fixing %B/b to be like the old behavior or
adding a new header count value, because you can already get the value
from the Content-Length from %{Content-Length}o so no use in really
duplicating the same thing with using up one of those valuable single
letter values....  There was resistance to fixing %b/B to be like the
old behavior because it was supposedly very hard to do without redoing
the entire internal infrastructure or something...  If you can find a
way to do it anyway I'd be for keeping backward compatibility on
principle as well... ;o)

Dave


> -----Original Message-----
> From: Torbjörn Carlsson [mailto:torbjorn.carlsson@mobilitypartner.se] 
> Sent: Tuesday, May 13, 2003 7:16 AM
> To: dev@httpd.apache.org
> Subject: Proposal: Header-size
> 
> 
> 
> Hi.
> In the move from 1.3 to 2.0, a parameter in mod_log_config changed.
> %B/%b changed from bytes *really* sent to the same value as 
> the response-header 
> Content-Length, regardless of how much data that was actually 
> sent over the 
> wire. 
> 
> I've seen comments on the list of the type "use mod_logio 
> instead", but 
> mod_logio is different in one aspect: It includes the header-size.
> 
> In an unreliable network (read wireless or mobile) I need the 
> ability to 
> confirm that all data has been sent to the client.
> Because of the variable size of the response-header this is 
> not really possible 
> with mod_logio as is. The best I can get is an approximation. 
> "If %O > %B => Download probably OK"
> 
> To fix this I've patched http_protocol to get the header-size 
> data, (See 
> included patch), to put the header-size in a note in the request_rec.
> This data can then be picked up in the log-module with %{Header-Size}n
> "%O - %{Header-Size}n => Bytes downloaded"
> 
> Are there any problems with this patch, have I missed some 
> sideeffects, or is 
> it something that can be added to the source-tree, for 
> example to the mod_logio 
> instrumentation ?
> 
> Regards
> /Torbjörn
> 
> --
> Torbjörn Carlsson                               Mobility Partner AB
> email:  torbjorn.carlsson@mobilitypartner.se    Box 1117, Kungsbron 21
> phone:  +46 730 40 68 10                        111 81 Stockholm
> 
> 
> 
>