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
This commit is contained in:
Roger Dingledine 2006-12-14 03:26:42 +00:00
parent c9c8072bd3
commit 30e4f4f6ce

View file

@ -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();