psychon [Thu, 21 Oct 2010 17:27:19 +0000 (17:27 +0000)]
partyline: Only inject prefixes if we know the prefixes
There are apparently "IRC" daemons (which don't deserve that name) that don't
send any 005. Yes, I'm looking at you, chat.wikileaks.org. For these servers we
shouldn't inject partyline's channel prefix because that makes us send out a
"CHANTYPES=~" line which severely confuses clients. XChat then turns everything
into a query!
darthgandalf [Sun, 17 Oct 2010 09:27:15 +0000 (09:27 +0000)]
Fix modperl timers API.
It was pretty difficult to pass arbitrary argument. Needed to generate
new sub each time etc.
Now CreateTimer gets new named parameter: context. Its value will be
passed to given sub as named parameter context.
Also as it was hard to use variant of CreateTimer without named params
(there's no parameter 'context' there), that variant is gone.
psychon [Sun, 17 Oct 2010 08:42:07 +0000 (08:42 +0000)]
Add a warning if IPV6_V6ONLY is not defined
Each time we hit a "Listener" config option and the current system doesn't have
IPV6_V6ONLY, we print a warning that "Listener4" and "Listener6" should be used
instead. The current "Listener" will then be interpreted as an IPV4 port.
--makeconf is changed so that it doesn't write out "Listener" lines when
IPV6_V6ONLY is not defined so that we don't trigger the warning like this.
The only "real OS" (windows doesn't count here) that is known to not have
IPV6_V6ONLY is OpenBSD.
darthgandalf [Sun, 10 Oct 2010 09:59:15 +0000 (09:59 +0000)]
Remove sockets and timers from perl modules in their destructors.
This should decrease memory usage a bit, and decrease chance of crashing znc from bad perl module a bit.
psychon [Sat, 2 Oct 2010 12:39:20 +0000 (12:39 +0000)]
chansaver: Ignore channel key "*"
There are some nets out there which display the current channel key as "*" if
you are already in the channel. This means ZNC would remember the channel key as
"*" and thus be unable to rejoin the channel. Bad.
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.
Fix bug introduced in r2133: modperl made znc crash when using web.
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
Rearrange CAP requests between ZNC and server in a way
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.
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.
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.
psychon [Mon, 30 Aug 2010 08:58:29 +0000 (08:58 +0000)]
Rename "vhost" to "bindhost"
"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.
psychon [Fri, 20 Aug 2010 15:02:36 +0000 (15:02 +0000)]
Add clearbufferonmsg module
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.
psychon [Wed, 18 Aug 2010 07:57:23 +0000 (07:57 +0000)]
Fix a NULL pointer dereference in route_replies
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.
psychon [Mon, 9 Aug 2010 13:17:08 +0000 (13:17 +0000)]
Fix make output
The output must not use $< since for out-of-tree builds this contains the
relative paths to the file in question. Since $@ will always be in the current
directory, we should use that one instead.
psychon [Thu, 5 Aug 2010 12:13:44 +0000 (12:13 +0000)]
Reduce number of module hooks
The new hooks OnServerCapAccepted() and OnServerCapRejected() are replaced by
OnServerCapResult(). This should force people who want to use this to handle
possible failures in requesting the capability.
psychon [Tue, 3 Aug 2010 10:01:36 +0000 (10:01 +0000)]
Make make's output more readable
The real command line is now hidden and instead a short message which explains
what is done is displayed. To get back the old behavior, use "make VERBOSE=1".
Here's the scenario:
- Client joins #chan, then detaches from #chan (/detach #chan).
- $EVIL_OP kicks us from #chan. Since it's detached, this is not forwarded.
- Client reattaches to #chan (sends us a join for #chan).
What happens is that the client does *not* receive a successful JOIN for the
channel, but TOPIC, MODE and the NAMES reply is forwarded. On proper clients
this would result in weird traffic shown in the server window. On broken clients
like irssi which don't wait for the JOIN reply from the server, this meant that
it looked like a successful JOIN to the client while ZNC still thought the
channel was detached.
This is fixed by automatically attaching to the channel when we join it due to a
client. This means that the channel will always be attached after a JOIN.
Thanks to tomaw for finding this and making me actually understand that this is
a bug in ZNC, not irssi.
This is *NOT* backward compatible with the old name for that config option. If
you updated to the latest nightly in the last two days, well, you'll have to
fix your config by hand. Sorry.
If the CHANTYPES token was the last one in a 005 numeric, partyline would call
std::insert() with CString::npos for the position to insert at. This throws a
std::out_of_range error. Fix this by using CString::append() in this case.
Thanks to Superfly_ for the bug report and helping me reproduce this.
If we were in an user section when we reached the end of the config file, that
user was previously discarded. This makes reading the config file instead.
OnUnknownUserRaw() and OnClientCapRequest() were both getting a CClient* as
their first argument, but the proper way to pass a CClient* argument to a module
is via GetClient(). Since recently, all the places where this module hooks are
called do this properly, so we can remove this bogus argument.
No module that is part of znc is affected by this change.
Let's see how many external ones break. ;)
This commit should make sure that all module calls are done through either
MODULECALL, GLOBALMODULECALL or ALLMODULECALL. Also, in the process some module
calls where ("accidentally" ;) ) fixed to set correct values for a global
module's m_pUser during a module call.
MODULECALL() calls global and user modules, GLOBALMODULECALL() only calls global
modules. The macro arguments are the same, but GLOBALMODULECALL() can live with
a user being NULL while MODULECALL() detests being called like that.