From babc733d2d51b77bf201a9147503b096a829b02f Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 24 Jan 2023 23:02:35 +0000 Subject: Fix using (unsigned) long instead of (s)size_t. --- src/inspsocket.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/inspsocket.cpp') diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index ac1cf4ae7..dbb4a790b 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -137,7 +137,7 @@ Cullable::Result StreamSocket::Cull() return EventHandler::Cull(); } -long StreamSocket::HookChainRead(IOHook* hook, std::string& rq) +ssize_t StreamSocket::HookChainRead(IOHook* hook, std::string& rq) { if (!hook) return ReadToRecvQ(rq); @@ -146,7 +146,7 @@ long StreamSocket::HookChainRead(IOHook* hook, std::string& rq) if (iohm) { // Call the next hook to put data into the recvq of the current hook - const long ret = HookChainRead(iohm->GetNextHook(), iohm->GetRecvQ()); + const ssize_t ret = HookChainRead(iohm->GetNextHook(), iohm->GetRecvQ()); if (ret <= 0) return ret; } @@ -157,7 +157,7 @@ void StreamSocket::DoRead() { const std::string::size_type prevrecvqsize = recvq.size(); - const long result = HookChainRead(GetIOHook(), recvq); + const ssize_t result = HookChainRead(GetIOHook(), recvq); if (result < 0) { SetError("Read Error"); // will not overwrite a better error message @@ -168,13 +168,13 @@ void StreamSocket::DoRead() OnDataReady(); } -long StreamSocket::ReadToRecvQ(std::string& rq) +ssize_t StreamSocket::ReadToRecvQ(std::string& rq) { char* ReadBuffer = ServerInstance->GetReadBuffer(); ssize_t n = SocketEngine::Recv(this, ReadBuffer, ServerInstance->Config->NetBufferSize, 0); if (n >= 0) { - unsigned long nrecv = static_cast(n); + size_t nrecv = static_cast(n); if (nrecv == ServerInstance->Config->NetBufferSize) { SocketEngine::ChangeEventMask(this, FD_WANT_FAST_READ | FD_ADD_TRIAL_READ); -- cgit v1.3.1-10-gc9f91