[or-cvs] Apparent 311 fix: apparently passing Z_FINISH an empty stri...

Nick Mathewson nickm at seul.org
Thu Jun 29 11:19:54 UTC 2006


Update of /home/or/cvsroot/tor/src/or
In directory moria:/home/nickm/src/tor/src/or

Modified Files:
	dirserv.c 
Log Message:
Apparent 311 fix: apparently passing Z_FINISH an empty string is problematic.

Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.351
retrieving revision 1.352
diff -u -p -d -r1.351 -r1.352
--- dirserv.c	22 Jun 2006 07:34:04 -0000	1.351
+++ dirserv.c	29 Jun 2006 11:19:52 -0000	1.352
@@ -1827,10 +1827,15 @@ connection_dirserv_add_servers_to_outbuf
       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
 
   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;
   }



More information about the tor-commits mailing list