summaryrefslogtreecommitdiff
path: root/modules/extra
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-11-25 16:14:17 +0000
committerSadie Powell <sadie@witchery.services>2024-11-25 16:14:17 +0000
commit3cbac4bcea7401b081f0e3e2d2d6dc94fe50ef15 (patch)
tree132b58ae4a42d11d636de659eb4d73dfb6672edc /modules/extra
parente42b4c21b7a317170cd1d2b41b2f6a1a837de041 (diff)
Update Send and Recv to use ssize_t instead of int.
Diffstat (limited to 'modules/extra')
-rw-r--r--modules/extra/ssl_gnutls.cpp12
-rw-r--r--modules/extra/ssl_openssl.cpp8
2 files changed, 10 insertions, 10 deletions
diff --git a/modules/extra/ssl_gnutls.cpp b/modules/extra/ssl_gnutls.cpp
index e2c9aa23c..78a70f091 100644
--- a/modules/extra/ssl_gnutls.cpp
+++ b/modules/extra/ssl_gnutls.cpp
@@ -51,14 +51,14 @@ public:
* @param sz How much to read
* @return Number of bytes received
*/
- int Recv(Socket *s, char *buf, size_t sz) override;
+ ssize_t Recv(Socket *s, char *buf, size_t sz) override;
/** Write something to the socket
* @param s The socket
* @param buf The data to write
* @param size The length of the data
*/
- int Send(Socket *s, const char *buf, size_t sz) override;
+ ssize_t Send(Socket *s, const char *buf, size_t sz) override;
/** Accept a connection from a socket
* @param s The socket
@@ -384,9 +384,9 @@ void MySSLService::Init(Socket *s)
s->io = new SSLSocketIO();
}
-int SSLSocketIO::Recv(Socket *s, char *buf, size_t sz)
+ssize_t SSLSocketIO::Recv(Socket *s, char *buf, size_t sz)
{
- int ret = gnutls_record_recv(this->sess, buf, sz);
+ ssize_t ret = gnutls_record_recv(this->sess, buf, sz);
if (ret > 0)
TotalRead += ret;
@@ -411,9 +411,9 @@ int SSLSocketIO::Recv(Socket *s, char *buf, size_t sz)
return ret;
}
-int SSLSocketIO::Send(Socket *s, const char *buf, size_t sz)
+ssize_t SSLSocketIO::Send(Socket *s, const char *buf, size_t sz)
{
- int ret = gnutls_record_send(this->sess, buf, sz);
+ ssize_t ret = gnutls_record_send(this->sess, buf, sz);
if (ret > 0)
TotalWritten += ret;
diff --git a/modules/extra/ssl_openssl.cpp b/modules/extra/ssl_openssl.cpp
index 0e6ad2abc..ce2222fa4 100644
--- a/modules/extra/ssl_openssl.cpp
+++ b/modules/extra/ssl_openssl.cpp
@@ -52,14 +52,14 @@ public:
* @param sz How much to read
* @return Number of bytes received
*/
- int Recv(Socket *s, char *buf, size_t sz) override;
+ ssize_t Recv(Socket *s, char *buf, size_t sz) override;
/** Write something to the socket
* @param s The socket
* @param buf The data to write
* @param size The length of the data
*/
- int Send(Socket *s, const char *buf, size_t sz) override;
+ ssize_t Send(Socket *s, const char *buf, size_t sz) override;
/** Accept a connection from a socket
* @param s The socket
@@ -237,7 +237,7 @@ SSLSocketIO::SSLSocketIO()
this->sslsock = NULL;
}
-int SSLSocketIO::Recv(Socket *s, char *buf, size_t sz)
+ssize_t SSLSocketIO::Recv(Socket *s, char *buf, size_t sz)
{
int i = SSL_read(this->sslsock, buf, sz);
if (i > 0)
@@ -256,7 +256,7 @@ int SSLSocketIO::Recv(Socket *s, char *buf, size_t sz)
return i;
}
-int SSLSocketIO::Send(Socket *s, const char *buf, size_t sz)
+ssize_t SSLSocketIO::Send(Socket *s, const char *buf, size_t sz)
{
int i = SSL_write(this->sslsock, buf, sz);
if (i > 0)