diff --git a/src/jsonrpccpp/common/streamreader.cpp b/src/jsonrpccpp/common/streamreader.cpp index a608858b..2de90261 100644 --- a/src/jsonrpccpp/common/streamreader.cpp +++ b/src/jsonrpccpp/common/streamreader.cpp @@ -1,5 +1,6 @@ #include "streamreader.h" #include +#include #include using namespace jsonrpc; @@ -19,7 +20,7 @@ bool StreamReader::Read(std::string &target, int fd, char delimiter) { } else { target.append(buffer, static_cast(bytesRead)); } - } while (target.find(delimiter) == string::npos && bytesRead > 0); + } while (memchr(buffer, delimiter, bytesRead) == NULL);//(target.find(delimiter) == string::npos && bytesRead > 0); target.pop_back(); return true;