1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 14:16:39 +02:00

Update Send and Recv to use ssize_t instead of int.

This commit is contained in:
Sadie Powell
2024-11-25 16:14:17 +00:00
parent e42b4c21b7
commit 3cbac4bcea
6 changed files with 21 additions and 21 deletions
+5 -5
View File
@@ -426,23 +426,23 @@ size_t cidr::hash::operator()(const cidr &s) const
}
}
int SocketIO::Recv(Socket *s, char *buf, size_t sz)
ssize_t SocketIO::Recv(Socket *s, char *buf, size_t sz)
{
int i = recv(s->GetFD(), buf, sz, 0);
ssize_t i = recv(s->GetFD(), buf, sz, 0);
if (i > 0)
TotalRead += i;
return i;
}
int SocketIO::Send(Socket *s, const char *buf, size_t sz)
ssize_t SocketIO::Send(Socket *s, const char *buf, size_t sz)
{
int i = send(s->GetFD(), buf, sz, 0);
ssize_t i = send(s->GetFD(), buf, sz, 0);
if (i > 0)
TotalWritten += i;
return i;
}
int SocketIO::Send(Socket *s, const Anope::string &buf)
ssize_t SocketIO::Send(Socket *s, const Anope::string &buf)
{
return this->Send(s, buf.c_str(), buf.length());
}