From: André Malo Date: Tue, 19 Aug 2003 16:03:03 +0000 (+0000) Subject: fix %b format to write really "-" if bytes_sent == 0. X-Git-Tag: pre_ajp_proxy~1260 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa20e7a4a7fd817bb9c4189ee86eb3c15f206e87;p=apache fix %b format to write really "-" if bytes_sent == 0. Submitted by: Kess git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101021 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 745785f51c..d25fcf336f 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) mod_log_config: Fix %b log format to write really "-" when 0 bytes + were sent (e.g. with 304 or 204 response codes). [Astrid Keßler] + *) Fix a bug, where mod_deflate sometimes unconditionally compressed the content if the Accept-Encoding header contained only other tokens than "gzip" (such as "deflate"). PR 21523. [Joe Orton, André Malo] diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 6b11e6f419..414038397a 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -418,7 +418,7 @@ static const char *log_status(request_rec *r, char *a) static const char *clf_log_bytes_sent(request_rec *r, char *a) { - if (!r->sent_bodyct) { + if (!r->sent_bodyct || !r->bytes_sent) { return "-"; } else { @@ -428,7 +428,7 @@ static const char *clf_log_bytes_sent(request_rec *r, char *a) static const char *log_bytes_sent(request_rec *r, char *a) { - if (!r->sent_bodyct) { + if (!r->sent_bodyct || !r->bytes_sent) { return "0"; } else {