mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
Limit the maximal read buffer space that is used for every socket
CSocket caches the data read from a socket and then looks for lines in there. If there is no line end, this buffer can grow quite large. This patch now closes sockets if they get a huge read buffer. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1233 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -75,6 +75,9 @@ public:
|
||||
m_bNamesx = false;
|
||||
m_bUHNames = false;
|
||||
EnableReadLine();
|
||||
// RFC says a line can have 512 chars max, but we are
|
||||
// a little more gentle ;)
|
||||
SetMaxBufferThreshold(1024);
|
||||
|
||||
StartLoginTimeout();
|
||||
}
|
||||
@@ -113,6 +116,7 @@ public:
|
||||
virtual void Connected();
|
||||
virtual void Disconnected();
|
||||
virtual void ConnectionRefused();
|
||||
virtual void ReachedMaxBuffer();
|
||||
|
||||
void SetNick(const CString& s);
|
||||
CUser* GetUser() const { return m_pUser; }
|
||||
|
||||
Reference in New Issue
Block a user