From: Stephan Bosch Date: Fri, 16 Apr 2021 10:31:13 +0000 (+0200) Subject: lib: istream - Remove try_alloc_limit. X-Git-Tag: 2.3.18~286 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46970690e998fb3acff3dcaa3a1107fa2127f5ca;p=thirdparty%2Fdovecot%2Fcore.git lib: istream - Remove try_alloc_limit. --- diff --git a/src/lib/istream-private.h b/src/lib/istream-private.h index e8542b264e..7666bee5a5 100644 --- a/src/lib/istream-private.h +++ b/src/lib/istream-private.h @@ -38,7 +38,7 @@ struct istream_private { unsigned char *w_buffer; /* may be NULL */ size_t buffer_size, max_buffer_size, init_buffer_size, data_limit; - size_t skip, pos, try_alloc_limit; + size_t skip, pos; /* If seeking backwards within the buffer, the next read() will return again pos..high_pos */ size_t high_pos; diff --git a/src/lib/istream.c b/src/lib/istream.c index bf539c7e3a..fd37dc958e 100644 --- a/src/lib/istream.c +++ b/src/lib/istream.c @@ -909,12 +909,9 @@ bool i_stream_try_alloc(struct istream_private *stream, } if (stream->data_limit == 0 || - (stream->buffer_size - stream->skip) < stream->data_limit) { + (stream->buffer_size - stream->skip) < stream->data_limit) *size_r = stream->buffer_size - stream->pos; - if (stream->try_alloc_limit > 0 && - *size_r > stream->try_alloc_limit) - *size_r = stream->try_alloc_limit; - } else { + else { size_t buffered = (stream->pos - stream->skip); if (buffered >= stream->data_limit)