mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Merge branch 'maint-0.3.1'
This commit is contained in:
commit
22f441d4ee
7
changes/bug22719
Normal file
7
changes/bug22719
Normal file
@ -0,0 +1,7 @@
|
||||
o Minor bugfixes (compression):
|
||||
- When spooling compressed data to an output buffer, don't try to
|
||||
spool more data when there is no more data to spool and we are
|
||||
not trying to flush the input. Previously, we would sometimes
|
||||
launch compression requests with nothing to do, which interferes
|
||||
with our 22672 checks. Fixes bug 22719; bugfix on 0.2.0.16-alpha.
|
||||
|
@ -2084,7 +2084,7 @@ fetch_from_buf_line(buf_t *buf, char *data_out, size_t *data_len)
|
||||
int
|
||||
write_to_buf_compress(buf_t *buf, tor_compress_state_t *state,
|
||||
const char *data, size_t data_len,
|
||||
int done)
|
||||
const int done)
|
||||
{
|
||||
char *next;
|
||||
size_t old_avail, avail;
|
||||
@ -2106,8 +2106,10 @@ write_to_buf_compress(buf_t *buf, tor_compress_state_t *state,
|
||||
case TOR_COMPRESS_ERROR:
|
||||
return -1;
|
||||
case TOR_COMPRESS_OK:
|
||||
if (data_len == 0)
|
||||
if (data_len == 0) {
|
||||
tor_assert_nonfatal(!done);
|
||||
over = 1;
|
||||
}
|
||||
break;
|
||||
case TOR_COMPRESS_BUFFER_FULL:
|
||||
if (avail) {
|
||||
@ -2116,6 +2118,11 @@ write_to_buf_compress(buf_t *buf, tor_compress_state_t *state,
|
||||
* whether were going to or not. */
|
||||
need_new_chunk = 1;
|
||||
}
|
||||
if (data_len == 0 && !done) {
|
||||
/* We've consumed all the input data, though, so there's no
|
||||
* point in forging ahead right now. */
|
||||
over = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
buf->datalen += old_avail - avail;
|
||||
|
Loading…
Reference in New Issue
Block a user