changed method: void PostMultiParser::ReadContentToFileLoop()
previous version was not clean git-svn-id: svn://ttmath.org/publicrep/winix/trunk@634 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
c7f6d2727c
commit
c3fac2e83f
|
@ -265,16 +265,22 @@ void PostMultiParser::ReadContentToFileLoop()
|
||||||
bool has_boundary = false;
|
bool has_boundary = false;
|
||||||
|
|
||||||
|
|
||||||
while( last!=-1 && !(has_boundary=HasBoundary()) )
|
while( last!=-1 )
|
||||||
{
|
{
|
||||||
content += last;
|
content += last;
|
||||||
content_len += 1;
|
content_len += 1;
|
||||||
ReadChar();
|
ReadChar();
|
||||||
|
|
||||||
if( content.size() > WINIX_POSTMULTI_OUTPUT_BUFFER + boundary.size() + 2 ) // +2 for the new line character
|
if( HasBoundary() )
|
||||||
{
|
{
|
||||||
tmp_file.write(content.c_str(), WINIX_POSTMULTI_OUTPUT_BUFFER);
|
has_boundary = true;
|
||||||
content.erase(0, WINIX_POSTMULTI_OUTPUT_BUFFER);
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( content.size() >= WINIX_POSTMULTI_OUTPUT_BUFFER )
|
||||||
|
{
|
||||||
|
tmp_file.write(content.c_str(), content.size());
|
||||||
|
content.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( config->post_file_max != 0 && content_len > (size_t)config->post_file_max )
|
if( config->post_file_max != 0 && content_len > (size_t)config->post_file_max )
|
||||||
|
@ -303,7 +309,7 @@ void PostMultiParser::ReadContentToFile()
|
||||||
time_t t1, t2;
|
time_t t1, t2;
|
||||||
|
|
||||||
content.clear();
|
content.clear();
|
||||||
content.reserve(WINIX_POSTMULTI_OUTPUT_BUFFER + boundary.size());
|
content.reserve(WINIX_POSTMULTI_OUTPUT_BUFFER);
|
||||||
content_len = 0;
|
content_len = 0;
|
||||||
t1 = time(0);
|
t1 = time(0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue