aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-12-14 03:26:42 +0000
committerRoger Dingledine <arma@torproject.org>2006-12-14 03:26:42 +0000
commit30e4f4f6ce17dfe8e0a44a45c0fecda689ece475 (patch)
treec04b23e44622c60d46b061890f77bf4188269dea /src
parentc9c8072bd305888af80b090c68d4fadf4c2a7208 (diff)
downloadtor-30e4f4f6ce17dfe8e0a44a45c0fecda689ece475.tar
tor-30e4f4f6ce17dfe8e0a44a45c0fecda689ece475.tar.gz
when we're doing a write split over the end of a circular
buffer, make sure our tls_get_forced_write_size doesn't make it write whatever's after the buffer. this hasn't triggered yet, but it would be rare, so let's leave it in. svn:r9107
Diffstat (limited to 'src')
-rw-r--r--src/or/buffers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index cf25390b8..eca91ae3b 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -694,6 +694,10 @@ flush_buf_tls(tor_tls_t *tls, buf_t *buf, size_t sz, size_t *buf_flushlen)
flushlen0 = sz;
_split_range(buf, buf->cur, &flushlen0, &flushlen1);
+ if (flushlen1) {
+ size_t forced = tor_tls_get_forced_write_size(tls);
+ tor_assert(forced <= flushlen0);
+ }
r = flush_buf_tls_impl(tls, buf, flushlen0, buf_flushlen);
check();