[or-cvs] Become capable of noticing that we are done sending a direc...

Nick Mathewson nickm at seul.org
Sun Jun 18 20:58:29 UTC 2006


Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv9483/src/or

Modified Files:
	dirserv.c 
Log Message:
Become capable of noticing that we are done sending a directory.

Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.338
retrieving revision 1.339
diff -u -p -d -r1.338 -r1.339
--- dirserv.c	18 Jun 2006 08:46:55 -0000	1.338
+++ dirserv.c	18 Jun 2006 20:58:27 -0000	1.339
@@ -1804,6 +1804,7 @@ connection_dirserv_add_dir_bytes_to_outb
 
   bytes = DIRSERV_BUFFER_MIN - buf_datalen(conn->outbuf);
   tor_assert(bytes > 0);
+  tor_assert(conn->cached_dir);
   if (bytes < 8192)
     bytes = 8192;
   remaining = conn->cached_dir->dir_z_len - conn->cached_dir_offset;
@@ -1819,7 +1820,7 @@ connection_dirserv_add_dir_bytes_to_outb
                             bytes, conn);
   }
   conn->cached_dir_offset += bytes;
-  if (bytes == (int)conn->cached_dir->dir_z_len) {
+  if (conn->cached_dir_offset == (int)conn->cached_dir->dir_z_len) {
     /* We just wrote the last one; finish up. */
     if (conn->zlib_state) {
       connection_write_to_buf_zlib(conn, conn->zlib_state, "", 0, 1);



More information about the tor-commits mailing list