Skip to content

Commit

Permalink
lib: istream-multiplex - Return error if the last packet wasn't fully…
Browse files Browse the repository at this point in the history
… read
  • Loading branch information
sirainen committed Dec 22, 2017
1 parent 1082d0b commit 4fcc784
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/lib/istream-multiplex.c
Expand Up @@ -56,8 +56,15 @@ static void propagate_eof(struct multiplex_istream *mstream)
{
struct multiplex_ichannel **channelp;
array_foreach_modifiable(&mstream->channels, channelp) {
if (*channelp != NULL) {
(*channelp)->istream.istream.eof = TRUE;
if (*channelp == NULL)
continue;

(*channelp)->istream.istream.eof = TRUE;
if (mstream->remain > 0) {
(*channelp)->istream.istream.stream_errno = EPIPE;
io_stream_set_error(&(*channelp)->istream.iostream,
"Unexpected EOF - %u bytes remaining in packet",
mstream->remain);
}
}
}
Expand Down

0 comments on commit 4fcc784

Please sign in to comment.