Reversed the matched-parameter handling for hdr->eoh, so it's consistent
with non-eoh headers.
mstream->cur_line++;
if (hdr->eoh) {
mstream->seen_eoh = TRUE;
- matched = TRUE;
+ matched = FALSE;
if (mstream->header_parsed && !mstream->headers_edited) {
if (mstream->eoh_not_matched)
matched = !matched;
mstream->context);
}
- if (!matched) {
+ if (matched) {
mstream->seen_eoh = FALSE;
mstream->eoh_not_matched = TRUE;
continue;
/* add a new header */
const char *new_hdr = "Added: header\n\n";
i_stream_header_filter_add(input, new_hdr, strlen(new_hdr));
- *matched = FALSE;
+ *matched = TRUE;
} else if (strcasecmp(hdr->name, "To") == 0) {
/* modify To header */
const char *new_to = "To: 123\n";
bool *matched, void *context ATTR_UNUSED)
{
if (hdr != NULL && hdr->eoh)
- *matched = FALSE;
+ *matched = TRUE;
}
static void test_istream_strip_eoh(void)
return;
if (hdr->eoh) {
ctx->have_eoh = TRUE;
- if (ctx->stop) {
- /* matched is handled differently for eoh by
- istream-header-filter. a design bug I guess.. */
- *matched = FALSE;
- }
+ if (ctx->stop)
+ *matched = TRUE;
} else {
if (strspn(hdr->name, "\r") == hdr->name_len) {
/* CR+CR+LF - some servers stop the header processing