aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-05-08 12:01:23 -0400
committerNick Mathewson <nickm@torproject.org>2014-05-08 12:01:23 -0400
commit5b861ae53f411fc577ac603bd7bfcf6cd1ce5fa4 (patch)
tree36ef5041c767be630868abd9a71de5a47a1358b1 /src
parenta32d7e1910176deef62583cef5d1195257bf3e17 (diff)
parentc86b709a077b5ef10f7c91963af3fd092f739a86 (diff)
downloadtor-5b861ae53f411fc577ac603bd7bfcf6cd1ce5fa4.tar
tor-5b861ae53f411fc577ac603bd7bfcf6cd1ce5fa4.tar.gz
Merge remote-tracking branch 'public/bug11648'
Diffstat (limited to 'src')
-rw-r--r--src/or/dirserv.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index f5994e031..2d623a655 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -3296,8 +3296,6 @@ connection_dirserv_add_servers_to_outbuf(dir_connection_t *conn)
}
body = signed_descriptor_get_body(sd);
if (conn->zlib_state) {
- /* XXXX024 This 'last' business should actually happen on the last
- * routerinfo, not on the last fingerprint. */
int last = ! smartlist_len(conn->fingerprint_stack);
connection_write_to_buf_zlib(body, sd->signed_descriptor_len, conn,
last);
@@ -3314,6 +3312,11 @@ connection_dirserv_add_servers_to_outbuf(dir_connection_t *conn)
if (!smartlist_len(conn->fingerprint_stack)) {
/* We just wrote the last one; finish up. */
+ if (conn->zlib_state) {
+ connection_write_to_buf_zlib("", 0, conn, 1);
+ tor_zlib_free(conn->zlib_state);
+ conn->zlib_state = NULL;
+ }
conn->dir_spool_src = DIR_SPOOL_NONE;
smartlist_free(conn->fingerprint_stack);
conn->fingerprint_stack = NULL;
@@ -3339,8 +3342,6 @@ connection_dirserv_add_microdescs_to_outbuf(dir_connection_t *conn)
if (!md || !md->body)
continue;
if (conn->zlib_state) {
- /* XXXX024 This 'last' business should actually happen on the last
- * routerinfo, not on the last fingerprint. */
int last = !smartlist_len(conn->fingerprint_stack);
connection_write_to_buf_zlib(md->body, md->bodylen, conn, last);
if (last) {
@@ -3352,6 +3353,11 @@ connection_dirserv_add_microdescs_to_outbuf(dir_connection_t *conn)
}
}
if (!smartlist_len(conn->fingerprint_stack)) {
+ if (conn->zlib_state) {
+ connection_write_to_buf_zlib("", 0, conn, 1);
+ tor_zlib_free(conn->zlib_state);
+ conn->zlib_state = NULL;
+ }
conn->dir_spool_src = DIR_SPOOL_NONE;
smartlist_free(conn->fingerprint_stack);
conn->fingerprint_stack = NULL;