Since the user can't read detached channels, there is no point in clearing their
buffer. Let's leave them alone instead.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2151 726aef4b-f618-498e-8847-2d620e286838
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
Adding new hooks to modules is the following procedure:
1. Add it to modperl/module.h
2. Add it to modperl/startup.pl
3. Add it to modperl/functions.in
4. Run ./codegen.pl
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2140 726aef4b-f618-498e-8847-2d620e286838
that each next REQ is sent only after receiving ACK/NAK
of previous REQ. Also now you can call CIRCSock::PauseCap()
and CIRCSock::ResumeCap() if you need to pause CAP negotiation
and process of logging in for a while.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2137 726aef4b-f618-498e-8847-2d620e286838
This should make DoS attacks that try to make znc eat lots of memory a lot
harder to do (= Don't bother trying).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2124 726aef4b-f618-498e-8847-2d620e286838
Old modperl had several flaws and was very outdated.
New modperl makes the whole ZNC API accessible from inside perl.
Modperl API was changed, so old perl modules are not supported,
but they weren't used much anyway.
Modperl needs --enable-perl option to ./configure.
This introduces new dependence on SWIG, which is needed only while
compiling ZNC. So to use modperl, you need to install SWIG or
to download several files and use --disable-swig option of configure.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2120 726aef4b-f618-498e-8847-2d620e286838
We introduced a bug where sending "USER foo\r\nNICK foo\r\n" to znc would cause
an "invalid password" message even though no password was sent yet. This was
caused by a missing check.
This is easily fixed by checking whether we already received a password before
checking if the password is valid.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2117 726aef4b-f618-498e-8847-2d620e286838
"virtual host" seems to be confusing to users since they wonder why
i.am.superman doesn't work. Let's rename this to "bindhost" and perhaps it
becomes clearer what this setting does.
Thanks to SilverLeo!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2113 726aef4b-f618-498e-8847-2d620e286838
No idea what this function actually does, but it's only used internally in
CString. This also removes a bogus "inline".
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2110 726aef4b-f618-498e-8847-2d620e286838
If you have 10 servers in your server list and you want to directly jump to e.g.
irc.foo.bar, you can now do "/znc jump irc.foo.bar".
Thanks to PsWii60 for constantly bugging me for this.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2109 726aef4b-f618-498e-8847-2d620e286838
CChan::OnOp() and CChan::OnVoice() were both undefinied.
These two prototypes confused the compiler when calling CSocket::Listen(1234)
since they both matched:
CSocket::Listen(unsigned short, bool=false, unsigned int=0);
Csock::Listen(unsigned short, int=SOMAXCONN, const CString&="", u_int=0);
Thanks to DarthGandalf for noticing these.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2108 726aef4b-f618-498e-8847-2d620e286838
This module clears all channel buffers whenever the user does something. This
means that channel buffers will only be cleared after we are 100% sure they were
read. Yay for no longer losing buffer playback when the client breaks.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2107 726aef4b-f618-498e-8847-2d620e286838
When there was only one client with a pending request and that client
disconnected from ZNC, we didn't destroy the timeout. This means that the
associated timer eventually fired and then tried to display which request caused
the timeout. But since we already cleaned up the rest, this resulted in a NULL
pointer dereference.
This commit fixes also another bug: If two different clients got pending
requests and the client whose request was currently handled disconnected, we
didn't send the other client's request to the IRCd.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2102 726aef4b-f618-498e-8847-2d620e286838