/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream.h"
#include "message-parser.h"
#include "message-size.h"
bool *has_nuls_r)
{
const unsigned char *msg;
int ret;
*has_nuls_r = FALSE;
missing_cr_count = 0; startpos = 0;
if (msg[i] != '\n') {
if (msg[i] == '\0')
*has_nuls_r = TRUE;
continue;
}
/* missing CR */
}
/* no headers at all */
break;
}
/* \n\n or \n\r\n - end of headers */
break;
}
}
if (i < size) {
/* end of header */
startpos = i+1;
break;
}
/* leave the last two characters, they may be \r\n */
}
return ret;
}
bool *has_nuls_r)
{
const unsigned char *msg;
int ret;
*has_nuls_r = FALSE;
missing_cr_count = 0;
}
if (msg[0] == '\n')
do {
for (i = 1; i < size; i++) {
if (msg[i] > '\n')
continue;
if (msg[i] == '\n') {
/* missing CR */
}
/* increase after making sure we didn't break
at virtual \r */
} else if (msg[i] == '\0') {
*has_nuls_r = TRUE;
}
}
/* leave the last character, it may be \r */
body->physical_size++;
return ret;
}
const struct message_size *src)
{
}
bool *last_cr_r)
{
const unsigned char *msg;
int ret;
if (virtual_skip == 0)
return 0;
for (i = 0; i < size && virtual_skip > 0; i++) {
virtual_skip--;
if (msg[i] == '\r') {
/* CR */
if (virtual_skip == 0)
} else if (msg[i] == '\n') {
/* LF */
if ((i == 0 && !cr_skipped) ||
if (virtual_skip == 0) {
break;
}
virtual_skip--;
}
}
}
i_stream_skip(input, i);
if (i < size)
return 0;
i_assert(i > 0);
}
}