From: Gunnar Beutner Date: Tue, 6 Mar 2018 07:54:47 +0000 (+0100) Subject: Fix incorrect argument type for JsonRpc::SendMessage X-Git-Tag: v2.9.0~133^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F6147%2Fhead;p=icinga2 Fix incorrect argument type for JsonRpc::SendMessage --- diff --git a/lib/base/win32.hpp b/lib/base/win32.hpp index 3a07a048d..be840ff9d 100644 --- a/lib/base/win32.hpp +++ b/lib/base/win32.hpp @@ -40,6 +40,7 @@ #endif /* __MINGW32__ */ typedef int socklen_t; +typedef SSIZE_T ssize_t; #define MAXPATHLEN MAX_PATH diff --git a/lib/remote/jsonrpc.cpp b/lib/remote/jsonrpc.cpp index 3dbd13aa3..fa6c3df00 100644 --- a/lib/remote/jsonrpc.cpp +++ b/lib/remote/jsonrpc.cpp @@ -72,7 +72,7 @@ size_t JsonRpc::SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& me return NetString::WriteStringToStream(stream, json); } -StreamReadStatus JsonRpc::ReadMessage(const Stream::Ptr& stream, String *message, StreamReadContext& src, bool may_wait, size_t maxMessageLength) +StreamReadStatus JsonRpc::ReadMessage(const Stream::Ptr& stream, String *message, StreamReadContext& src, bool may_wait, ssize_t maxMessageLength) { String jsonString; StreamReadStatus srs = NetString::ReadStringFromStream(stream, &jsonString, src, may_wait, maxMessageLength); diff --git a/lib/remote/jsonrpc.hpp b/lib/remote/jsonrpc.hpp index 3b0eaabf8..e7d2a05ea 100644 --- a/lib/remote/jsonrpc.hpp +++ b/lib/remote/jsonrpc.hpp @@ -36,7 +36,7 @@ class JsonRpc { public: static size_t SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& message); - static StreamReadStatus ReadMessage(const Stream::Ptr& stream, String *message, StreamReadContext& src, bool may_wait = false, size_t maxMessageLength = -1); + static StreamReadStatus ReadMessage(const Stream::Ptr& stream, String *message, StreamReadContext& src, bool may_wait = false, ssize_t maxMessageLength = -1); static Dictionary::Ptr DecodeMessage(const String& message); private: