Fix reading long lines in multiple bunches. Thanks pulkomandy for testing.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41651 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2011-05-22 08:49:31 +00:00
parent 94427d9b8b
commit 45f20f8f91
2 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ ConnectionReader::ConnectionReader(ServerConnection* connection)
status_t
ConnectionReader::GetNextLine(BString& line, bigtime_t timeout,
uint32 minUnfinishedLine)
int32 maxUnfinishedLine)
{
line.SetTo((const char*)NULL, 0);
@ -33,7 +33,7 @@ ConnectionReader::GetNextLine(BString& line, bigtime_t timeout,
if (status == B_OK)
return status;
if (status == B_NAME_NOT_FOUND) {
if (line.Length() < (int32)minUnfinishedLine)
if (maxUnfinishedLine < 0 || line.Length() < maxUnfinishedLine)
continue;
else
return status;

View File

@ -32,7 +32,7 @@ public:
minUnfinishedLine characters are returned. */
status_t GetNextLine(BString& line,
bigtime_t timeout = kIMAP4ClientTimeout,
uint32 minUnfinishedLine = 128);
int32 maxUnfinishedLine = -1);
/*! Read data and append it to line till the end of file is
reached. */
status_t FinishLine(BString& line);