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:
mscott%netscape.com 1999-05-18 21:25:55 +00:00
parent 624620ef89
commit 7417bf0a72

View File

@ -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);