From 7417bf0a724cb61163640e7d02b58149e5d7eddf Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Tue, 18 May 1999 21:25:55 +0000 Subject: [PATCH] fix for bug #6219 -- send data every 2K so we don't fill up our internal buffer when sending a message. --- mailnews/compose/src/nsSmtpProtocol.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mailnews/compose/src/nsSmtpProtocol.cpp b/mailnews/compose/src/nsSmtpProtocol.cpp index b670ba6f47b4..5ef189807443 100644 --- a/mailnews/compose/src/nsSmtpProtocol.cpp +++ b/mailnews/compose/src/nsSmtpProtocol.cpp @@ -1110,7 +1110,7 @@ PRInt32 nsSmtpProtocol::SendMessageInFile() line = nsnull; 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; break; @@ -1168,7 +1168,17 @@ PRInt32 nsSmtpProtocol::SendMessageInFile() bsize -= L; b += 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);