message-size.c revision 1c64ce475b982a84d55ce3028721e4a123b05ef2
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "iobuffer.h"
#include "message-parser.h"
#include "message-size.h"
{
unsigned char *msg;
missing_cr_count = 0; startpos = 0;
if (msg[i] != '\n')
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 */
}
}
{
unsigned char *msg;
missing_cr_count = 0; startpos = 0;
while (max_virtual_size != 0 &&
if (max_virtual_size > 0)
if (msg[i] != '\n')
continue;
/* missing CR */
if (max_virtual_size > 0) {
if (max_virtual_size == 0)
break;
}
}
/* increase after making sure we didn't break
at virtual \r */
}
/* leave the last character, it may be \r */
startpos = 1;
}
}
{
unsigned char *msg;
*cr_skipped = FALSE;
if (virtual_skip == 0)
return;
startpos = 0;
virtual_skip--;
if (msg[i] == '\r') {
/* CR */
if (virtual_skip == 0)
*cr_skipped = TRUE;
} else if (msg[i] == '\n') {
/* LF */
/* missing CR */
msg_size->virtual_size++;
if (virtual_skip == 0) {
*cr_skipped = TRUE;
break;
}
virtual_skip--;
}
/* increase after making sure we didn't break
at virtual \r */
}
}
msg_size->physical_size += i;
msg_size->virtual_size += i;
}
if (i < size) {
io_buffer_skip(inbuf, i);
break;
}
/* leave the last character, it may be \r */
startpos = 1;
}
}
{
}