From: Timo Sirainen Date: Mon, 28 Jun 2004 16:13:59 +0000 (+0300) Subject: Allow giving 0 max_buffer_size, in which case "optimal" size is used. X-Git-Tag: 1.1.alpha1~3861 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b7eeffb5752b500ac62ba1fd01c4a8c4ada14e9;p=thirdparty%2Fdovecot%2Fcore.git Allow giving 0 max_buffer_size, in which case "optimal" size is used. --HG-- branch : HEAD --- diff --git a/src/lib/ostream-file.c b/src/lib/ostream-file.c index f6887df71d..44285acec1 100644 --- a/src/lib/ostream-file.c +++ b/src/lib/ostream-file.c @@ -858,5 +858,9 @@ o_stream_create_file(int fd, pool_t pool, size_t max_buffer_size, fstream->no_socket_cork = TRUE; } } + + if (max_buffer_size == 0) + fstream->max_buffer_size = fstream->optimal_block_size; + return ostream; } diff --git a/src/lib/ostream.h b/src/lib/ostream.h index f6b018818b..8ad1d9840c 100644 --- a/src/lib/ostream.h +++ b/src/lib/ostream.h @@ -10,6 +10,8 @@ struct ostream { struct _ostream *real_stream; }; +/* Create new output stream from given file descriptor. + If max_buffer_size is 0, an "optimal" buffer size is used (max 128kB). */ struct ostream * o_stream_create_file(int fd, pool_t pool, size_t max_buffer_size, int autoclose_fd);