summaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-08-19 10:59:15 -0400
committerNick Mathewson <nickm@torproject.org>2014-08-24 13:04:27 -0400
commit8e55cafd672353979e7628d5dad9e12429b401dd (patch)
tree5c21280017363ee9b31356013d7ab5961bfa4f04 /src/or/circuitlist.c
parentec59167cae1f5b3057ed722857d78ec78239e991 (diff)
downloadtor-8e55cafd672353979e7628d5dad9e12429b401dd.tar.gz
tor-8e55cafd672353979e7628d5dad9e12429b401dd.zip
Count zlib buffer memory towards OOM totals.
Part of 11792. (Uses the zlib-endorsed formula for memory needs for inflate/deflate from "zconf.h".)
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 9aeb3eb19a..c738f9357f 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1811,6 +1811,14 @@ marked_circuit_single_conn_free_bytes(connection_t *conn)
result += buf_allocation(conn->outbuf);
buf_clear(conn->outbuf);
}
+ if (conn->type == CONN_TYPE_DIR) {
+ dir_connection_t *dir_conn = TO_DIR_CONN(conn);
+ if (dir_conn->zlib_state) {
+ result += tor_zlib_state_size(dir_conn->zlib_state);
+ tor_zlib_free(dir_conn->zlib_state);
+ dir_conn->zlib_state = NULL;
+ }
+ }
return result;
}