]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
mbox: istream-tee wasn't being used as expected with the new changes, causing crashes...
authorTimo Sirainen <tss@iki.fi>
Thu, 19 Jun 2014 14:16:24 +0000 (17:16 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 19 Jun 2014 14:16:24 +0000 (17:16 +0300)
commit11f743d846c6b4fe9258e48b4d9c3dc2349c5890
tree25d95220b31f15696d14f154bd8c5ea9ae8e952c
parenta07bc6007e62a9cdf065aa0a8b74d532f0f9d10f
mbox: istream-tee wasn't being used as expected with the new changes, causing crashes/hangs.
After wondering about this for a while I decided this was the only fully
reliable way of doing this. Although it would have been possible to change
the istream-tee code to support this:

child1 and child2 are tee-istream children:
 - i_stream_read(child1)
 - i_stream_read(child2)
 - i_stream_get_data(child1)

Because reading from the parent istream-tee updates all of its childrens'
buffer, there's no big problem (other than access_counter currently messing
up). But if one of the children weren't a direct child of tee-istream, but
there was a wrapper istream, the wrapper's buffer wouldn't have been updated
by the istream-tee read. So rather than spending time figuring out to fix
the access_counter it's probably better to have it clearly fail as the use
case can't be fully safe anyway.
src/lib-storage/index/mbox/mbox-save.c