mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 16:46:26 +00:00
fix for bug #6219 -- send data every 2K so we don't fill up our internal buffer when sending a message.
This commit is contained in:
parent
624620ef89
commit
7417bf0a72
@ -1110,7 +1110,7 @@ PRInt32 nsSmtpProtocol::SendMessageInFile()
|
|||||||
line = nsnull;
|
line = nsnull;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!fileStream->readline(b, bsize-5)) // if the readline returns false, jump out...
|
if (!fileStream->readline(b, bsize-5)) // if the readline returns false, jump out. we've reached the end of the file
|
||||||
{
|
{
|
||||||
line = nsnull;
|
line = nsnull;
|
||||||
break;
|
break;
|
||||||
@ -1168,7 +1168,17 @@ PRInt32 nsSmtpProtocol::SendMessageInFile()
|
|||||||
bsize -= L;
|
bsize -= L;
|
||||||
b += L;
|
b += L;
|
||||||
amtInBuffer += L;
|
amtInBuffer += L;
|
||||||
} while (line && bsize > 100);
|
// test hack by mscott. If our buffer is almost full, then send it off & reset ourselves
|
||||||
|
// to make more room.
|
||||||
|
if (bsize < 100) // i chose 100 arbitrarily.
|
||||||
|
{
|
||||||
|
SendData(buffer);
|
||||||
|
buffer[0] = '\0';
|
||||||
|
b = buffer; // reset buffer
|
||||||
|
bsize = POST_DATA_BUFFER_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
} while (line /* && bsize > 100 */);
|
||||||
}
|
}
|
||||||
|
|
||||||
SendData(buffer);
|
SendData(buffer);
|
||||||
|
Loading…
Reference in New Issue
Block a user