From 56bbaed0dc61190e730178d1d5a7f0cc10625bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20F=C3=A6r=C3=B8y?= Date: Tue, 7 Feb 2017 14:34:49 +0000 Subject: [PATCH] Log response size in connection_dir_client_reached_eof() This patch ensures that we log the size of the inbuf when a directory client have reached EOF on the connection. See: https://bugs.torproject.org/21206 --- src/or/directory.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/or/directory.c b/src/or/directory.c index 3881adba78..36714bc110 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1954,6 +1954,9 @@ connection_dir_client_reached_eof(dir_connection_t *conn) conn->base_.purpose == DIR_PURPOSE_FETCH_MICRODESC); time_t now = time(NULL); int src_code; + size_t received_bytes; + + received_bytes = connection_get_inbuf_len(TO_CONN(conn)); switch (connection_fetch_from_buf_http(TO_CONN(conn), &headers, MAX_HEADERS_SIZE, @@ -1982,10 +1985,13 @@ connection_dir_client_reached_eof(dir_connection_t *conn) log_debug(LD_DIR, "Received response from directory server '%s:%d': %d %s " - "(purpose: %d)", + "(purpose: %d, response size: " U64_FORMAT ", " + "compression: %d)", conn->base_.address, conn->base_.port, status_code, escaped(reason), - conn->base_.purpose); + conn->base_.purpose, + U64_PRINTF_ARG(received_bytes), + compression); if (conn->guard_state) { /* we count the connection as successful once we can read from it. We do