These happen only if the attachment writing failed for some reason.
The input stream itself can't have any errors, so EINVAL isn't proper.
if (ret < 0) {
io_stream_set_error(&stream->iostream, "%s", error);
- stream->istream.stream_errno = EINVAL;
+ stream->istream.stream_errno = EIO;
}
astream->cur_part = NULL;
return -1;
/* end of a MIME part */
if (astream_end_of_part(astream, &error) < 0) {
io_stream_set_error(&stream->iostream, "%s", error);
- stream->istream.stream_errno = EINVAL;
+ stream->istream.stream_errno = EIO;
return -1;
}
}