Skip to content

Commit

Permalink
lib-mail: ostream-dot - Set o_stream_set_finish_also_parent(FALSE) by…
Browse files Browse the repository at this point in the history
… default

ostream-dot is always used inside another ostream to implement some kind of
data escaping. The ostream-dot always has to be finished to write the "."
line, but the caller never wants it to finish the parent stream.
  • Loading branch information
sirainen authored and Timo Sirainen committed Nov 1, 2017
1 parent 03e102d commit 6519bf9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib-mail/ostream-dot.c
Expand Up @@ -222,5 +222,10 @@ o_stream_create_dot(struct ostream *output, bool force_extra_crlf)
dstream->ostream.flush = o_stream_dot_flush;
dstream->ostream.max_buffer_size = output->real_stream->max_buffer_size;
dstream->force_extra_crlf = force_extra_crlf;
return o_stream_create(&dstream->ostream, output, o_stream_get_fd(output));
(void)o_stream_create(&dstream->ostream, output, o_stream_get_fd(output));
/* ostream-dot is always used inside another ostream that shouldn't
get finished when the "." line is written. Disable it here so all
of the callers don't have to set this. */
o_stream_set_finish_also_parent(&dstream->ostream.ostream, FALSE);
return &dstream->ostream.ostream;
}

0 comments on commit 6519bf9

Please sign in to comment.