summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-03-26 18:12:16 +1000
committerteor <teor@torproject.org>2019-03-29 17:26:30 +1000
commit194b25f0c7043b2485bb90da6fb24c0e96957875 (patch)
tree8df526797eca8f67814e2b8da2d60e4db462e5bc /src
parentc2222ba169a059e1a6ce04cb9014fe8870674d87 (diff)
downloadtor-194b25f0c7043b2485bb90da6fb24c0e96957875.tar.gz
tor-194b25f0c7043b2485bb90da6fb24c0e96957875.zip
dircache: Refactor handle_get_next_bandwidth() to use connection_dir_buf_add()
Implements ticket 29897.
Diffstat (limited to 'src')
-rw-r--r--src/feature/dircache/dircache.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/feature/dircache/dircache.c b/src/feature/dircache/dircache.c
index caa085dd63..62eb4c86c2 100644
--- a/src/feature/dircache/dircache.c
+++ b/src/feature/dircache/dircache.c
@@ -1486,13 +1486,10 @@ handle_get_next_bandwidth(dir_connection_t *conn,
conn->compress_state = tor_compress_new(1, compress_method,
choose_compression_level(len/2));
log_debug(LD_DIR, "Compressing bandwidth file.");
- connection_buf_add_compress(bandwidth, len, conn, 0);
- /* Flush the compression state. */
- connection_buf_add_compress("", 0, conn, 1);
} else {
log_debug(LD_DIR, "Not compressing bandwidth file.");
- connection_buf_add(bandwidth, len, TO_CONN(conn));
}
+ connection_dir_buf_add((const char*)bandwidth, len, conn, 1);
tor_free(bandwidth);
return 0;
}