From 5665fd872d72a3871a1fd2bad52603a0d29f6f72 Mon Sep 17 00:00:00 2001 From: psychon Date: Tue, 6 May 2008 14:47:13 +0000 Subject: [PATCH] Update to latest Csocket This breaks (& fixes again, as far as ZNC itself is concerened) API! git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1040 726aef4b-f618-498e-8847-2d620e286838 --- Csocket.cpp | 5 +++-- Csocket.h | 11 ++++++++--- HTTPSock.cpp | 2 +- modules/shell.cpp | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Csocket.cpp b/Csocket.cpp index c7072105..dcc20d05 100644 --- a/Csocket.cpp +++ b/Csocket.cpp @@ -28,7 +28,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * -* $Revision: 1.79 $ +* $Revision: 1.80 $ */ #include "Csocket.h" @@ -1555,7 +1555,8 @@ void Csock::PushBuff( const char *data, int len, bool bStartAtZero ) } -CS_STRING & Csock::GetInternalBuffer() { return( m_sbuffer ); } +CS_STRING & Csock::GetInternalReadBuffer() { return( m_sbuffer ); } +CS_STRING & Csock::GetInternalWriteBuffer() { return( m_sSend ); } void Csock::SetMaxBufferThreshold( u_int iThreshold ) { m_iMaxStoredBufferLength = iThreshold; } u_int Csock::GetMaxBufferThreshold() { return( m_iMaxStoredBufferLength ); } int Csock::GetType() { return( m_iConnType ); } diff --git a/Csocket.h b/Csocket.h index 32bfb0a3..3ebfac5b 100644 --- a/Csocket.h +++ b/Csocket.h @@ -28,7 +28,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * -* $Revision: 1.190 $ +* $Revision: 1.191 $ */ // note to compile with win32 need to link to winsock2, using gcc its -lws2_32 @@ -625,10 +625,15 @@ public: */ virtual void PushBuff( const char *data, int len, bool bStartAtZero = false ); - //! This gives access to the internal buffer, if your + //! This gives access to the internal read buffer, if your //! not going to use ReadLine(), then you may want to clear this out //! (if its binary data and not many '\\n') - CS_STRING & GetInternalBuffer(); + CS_STRING & GetInternalReadBuffer(); + + //! This gives access to the internal write buffer. + //! If you want to check if the send queue fills up, check here. + CS_STRING & GetInternalWriteBuffer(); + //! sets the max buffered threshold when EnableReadLine() is enabled void SetMaxBufferThreshold( u_int iThreshold ); u_int GetMaxBufferThreshold(); diff --git a/HTTPSock.cpp b/HTTPSock.cpp index a66fc893..ccc372ad 100644 --- a/HTTPSock.cpp +++ b/HTTPSock.cpp @@ -84,7 +84,7 @@ void CHTTPSock::ReadLine(const CString& sData) { DisableReadLine(); if (m_bPost) { - m_sPostData = GetInternalBuffer(); + m_sPostData = GetInternalReadBuffer(); CheckPost(); } else { GetPage(); diff --git a/modules/shell.cpp b/modules/shell.cpp index cf8e7d67..a6178479 100644 --- a/modules/shell.cpp +++ b/modules/shell.cpp @@ -168,7 +168,7 @@ void CShellSock::ReadLine(const CString& sData) { void CShellSock::Disconnected() { // If there is some incomplete line in the buffer, read it // (e.g. echo echo -n "hi" triggered this) - CString &sBuffer = GetInternalBuffer(); + CString &sBuffer = GetInternalReadBuffer(); if (!sBuffer.empty()) ReadLine(sBuffer);