From b172a67867d183ae29ee8a7fe0bffe5547cf6c65 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 6 Mar 2018 08:54:47 +0100 Subject: [PATCH] Fix incorrect argument type for JsonRpc::SendMessage --- lib/base/win32.hpp | 1 + lib/remote/jsonrpc.cpp | 2 +- lib/remote/jsonrpc.hpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) 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: -- 2.40.0