summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/iohook.h3
-rw-r--r--src/inspsocket.cpp2
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp3
-rw-r--r--src/modules/extra/m_ssl_mbedtls.cpp3
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp3
5 files changed, 6 insertions, 8 deletions
diff --git a/include/iohook.h b/include/iohook.h
index cf27fcb0c..576307963 100644
--- a/include/iohook.h
+++ b/include/iohook.h
@@ -66,10 +66,11 @@ class IOHook : public classbase
* Called when a hooked stream has data to write, or when the socket
* engine returns it as writable
* @param sock The socket in question
+ * @param sendq Send queue to send data from
* @return 1 if the sendq has been completely emptied, 0 if there is
* still data to send, and -1 if there was an error
*/
- virtual int OnStreamSocketWrite(StreamSocket* sock) = 0;
+ virtual int OnStreamSocketWrite(StreamSocket* sock, StreamSocket::SendQueue& sendq) = 0;
/** Called immediately before any socket is closed. When this event is called, shutdown()
* has not yet been called on the socket.
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp
index 89c3a71a9..dcc455482 100644
--- a/src/inspsocket.cpp
+++ b/src/inspsocket.cpp
@@ -201,7 +201,7 @@ void StreamSocket::DoWrite()
if (GetIOHook())
{
- int rv = GetIOHook()->OnStreamSocketWrite(this);
+ int rv = GetIOHook()->OnStreamSocketWrite(this, sendq);
if (rv < 0)
SetError("Write Error"); // will not overwrite a better error message
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index a1c989163..44a49d895 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -1086,7 +1086,7 @@ info_done_dealloc:
}
}
- int OnStreamSocketWrite(StreamSocket* user) CXX11_OVERRIDE
+ int OnStreamSocketWrite(StreamSocket* user, StreamSocket::SendQueue& sendq) CXX11_OVERRIDE
{
// Finish handshake if needed
int prepret = PrepareIO(user);
@@ -1094,7 +1094,6 @@ info_done_dealloc:
return prepret;
// Session is ready for transferring application data
- StreamSocket::SendQueue& sendq = user->GetSendQ();
#ifdef INSPIRCD_GNUTLS_HAS_CORK
while (true)
diff --git a/src/modules/extra/m_ssl_mbedtls.cpp b/src/modules/extra/m_ssl_mbedtls.cpp
index 8578b8196..7efcce72d 100644
--- a/src/modules/extra/m_ssl_mbedtls.cpp
+++ b/src/modules/extra/m_ssl_mbedtls.cpp
@@ -698,7 +698,7 @@ class mbedTLSIOHook : public SSLIOHook
}
}
- int OnStreamSocketWrite(StreamSocket* sock) CXX11_OVERRIDE
+ int OnStreamSocketWrite(StreamSocket* sock, StreamSocket::SendQueue& sendq) CXX11_OVERRIDE
{
// Finish handshake if needed
int prepret = PrepareIO(sock);
@@ -706,7 +706,6 @@ class mbedTLSIOHook : public SSLIOHook
return prepret;
// Session is ready for transferring application data
- StreamSocket::SendQueue& sendq = sock->GetSendQ();
while (!sendq.empty())
{
FlattenSendQueue(sendq, profile->GetOutgoingRecordSize());
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 80c9d9395..5587f323a 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -656,7 +656,7 @@ class OpenSSLIOHook : public SSLIOHook
}
}
- int OnStreamSocketWrite(StreamSocket* user) CXX11_OVERRIDE
+ int OnStreamSocketWrite(StreamSocket* user, StreamSocket::SendQueue& sendq) CXX11_OVERRIDE
{
// Finish handshake if needed
int prepret = PrepareIO(user);
@@ -666,7 +666,6 @@ class OpenSSLIOHook : public SSLIOHook
data_to_write = true;
// Session is ready for transferring application data
- StreamSocket::SendQueue& sendq = user->GetSendQ();
while (!sendq.empty())
{
ERR_clear_error();