[dovecot/core] dc4375: lib: Fixed max_buffer_size handling in istream-cha...

GitHub noreply at github.com
Wed Jun 1 11:00:14 UTC 2016


  Branch: refs/heads/master-2.2
  Home:   https://github.com/dovecot/core
  Commit: dc43757aefdcd4432eda4d75f6f37577e05d2a21
      https://github.com/dovecot/core/commit/dc43757aefdcd4432eda4d75f6f37577e05d2a21
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-06-01 (Wed, 01 Jun 2016)

  Changed paths:
    M src/lib/istream-chain.c

  Log Message:
  -----------
  lib: Fixed max_buffer_size handling in istream-chain

The default max_buffer_size=256 was wrong in all situations.

We're now assuming that the underlying istreams' max_buffer_size is always
correct. While gluing together two streams we're now allocating enough
memory to hold all of the wanted data (instead of assert-crashing as could
have happened earlier). This means that the max memory usage is actually
the two streams' max_buffer_size summed together. Ideally this would be
fixed to limit the max_buffer_size to maximum of the two, but that would
require further changes.


  Commit: 9e7b4d66018c276bfe4feed3dd81244f198f0d91
      https://github.com/dovecot/core/commit/9e7b4d66018c276bfe4feed3dd81244f198f0d91
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-06-01 (Wed, 01 Jun 2016)

  Changed paths:
    M src/lib-fs/fs-metawrap.c
    M src/lib-fs/istream-metawrap.c

  Log Message:
  -----------
  fs-metawrap: Fixed buffer size while reading metadata header.

It's not enough to have the buffer size set to "large enough" at the time of
the stream creation, because i_stream_set_max_buffer_size() could be called
afterwards.


  Commit: 3dafbab91728c044e58f18d529a8fa80546b2fb8
      https://github.com/dovecot/core/commit/3dafbab91728c044e58f18d529a8fa80546b2fb8
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-06-01 (Wed, 01 Jun 2016)

  Changed paths:
    M src/lib/istream-chain.c

  Log Message:
  -----------
  lib: Fix to previous istream-chain max_buffer_size handling

We were casting the wrong stream.


Compare: https://github.com/dovecot/core/compare/936f81cf71b8...3dafbab91728


More information about the dovecot-cvs mailing list