diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-06-29 11:19:52 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-06-29 11:19:52 +0000 |
commit | 475eb5d6fe5cbda92cdb03a3254977d793c27940 (patch) | |
tree | 451ffbdfc3fb2cc9f58030b5c3fc58fe07338846 /src | |
parent | 05eff35ac6d64b11f7cdc99740dd26e52cf4f701 (diff) | |
download | tor-475eb5d6fe5cbda92cdb03a3254977d793c27940.tar.gz tor-475eb5d6fe5cbda92cdb03a3254977d793c27940.zip |
Apparent 311 fix: apparently passing Z_FINISH an empty string is problematic.
svn:r6702
Diffstat (limited to 'src')
-rw-r--r-- | src/or/dirserv.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index ad81692d2e..f36dee5cb9 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1827,10 +1827,15 @@ connection_dirserv_add_servers_to_outbuf(connection_t *conn) continue; body = signed_descriptor_get_body(sd); if (conn->zlib_state) { + int last = ! smartlist_len(conn->fingerprint_stack); connection_write_to_buf_zlib( conn, conn->zlib_state, body, sd->signed_descriptor_len, - 0); + last); + if (last) { + tor_zlib_free(conn->zlib_state); + conn->zlib_state = NULL; + } } else { connection_write_to_buf(body, sd->signed_descriptor_len, @@ -1840,7 +1845,7 @@ connection_dirserv_add_servers_to_outbuf(connection_t *conn) if (!smartlist_len(conn->fingerprint_stack)) { /* We just wrote the last one; finish up. */ - connection_dirserv_finish_spooling(conn); + conn->dir_spool_src = DIR_SPOOL_NONE; smartlist_free(conn->fingerprint_stack); conn->fingerprint_stack = NULL; } |