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:
@@ -24,7 +24,7 @@ ConnectionReader::ConnectionReader(ServerConnection* connection)
|
|||||||
|
|
||||||
status_t
|
status_t
|
||||||
ConnectionReader::GetNextLine(BString& line, bigtime_t timeout,
|
ConnectionReader::GetNextLine(BString& line, bigtime_t timeout,
|
||||||
uint32 minUnfinishedLine)
|
int32 maxUnfinishedLine)
|
||||||
{
|
{
|
||||||
line.SetTo((const char*)NULL, 0);
|
line.SetTo((const char*)NULL, 0);
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ ConnectionReader::GetNextLine(BString& line, bigtime_t timeout,
|
|||||||
if (status == B_OK)
|
if (status == B_OK)
|
||||||
return status;
|
return status;
|
||||||
if (status == B_NAME_NOT_FOUND) {
|
if (status == B_NAME_NOT_FOUND) {
|
||||||
if (line.Length() < (int32)minUnfinishedLine)
|
if (maxUnfinishedLine < 0 || line.Length() < maxUnfinishedLine)
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public:
|
|||||||
minUnfinishedLine characters are returned. */
|
minUnfinishedLine characters are returned. */
|
||||||
status_t GetNextLine(BString& line,
|
status_t GetNextLine(BString& line,
|
||||||
bigtime_t timeout = kIMAP4ClientTimeout,
|
bigtime_t timeout = kIMAP4ClientTimeout,
|
||||||
uint32 minUnfinishedLine = 128);
|
int32 maxUnfinishedLine = -1);
|
||||||
/*! Read data and append it to line till the end of file is
|
/*! Read data and append it to line till the end of file is
|
||||||
reached. */
|
reached. */
|
||||||
status_t FinishLine(BString& line);
|
status_t FinishLine(BString& line);
|
||||||
|
|||||||
Reference in New Issue
Block a user