From: Michael Friedrich Date: Thu, 4 Jul 2013 07:41:51 +0000 (+0200) Subject: stream: remove ReadLine maxLength X-Git-Tag: v0.0.3~891 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c3663ab0e535cfa044ad6503a3e37254041a382;p=icinga2 stream: remove ReadLine maxLength it doesn't do what its name suggests. refs #4370 --- diff --git a/lib/base/stream.cpp b/lib/base/stream.cpp index 0ef95715c..7914b0dec 100644 --- a/lib/base/stream.cpp +++ b/lib/base/stream.cpp @@ -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])); diff --git a/lib/base/stream.h b/lib/base/stream.h index b51eb59ad..ce47d6ea1 100644 --- a/lib/base/stream.h +++ b/lib/base/stream.h @@ -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); }; }