aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-06-18 08:53:09 +0000
committerNick Mathewson <nickm@torproject.org>2006-06-18 08:53:09 +0000
commit337ad6420b1826e5895225c54259d0b4f25053ad (patch)
tree93d59b6a889f5e7833641f31613f0bedf28b0348 /src
parent537104c9085ae0829593a97491e454259d03227f (diff)
downloadtor-337ad6420b1826e5895225c54259d0b4f25053ad.tar
tor-337ad6420b1826e5895225c54259d0b4f25053ad.tar.gz
Make connection_write_to_buf_zlib set outbuf_flushlen right.
svn:r6651
Diffstat (limited to 'src')
-rw-r--r--src/or/connection.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 451f21ea2..2454b978c 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1602,12 +1602,14 @@ connection_write_to_buf_zlib(connection_t *conn,
int done)
{
int r;
+ size_t old_datalen;
if (!data_len)
return;
/* if it's marked for close, only allow write if we mean to flush it */
if (conn->marked_for_close && !conn->hold_open_until_flushed)
return;
+ old_datalen = buf_datalen(conn->outbuf);
/* XXXX TOO much duplicate code! XXXX012NM */
CONN_LOG_PROTECT(conn, r = write_to_buf_zlib(
conn->outbuf, state, data, data_len,
@@ -1629,7 +1631,7 @@ connection_write_to_buf_zlib(connection_t *conn,
}
connection_start_writing(conn);
- conn->outbuf_flushlen += data_len;
+ conn->outbuf_flushlen += buf_datalen(conn->outbuf) - old_datalen;
}
/** Return the conn to addr/port that has the most recent