stream: remove ReadLine maxLength

it doesn't do what its name suggests.

refs #4370
This commit is contained in:
Michael Friedrich 2013-07-04 09:41:51 +02:00
parent 80c91aa91e
commit 8c3663ab0e
2 changed files with 4 additions and 4 deletions

View File

@ -24,19 +24,19 @@
using namespace icinga;
bool Stream::ReadLine(String *line, ReadLineContext& context, size_t maxLength)
bool Stream::ReadLine(String *line, ReadLineContext& context)
{
if (context.Eof)
return false;
for (;;) {
if (context.MustRead) {
context.Buffer = (char *)realloc(context.Buffer, context.Size + maxLength);
context.Buffer = (char *)realloc(context.Buffer, context.Size + 4096);
if (!context.Buffer)
throw std::bad_alloc();
size_t rc = Read(context.Buffer + context.Size, maxLength);
size_t rc = Read(context.Buffer + context.Size, 4096);
if (rc == 0) {
*line = String(context.Buffer, &(context.Buffer[context.Size]));

View File

@ -75,7 +75,7 @@ public:
*/
virtual void Close(void) = 0;
bool ReadLine(String *line, ReadLineContext& context, size_t maxLength = 4096);
bool ReadLine(String *line, ReadLineContext& context);
};
}