From 985e7072650183a12c56e567081a40c39792b5db Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Thu, 24 Sep 2015 16:29:00 +0000 Subject: [PATCH] Don't count initial handshake I/O when determining the first byte. PR58454 Submitted By: Konstantin J. Chernov Committed By: covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1705099 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/loggers/mod_logio.c | 16 +++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 3a77f52d26..e58b23d779 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_logio: Fix logging of %^FB (time to first byte) on the first request on + an SSL connection. PR 58454. + [Konstantin J. Chernov ] + *) mod_ssl: Support compilation against libssl built with OPENSSL_NO_SSL3, and change the compiled-in default for SSL[Proxy]Protocol to "all -SSLv3", in accordance with RFC 7568. PR 58349, PR 57120. [Kaspar Brand] diff --git a/modules/loggers/mod_logio.c b/modules/loggers/mod_logio.c index ab922e30c6..e4473cb9c7 100644 --- a/modules/loggers/mod_logio.c +++ b/modules/loggers/mod_logio.c @@ -65,16 +65,14 @@ static void ap_logio_add_bytes_out(conn_rec *c, apr_off_t bytes) logio_config_t *cf = ap_get_module_config(c->conn_config, &logio_module); cf->bytes_out += bytes; - if (!cf->first_byte_seen) { - /* cleared during log_transaction, after mod_log_config */ + /* writes for handshake i/o, before cf->r is set in post_read_request, don't count */ + if (cf->r && !cf->first_byte_seen) { + /* cleared during log_transaction with cf->r, after mod_log_config */ + logio_dirconf_t *conf = (logio_dirconf_t*) + ap_get_module_config(cf->r->per_dir_config, &logio_module); cf->first_byte_seen = 1; - - if (cf->r) { - logio_dirconf_t *conf = (logio_dirconf_t*) - ap_get_module_config(cf->r->per_dir_config, &logio_module); - if (conf && conf->track_ttfb) { - cf->ttfb = apr_time_now() - cf->r->request_time; - } + if (conf && conf->track_ttfb) { + cf->ttfb = apr_time_now() - cf->r->request_time; } } } -- 2.40.0