Reset buf->highwater every time buf_shrink is called, not just on suffessful shrink.

svn:r4353
This commit is contained in:
Nick Mathewson 2005-06-08 20:17:32 +00:00
parent 9ed7b53143
commit b0538591c7

View File

@ -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 <b>n</b> bytes from buf.