message-send.c revision 76b43e4417bab52e913da39b5f5bc2a130d3f149
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream.h"
#include "ostream.h"
#include "message-parser.h"
#include "message-send.h"
#include "message-size.h"
struct message_size *msg_size,
bool cr_skipped, bool *last_cr)
{
const unsigned char *msg;
if (virtual_skip == 0) {
*last_cr = cr_skipped;
return;
}
startpos = 0;
virtual_skip--;
if (msg[i] == '\r') {
/* CR */
if (virtual_skip == 0)
} else if (msg[i] == '\n') {
/* LF */
if ((i == 0 && !cr_skipped) ||
/* missing CR */
msg_size->virtual_size++;
if (virtual_skip == 0) {
break;
}
virtual_skip--;
}
/* increase after making sure we didn't break
at virtual \r */
}
}
i_stream_skip(input, i);
msg_size->physical_size += i;
msg_size->virtual_size += i;
}
if (i < size)
break;
}
}