Skip to content

Commit

Permalink
lib-mail: istream-attachment-extractor - remove unnecessary code
Browse files Browse the repository at this point in the history
It's enough to set the stream_errno.
  • Loading branch information
sirainen committed Feb 23, 2017
1 parent f981b71 commit 7e6a434
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/lib-mail/istream-attachment-extractor.c
Expand Up @@ -59,7 +59,6 @@ struct attachment_istream {
struct attachment_istream_part part;

bool retry_read;
bool failed;
};

static void stream_add_data(struct attachment_istream *astream,
Expand Down Expand Up @@ -599,11 +598,6 @@ static int astream_read_next(struct attachment_istream *astream, bool *retry_r)
if (stream->pos - stream->skip >= i_stream_get_max_buffer_size(&stream->istream))
return -2;

if (astream->failed) {
stream->istream.stream_errno = EINVAL;
return -1;
}

old_size = stream->pos - stream->skip;
switch (message_parser_parse_next_block(astream->parser, &block)) {
case -1:
Expand All @@ -620,7 +614,6 @@ static int astream_read_next(struct attachment_istream *astream, bool *retry_r)
if (ret < 0) {
io_stream_set_error(&stream->iostream, "%s", error);
stream->istream.stream_errno = EINVAL;
astream->failed = TRUE;
}
astream->cur_part = NULL;
return -1;
Expand All @@ -636,7 +629,6 @@ static int astream_read_next(struct attachment_istream *astream, bool *retry_r)
if (astream_end_of_part(astream, &error) < 0) {
io_stream_set_error(&stream->iostream, "%s", error);
stream->istream.stream_errno = EINVAL;
astream->failed = TRUE;
return -1;
}
}
Expand Down

0 comments on commit 7e6a434

Please sign in to comment.