From 4f2599e7115d86be406e308dedb9f958944219d5 Mon Sep 17 00:00:00 2001 From: prozacx Date: Wed, 15 Mar 2006 18:23:43 +0000 Subject: [PATCH] Pulled in changes git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@684 726aef4b-f618-498e-8847-2d620e286838 --- Csocket.cpp | 7 ++++--- Csocket.h | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Csocket.cpp b/Csocket.cpp index 5db2b4df..1eafbc6f 100644 --- a/Csocket.cpp +++ b/Csocket.cpp @@ -1285,6 +1285,7 @@ void Csock::UnPauseRead() { m_bPauseRead = false; ResetTimer(); + PushBuff( "", 0, true ); } void Csock::SetTimeout( int iTimeout, u_int iTimeoutType ) @@ -1316,17 +1317,17 @@ bool Csock::CheckTimeout() return( false ); } -void Csock::PushBuff( const char *data, int len ) +void Csock::PushBuff( const char *data, int len, bool bStartAtZero ) { if ( !m_bEnableReadLine ) return; // If the ReadLine event is disabled, just ditch here - u_int iStartPos = ( m_sbuffer.empty() ? 0 : m_sbuffer.length() - 1 ); + u_int iStartPos = ( m_sbuffer.empty() || bStartAtZero ? 0 : m_sbuffer.length() - 1 ); if ( data ) m_sbuffer.append( data, len ); - while( true ) + while( !m_bPauseRead ) { CS_STRING::size_type iFind = m_sbuffer.find( "\n", iStartPos ); diff --git a/Csocket.h b/Csocket.h index fae20956..a6ea28e1 100644 --- a/Csocket.h +++ b/Csocket.h @@ -630,7 +630,7 @@ public: * pushes data up on the buffer, if a line is ready * it calls the ReadLine event */ - virtual void PushBuff( const char *data, int len ); + virtual void PushBuff( const char *data, int len, bool bStartAtZero = false ); //! This gives access to the internal buffer, if your //! not going to use GetLine(), then you may want to clear this out @@ -864,8 +864,9 @@ public: */ virtual void ReadPaused() {} - //! return the duration since last write - int GetLastWriteDuration() { return m_iTcount; } + + //! return how long it has been (in seconds) since the last write + int GetTimeSinceLastWrite() { return m_iTcount; } //! return the data imediatly ready for read virtual int GetPending();