From b0538591c7692abd372f3690e7c2c7e46daf8810 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 8 Jun 2005 20:17:32 +0000 Subject: [PATCH] Reset buf->highwater every time buf_shrink is called, not just on suffessful shrink. svn:r4353 --- src/or/buffers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/or/buffers.c b/src/or/buffers.c index cf425be0f2..98dafb76b6 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -284,13 +284,13 @@ buf_shrink(buf_t *buf) while (buf->highwater < (new_len>>2) && new_len > MIN_LAZY_SHRINK_SIZE*2) new_len >>= 1; + buf->highwater = buf->datalen; if (new_len == buf->len) return; log_fn(LOG_DEBUG,"Shrinking buffer from %d to %d bytes.", (int)buf->len, (int)new_len); buf_resize(buf, new_len); - buf->highwater = buf->datalen; } /** Remove the first n bytes from buf.