Commit Graph

90 Commits

Author SHA1 Message Date
psychon
0f0463510c Some fixes to modperl, most notable no with time increasing memory usage
Because some ENTER/LEAVE pair was missing, the stack perl uses for passing
arguments grew and grew.
Besides adding those calls this also fixes some more of the callback calling
code to look a little closer to the examples from perldoc.
This also fixes some warnings perl threw at us when unloading by not
making ZNC::{CONTINUE,HALT{,MODS,CORE}} mortal.

Thanks to tomaw and AnMaster for reporting and helping me debug this mem issue.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1357 726aef4b-f618-498e-8847-2d620e286838
2009-01-29 19:11:53 +00:00
psychon
235b10c200 Use that new define everywhere
Now there are no uses of DEBUG_ONLY() left :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1349 726aef4b-f618-498e-8847-2d620e286838
2009-01-25 16:51:54 +00:00
psychon
6345ce12fa Make O_RDONLY the default mode when opening files through CFile
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1336 726aef4b-f618-498e-8847-2d620e286838
2009-01-19 15:55:41 +00:00
psychon
08ad0291ea Happy New Year 2009 everyone!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1317 726aef4b-f618-498e-8847-2d620e286838
2009-01-01 12:22:21 +00:00
silverleo
9952e8d2c5 Added OnTimerAutoJoin(). Patch from Freman. Thanks :)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1272 726aef4b-f618-498e-8847-2d620e286838
2008-11-25 10:53:40 +00:00
silverleo
c71565103c Added OnIRCRegistration(). Patch from Freman. Thanks :)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1271 726aef4b-f618-498e-8847-2d620e286838
2008-11-24 17:56:34 +00:00
psychon
db21f88584 Rename OnUserAttached and OnUserDetached and add OnClientConnect
OnUserAttached is renamed to OnClientLogin and
OnUserDetached to OnClientDisconnect.
This adds some new function with different arguments for the old names to cause
warnings from -Woverloaded-virtual while compiling.

This patch also adds OnClientConnect() which is called when the low-level
raw connection is established. (No SSL-handshake was done at this point yet!)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1266 726aef4b-f618-498e-8847-2d620e286838
2008-10-29 17:26:30 +00:00
silverleo
94f6e2cf79 Change OnStatusCommand to use non-const variable like most of the EModRet modulecalls
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1262 726aef4b-f618-498e-8847-2d620e286838
2008-10-26 19:47:17 +00:00
psychon
4aa01bcb71 Fix modperl to properly compile with perl 5.10.0
Thanks to bigpresh and kroimon for reporting this and testing the patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1239 726aef4b-f618-498e-8847-2d620e286838
2008-10-03 18:07:22 +00:00
psychon
497697dd3b Fix a crash bug when modperl was loaded on some arches
PERL_SYS_INIT3 was added to modperl in r1155-1158 to fix modperl on arches like
hppa. This added an invalid cast which caused a segfault.

If you have:
  const char *pArgv[];
Then pArgv will point to the same memory location as &pArgv. This pointer was
then casted to (char ***) which is one level of pointers too much for this
pointer.

Thanks to an anonymous reporter who pointed out the crash.
Thanks to pippijin for helping me understand the C++ magic.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1237 726aef4b-f618-498e-8847-2d620e286838
2008-10-02 16:26:09 +00:00
kroimon
5237a24747 Use CString::Equals() everywhere.
* (CString::CaseCmp() == 0) became CString::Equals()
* (CString::CaseCmp() != 0) became !CString::Equals()
* replaced some occurrences of strn?casecmp

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1234 726aef4b-f618-498e-8847-2d620e286838
2008-09-30 15:15:59 +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
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
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
c64d7bc108 Force a space between if, for, while and (
This was done via:
   sed -ir 's/if(/if (/g; s/for(/for (/g; s/while(/while (/g' \
        *.h *.cpp modules/*.cpp



git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1030 726aef4b-f618-498e-8847-2d620e286838
2008-04-20 13:08:44 +00:00
psychon
b0a1714b86 Remove useless spaces inside of braces "( stuff )"
This was generated via the following command:

  cat <file> | \
  tr "\n" "€"| \
  sed -r 's/€[\t ]*\{€/ {€/g; s/\( */(/g; s/ *\)/)/g' | \
  tr "€" "\n"

Thanks to SilverLeo for producing this mess :P


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1029 726aef4b-f618-498e-8847-2d620e286838
2008-04-20 13:00:19 +00:00
imaginos
2578384277 documented how to debug with valgrind
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@988 726aef4b-f618-498e-8847-2d620e286838
2008-03-18 03:00:03 +00:00
imaginos
20a970ae3d make sure these scalars are declared as mortals as to avoid a memleak
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@987 726aef4b-f618-498e-8847-2d620e286838
2008-03-18 02:30:42 +00:00
imaginos
ed15b68684 possible memleak during onload bu pZNCSpace not being mortal
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@986 726aef4b-f618-498e-8847-2d620e286838
2008-03-17 19:51:58 +00:00
imaginos
8873fbefa1 dont require .pm being in the mod name
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@982 726aef4b-f618-498e-8847-2d620e286838
2008-03-17 14:59:06 +00:00
imaginos
a0b2a8fc2b changed (un|re)?loadmod to (un|re)?loadperlmodule
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@981 726aef4b-f618-498e-8847-2d620e286838
2008-03-17 04:22:49 +00:00
psychon
f74ab87e19 And fix a shitload of trailing whitespaces and space / tab mixups in ZNC
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@959 726aef4b-f618-498e-8847-2d620e286838
2008-02-16 12:52:11 +00:00
psychon
e72c445694 Clean up includes
All the headers are now self-contained (g++ Header.h -o /dev/null).

Some system headers where moved to the .cpp they are actually needed in,
some of our own headers are includes less. (Especially MD5.h)

Headers are sorted alphabetically while in e.g. FileUtils.cpp FileUtils.h
is the first file included.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@915 726aef4b-f618-498e-8847-2d620e286838
2008-01-07 21:31:16 +00:00
psychon
eeec633e30 Update copyright header for 2008
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@910 726aef4b-f618-498e-8847-2d620e286838
2008-01-07 21:13:07 +00:00
psychon
1360effd31 This covers the code changes for the datadir move (which is now finished)
Based on darix' patch I wrote this. Modperl's changes were not tested since I
didn't find someone who could test it. Well...

Ah and btw it regenerates configure


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@902 726aef4b-f618-498e-8847-2d620e286838
2007-12-12 21:15:44 +00:00
psychon
ee350ab744 Change second argument to module in OnLoad() from sErrorMsg to sMessage.
This message is always displayed when the module returns (well, screw webadmin)
and this way a module can notify the user if it loaded but something unexpected
happened.

As you might guess, no one uses this ATM :)

Proposal comes from prozac


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@855 726aef4b-f618-498e-8847-2d620e286838
2007-10-28 17:57:07 +00:00
psychon
a09a7e79f6 Switch to the copyright headers the GPLv2 wants us to have
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@843 726aef4b-f618-498e-8847-2d620e286838
2007-09-21 18:55:33 +00:00
psychon
ac805c59a9 Fix warnings from -Woverloaded-virtual.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@816 726aef4b-f618-498e-8847-2d620e286838
2007-07-19 22:28:54 +00:00
psychon
a3b405bd07 sync from my branch rev 983 and 993:
- module api change, if module fails to load it can give back an useful error message
- give a message when client doesnt supply a password when connecting
- some minor cleanup


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@803 726aef4b-f618-498e-8847-2d620e286838
2007-05-16 22:42:00 +00:00
imaginos
4338d9dda7 changed from char * to const char * argument per perlguts
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@739 726aef4b-f618-498e-8847-2d620e286838
2006-07-09 19:11:28 +00:00
prozacx
810369db4b Fixed small issue with newest gcc
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@700 726aef4b-f618-498e-8847-2d620e286838
2006-03-17 20:54:16 +00:00
prozacx
a9e60b43c5 Migrated away from CString::ToString() in favor of explicit constructors
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@669 726aef4b-f618-498e-8847-2d620e286838
2006-02-25 09:43:35 +00:00
imaginos
c67c67abe7 missed a spot
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@654 726aef4b-f618-498e-8847-2d620e286838
2006-02-13 06:07:05 +00:00
imaginos
380023e853 use u_short
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@653 726aef4b-f618-498e-8847-2d620e286838
2006-02-13 06:01:57 +00:00
prozacx
0eaf9bdc1e Wrapped TSocketManager into CSockManager
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@650 726aef4b-f618-498e-8847-2d620e286838
2006-02-12 21:00:59 +00:00
prozacx
3ef968b17e Changed DataPath to SavePath
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@587 726aef4b-f618-498e-8847-2d620e286838
2005-12-27 18:37:48 +00:00
prozacx
6d27d1c021 Removed const from args in a bunch of hooks
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@538 726aef4b-f618-498e-8847-2d620e286838
2005-09-26 23:09:05 +00:00
prozacx
49d71a9b55 Removed const from CNick in priv/chan hooks
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@537 726aef4b-f618-498e-8847-2d620e286838
2005-09-26 08:23:30 +00:00
prozacx
b9b7844a82 Changed from CUser::GetPemLocation() to CZNC::GetPemLocation()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@517 726aef4b-f618-498e-8847-2d620e286838
2005-09-20 04:31:19 +00:00
prozacx
89e5079ce9 Upgrading to CZNC::Get()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@508 726aef4b-f618-498e-8847-2d620e286838
2005-09-19 04:09:37 +00:00
prozacx
fb221fb906 wrapped two cerr calls in DEBUG_ONLY()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@489 726aef4b-f618-498e-8847-2d620e286838
2005-09-13 06:44:21 +00:00
prozacx
602bd53d3e Got rid of some warnings that were given on a redhat opteron in 64bit
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@471 726aef4b-f618-498e-8847-2d620e286838
2005-09-07 06:56:54 +00:00
imaginos
dbfaa3850a only if ssl is enabled
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@393 726aef4b-f618-498e-8847-2d620e286838
2005-06-28 07:11:55 +00:00
prozacx
296b535d5f Commented GetDataPath() as it has been replaced
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@385 726aef4b-f618-498e-8847-2d620e286838
2005-06-12 09:07:43 +00:00
prozacx
c52542e469 Moved GetDescription() into second argument of MODULEDEFS()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@366 726aef4b-f618-498e-8847-2d620e286838
2005-05-26 20:42:13 +00:00
imaginos
4146d36088 moved modperl back to original convention
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@362 726aef4b-f618-498e-8847-2d620e286838
2005-05-26 16:30:22 +00:00
imaginos
467f1b8f7a made modperl global
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@351 726aef4b-f618-498e-8847-2d620e286838
2005-05-22 19:41:12 +00:00