Commit Graph

1175 Commits

Author SHA1 Message Date
kroimon 41fce82fc8 Added myself ;)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1184 726aef4b-f618-498e-8847-2d620e286838
2008-08-31 18:01:44 +00:00
psychon 00fcf767a7 Keep the traffic stats more up-to-date (/msg *status traffic)
This now also adds the traffic caused by webadmin, schat and dcc bouncing
to the stats.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1183 726aef4b-f618-498e-8847-2d620e286838
2008-08-31 07:21:21 +00:00
psychon 5fa8d03d2b Handle clients in CModules the same way users are
This should remove some additional complexity, but I doubt one can
benchmark these savings...

BTW: Here is what I found out on how this works:
The user module manager (CModules) always has m_pUser set to NULL which means
that it never touches its module's user pointer. That way, the modules
always have the correct pointer.

For global modules, m_pUser is set on some calls. This pointer is then
passed on to the modules and reset afterwards.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1182 726aef4b-f618-498e-8847-2d620e286838
2008-08-30 19:46:28 +00:00
psychon 02beef2e07 Use znc.in instead of znc.com
No cookie for that domain catcher at znc.com!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1181 726aef4b-f618-498e-8847-2d620e286838
2008-08-30 09:00:21 +00:00
psychon 687d7ae894 Close listening ports if we have too many open fds
The alternative to this is a busy loop which is a Bad Idea (tm).
Next rehash will reopen the port anyway, so meh, this is the best we can do.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1180 726aef4b-f618-498e-8847-2d620e286838
2008-08-30 08:35:11 +00:00
psychon 69f44c35a0 Update to latest Csocket
SockError() is now called with the correct errno if accept() fails.
This is some preparation for a later patch which will handle EMFILE.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1179 726aef4b-f618-498e-8847-2d620e286838
2008-08-29 18:59:05 +00:00
psychon d4cd78a43b Instead of (ab)using a CClient for listening, use an own class this job
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1178 726aef4b-f618-498e-8847-2d620e286838
2008-08-29 18:51:08 +00:00
psychon da8c892d4f Add a config option 'MaxJoins' to limit the number of joins ZNC does at once
This should hopefully fix a couple of 'Excess flood' problems we were having.

Thanks to SilverLeo for finally writing this :P


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1177 726aef4b-f618-498e-8847-2d620e286838
2008-08-29 15:06:08 +00:00
psychon 5c588352d9 WriteToDisk() didn't make sure the file was empty when its map was empty
This bug was introduced by SilverLeo who also found and fixed it. :P


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1176 726aef4b-f618-498e-8847-2d620e286838
2008-08-28 18:50:42 +00:00
psychon 55c1232e5e Add a 'ShowMOTD' command to *status and reorder 'HELP' output
ShowMOTD is now close to the other MOTD commands which only admins can access.
The old 'MOTD' is still available, but the help doesn't mention it anymore in
favor of 'MOTD'.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1175 726aef4b-f618-498e-8847-2d620e286838
2008-08-28 10:47:01 +00:00
psychon 3325f450c7 Add '/msg *status restart'
Thanks to kroimon for the patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1174 726aef4b-f618-498e-8847-2d620e286838
2008-08-27 14:44:04 +00:00
psychon cc5c771699 Some changes to CZNC::WriteNewConfig (znc --makeconf)
I think this is intended to make this more user-friendly. If it is not, well
I think this patch does exactly this, so what?

Thanks to kroimon for the patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1173 726aef4b-f618-498e-8847-2d620e286838
2008-08-26 13:54:17 +00:00
psychon 7c45658993 Add some proper cleanup to some places in main()
This adds a bunch of 'delete pZNC', turns some exit()s into returns
and does some whitespace fun.

kroimon (partly) gets the kudos for this, too.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1172 726aef4b-f618-498e-8847-2d620e286838
2008-08-25 14:46:22 +00:00
psychon 971aa39e10 Don't start a new process for starting znc after --makeconf
The code now just falls through to the normal bootup code.

Thanks to kroimon for this idea and also for writing this patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1171 726aef4b-f618-498e-8847-2d620e286838
2008-08-25 14:42:11 +00:00
psychon 840d1ba15a Move some code around
No actual changes in here, just some preparation.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1170 726aef4b-f618-498e-8847-2d620e286838
2008-08-25 14:39:06 +00:00
psychon adcca250e1 Use the new CModule::PutModule(const CTable&) in various modules
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1169 726aef4b-f618-498e-8847-2d620e286838
2008-08-24 12:51:04 +00:00
psychon b70a115a28 Add a new function CModule::PutModule(const CTable&)
This function displays a CTable via PutModule(), something that is often
needed. The function returns the number of lines displayed.

The idea for this function is from the user-contributed admin module
by Sebastian Ramacher. Thanks.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1168 726aef4b-f618-498e-8847-2d620e286838
2008-08-24 12:49:40 +00:00
psychon 09a122ef92 Move some common code in main() in front of all those if()s
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1167 726aef4b-f618-498e-8847-2d620e286838
2008-08-24 10:41:01 +00:00
psychon 87d062a5c5 Unify some of the preprocessor macros in Modules.cpp
The only difference between MODUNLOADCHK and GLOBALMODCALL and between
MODHALTCHK and GLOBALMODHALTCHK was that the one used CModule while the other
one used CGlobalModule.

Create two new macros that expects the class name as an extra parameter and
make all those other macros just call these two.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1166 726aef4b-f618-498e-8847-2d620e286838
2008-08-24 06:25:11 +00:00
psychon 074adc94c1 Don't check if perl is enabled in modperl
The Makefile only compiles this module if it is enabled.
I think it's better to error out if for some reason this doesn't work instead
of silently producing an empty modperl.so.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1165 726aef4b-f618-498e-8847-2d620e286838
2008-08-24 06:19:14 +00:00
psychon b0903c0208 Handle a theoretically possible 'throw UNLOAD' in CModule::OnLoad()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1164 726aef4b-f618-498e-8847-2d620e286838
2008-08-23 20:20:36 +00:00
psychon c0c563de55 Fix FTBFS with CTable on g++ 3
g++ 3 doesnt like map<>.at().

This changes how CTable stores its data internally.
This *might* be faster than the older system.

Thanks to kroimon for finding this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1163 726aef4b-f618-498e-8847-2d620e286838
2008-08-23 13:24:28 +00:00
psychon ecabbd2bcd Fix some of the direct module calls in Client.cpp
OnModCTCP(), OnModCommand() and OnModNotice() are now called through a
preprocessor macro that does all the magic. This fixes a couple of bugs:
- the m_pUser member of global modules for OnModNotice() was wrong
- OnModCTCP() wasn't called for global modules
- Finally handle 'throw UNLOAD' for all of this three module calls


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1162 726aef4b-f618-498e-8847-2d620e286838
2008-08-22 12:48:56 +00:00
psychon ef31d6e239 Connect and reconnect faster to IRC
The first reconnect now happens when the timer is created which is
possibly thanks to latest Csocket.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1161 726aef4b-f618-498e-8847-2d620e286838
2008-08-21 10:47:09 +00:00
psychon ec58e6f183 Some cleanup and optimizations to CTable
CTable now caches the width of each column instead of recalculating it
each time it is needed. The code for this was there before, but it was not
used. Now the widths are calculated when the table is filled, not when the
width is needed the first time.

This caching leads to a huge speedup (3-4 times faster) if there are many rows
in the table.

This also cleans up the interface by making it possible to mark
GetColumnWidth and GetLine as const.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1160 726aef4b-f618-498e-8847-2d620e286838
2008-08-20 08:13:23 +00:00
psychon c3b6a4b29a Update to latest Csocket
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1159 726aef4b-f618-498e-8847-2d620e286838
2008-08-18 11:10:27 +00:00
imaginos 5f0846fc9a changing data types back to proper notation, and down cast the array passed in
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1158 726aef4b-f618-498e-8847-2d620e286838
2008-08-17 18:46:43 +00:00
imaginos 5fbc0aa538 remove const keywords for perl's sake
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1157 726aef4b-f618-498e-8847-2d620e286838
2008-08-17 18:02:09 +00:00
imaginos 03213ae279 fix arg to PERL_SYS_INIT3
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1156 726aef4b-f618-498e-8847-2d620e286838
2008-08-17 17:48:18 +00:00
imaginos b3bfb1b9ba bug fix as reported by http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495076, still needs to be tested
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1155 726aef4b-f618-498e-8847-2d620e286838
2008-08-17 14:53:18 +00:00
psychon 2f74755d7a Fix a bug where ZNC always thought all channels where empty
Due to the recent change that ZNC calls SetIsOn(true) when we receive the JOIN,
not the 'end of names' reply, the nick list of a channel was always ignored.
This fixes this bug.

Thanks to cnu for using a svn version and reporting this bug. :)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1154 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 18:49:52 +00:00
psychon 8fa9122cdb Fix the keepnick module
- Properly initialize that pointer-beast.
- Actually compile.

Yeah, I know, I fail...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1153 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 11:54:26 +00:00
psychon 5d58910d24 Add a new module that implements KeepNick
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1152 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 11:36:30 +00:00
psychon 03e34ac6e6 Remove KeepNick
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1151 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 11:34:11 +00:00
psychon 3ec3f07523 Move CClient's UserCommand() and HelpUser() into a new file ClientCommand.cpp
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1150 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 10:38:24 +00:00
psychon 30404699e3 Handle the on-connect 433 in an own function
When our primary nick is already taken, we try a couple of different nicks in
order to be able to connect to the IRC server. This code is now in an
own function.

BTW: CIRCSock::Readline() is still waaay too long.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1149 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 10:34:15 +00:00
psychon cd2fb1b1b5 Move the forwarding of raw 353 into an own function
This also contains some minor changes to the code. One of those is that we now
also handle namesx and uhnames for channels we don't know.
BTW: CIRCSock::ReadLine() is waaay too long.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1148 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 10:22:17 +00:00
psychon 3106f3b90e modperl: Fail if modperl.pm can not be loaded
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1147 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 10:16:52 +00:00
psychon 13dd3996d5 Remove some unused arguments and unimplemented functions
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1146 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 10:14:41 +00:00
psychon 48d53876d6 Even more weird and broken clients sending even more and broken stuff
PART :#channel... Why do IRCds even parse this correctly? :(
Oh and yeah, it's eggdrop.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1145 726aef4b-f618-498e-8847-2d620e286838
2008-07-23 15:05:35 +00:00
psychon cd8318370a Some weird clients might send a nickmask prefix, handle this correctly
*cough* eggdrop is evil *cough*

Thanks to dare for debugging this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1144 726aef4b-f618-498e-8847-2d620e286838
2008-07-23 13:36:04 +00:00
psychon abeba8aea7 Simplify the connect user code a little
The old code used a timer. That timer needed to be restarted if the user list
was changed (adding / removing of users), because it saved an iterator into
that map between runs, which would become invalid.

The new code in CConnectUserTimer::RunJob() is actually more complicated now,
but the iterator is gone. This also means no need to restart that timer
more or less always. ;) (This also means one theoretical source of bugs less)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1143 726aef4b-f618-498e-8847-2d620e286838
2008-07-22 11:34:38 +00:00
psychon cc3d99515d awaynick: Disable KeepNick on load instead of failing to load
This should make someone in #znc really happy. :P
This is based on a patch from SilverLeo.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1142 726aef4b-f618-498e-8847-2d620e286838
2008-07-22 08:39:18 +00:00
psychon 1f6abb6468 partyline: Some fixes for users who are not connected to IRC
This was found via default channels (LoadModule = partyline ~#chan).

- Always use a valid (=non-empty) server name
- If a user is not connected to IRC, all clients might have a different idea of
  the current nick. Handle this for SendNickList() via a new function
  PutUserIRCNick() that uses the irc nick if we are connected to IRC and else
  correctly uses the nick that clients thinks it curretnly has.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1141 726aef4b-f618-498e-8847-2d620e286838
2008-07-21 13:58:24 +00:00
psychon 1a1cc4c756 We are in a channel when we received the JOIN for it, not it's "end of /names"
This moves some calls from the raw 366 handler to the JOIN handler and it might
even fix a bug (well, which no one would ever have triggered).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1140 726aef4b-f618-498e-8847-2d620e286838
2008-07-21 10:15:16 +00:00
psychon 1c2c52651a Make webadmin generate salted passwords, too
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1139 726aef4b-f618-498e-8847-2d620e286838
2008-07-20 15:06:33 +00:00
psychon c07347b9a0 Enable some more debug flags with --enable-debug
See these links for info on these defines:
 http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch29.html
 http://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode.html


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1138 726aef4b-f618-498e-8847-2d620e286838
2008-07-18 09:37:11 +00:00
psychon 10210e4619 Don't throw any exceptions in CModules::LoadModule() on version mismatch
This also removes all the code catching those exceptions. There was nothing
which justified these exceptions and removing them doesn't hurt.

ByeBye CException::EX_BadModVersion


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1137 726aef4b-f618-498e-8847-2d620e286838
2008-07-17 12:01:44 +00:00
psychon 27c1a76cf8 Shell module: Don't give any stdin to executed apps
We now close the write end of the pipe that serves as stdin for the apps
we run. This means that any read attempts will return EOD (read() returns 0)
which should hopefully tell our apps that we don't have stdin for them.
Sadly vim doesn't care... (Only thing I tested that still broke)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1136 726aef4b-f618-498e-8847-2d620e286838
2008-07-17 10:30:32 +00:00
psychon 0003c28f7b Shell module: Small cleanup
We already have a special function for stripping of special chars, so
why does the shell module still do it 'by hand'?


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1135 726aef4b-f618-498e-8847-2d620e286838
2008-07-17 10:16:40 +00:00