Skip to content
Snippets Groups Projects
Commit f69f9fe1 authored by Timo Sirainen's avatar Timo Sirainen
Browse files

plugins: imap-filter-sieve: SIEVE SCRIPT - Cleanup istream return value checking

The old code seems to have worked correctly already, but now it's a bit
clearer how it was intended to work.
parent 919704e7
No related branches found
No related tags found
No related merge requests found
...@@ -205,7 +205,12 @@ cmd_filter_sieve_script_read_stream(struct imap_filter_context *ctx) ...@@ -205,7 +205,12 @@ cmd_filter_sieve_script_read_stream(struct imap_filter_context *ctx)
while ((ret = i_stream_read_more(input, &data, &size)) > 0) while ((ret = i_stream_read_more(input, &data, &size)) > 0)
i_stream_skip(input, size); i_stream_skip(input, size);
if (input->v_offset == ctx->script_len) { if (ret < 0) {
if (input->v_offset != ctx->script_len) {
/* client disconnected */
i_assert(input->eof);
return -1;
}
/* finished reading the value */ /* finished reading the value */
i_stream_seek(input, 0); i_stream_seek(input, 0);
...@@ -218,10 +223,6 @@ cmd_filter_sieve_script_read_stream(struct imap_filter_context *ctx) ...@@ -218,10 +223,6 @@ cmd_filter_sieve_script_read_stream(struct imap_filter_context *ctx)
i_stream_unref(&ctx->script_input); i_stream_unref(&ctx->script_input);
return 1; return 1;
} }
if (input->eof) {
/* client disconnected */
return -1;
}
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.