httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject Re: [PATCH: Apache 2.0] mod_log_config: input/output bytes
Date Wed, 21 Aug 2002 05:40:02 GMT
Quoting Justin Erenkrantz <jerenkrantz@apache.org>:

> > So, r->bytes_sent would then be completely different that in the
> current
> > version of Apache 1.3/2.0, which simply reflects the length of the
> body?
> > Would others be inclined to accept such a change?
> 
> Totally.  The current behavior is broken.  We all pretty much agree
> that it is wrong.

Sorry to be a pest... I just wanted to reiterate on this one. Here is what
include/httpd.h says about the field:

-----------------
/** byte count in stream is for body */
apr_off_t sent_bodyct;

/** body byte count, for easy access */
apr_off_t bytes_sent;
-----------------

which indicates that bytes_sent is a body byte count, not total count. If that
is what's intended, then it is just the matter of semantics, which doesn't make
it a bug. The fact that this field is then used as total count is another
matter. And this then also makes webalizer and other reports that depend on it
incorrect.

So, if the above is true, the request_rec should have these extra fields:

-----------------
/* The length of the response prepared to be sent to the client.
   For HEAD requests this does not include the length of the body.
   For GET/POST requests this inludes body and all headers. */
apr_off_t response_length;

/* Actual number of bytes written to the client during this request.
   This number might be zero for some keepalive connections. */
apr_off_t bytes_pushed;

/* Actual number of bytes received from the client during this request. */
apr_off_t bytes_pulled;
-----------------

Or something similar. Things would then be much cleaner, at the expense of some
memory space.

Unless, of course, the comment above bytes_sent is misleading and it doesn't
reflect what was intended with the field.

Bojan

Mime
View raw message