From 2809dd1108af8bb298618b32efc1039114847128 Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 27 Sep 2010 18:51:55 +0000 Subject: [PATCH] Csocket: Clear the buffer in DisableReadLine() This clears the internal read buffer in DisableReadLine(). This fixes "accidental bugs" where CHTTPSock does DisableReadLine() and then reads the post data via ReadData(). The problem is when we do DisableReadLine() in ReadLine() and then return from it. All the stuff is still in the read buffer which triggers a MaxBufferReached() call which causes us to drop the connection. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2148 726aef4b-f618-498e-8847-2d620e286838 --- Csocket.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Csocket.cpp b/Csocket.cpp index a0ec6eac..371a8d75 100644 --- a/Csocket.cpp +++ b/Csocket.cpp @@ -2147,7 +2147,10 @@ void Csock::DelCronByAddr( CCron *pcCron ) } void Csock::EnableReadLine() { m_bEnableReadLine = true; } -void Csock::DisableReadLine() { m_bEnableReadLine = false; } +void Csock::DisableReadLine() { + m_bEnableReadLine = false; + m_sbuffer.clear(); +} void Csock::ReachedMaxBuffer() {