diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-06-18 20:58:27 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-06-18 20:58:27 +0000 |
commit | f1993b8b30a937bf8958575e4309ae0e976c87b7 (patch) | |
tree | 4e9e6767aac5f10c2d059000e43b9dfe4f810823 /src | |
parent | 5c0d7fb01692179388d0e3df46bc772141e3f1d2 (diff) | |
download | tor-f1993b8b30a937bf8958575e4309ae0e976c87b7.tar tor-f1993b8b30a937bf8958575e4309ae0e976c87b7.tar.gz |
Become capable of noticing that we are done sending a directory.
svn:r6659
Diffstat (limited to 'src')
-rw-r--r-- | src/or/dirserv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 8788d2f21..2421d6ff9 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1804,6 +1804,7 @@ connection_dirserv_add_dir_bytes_to_outbuf(connection_t *conn) 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_outbuf(connection_t *conn) 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); |