Commit Graph

160 Commits

Author SHA1 Message Date
psychon
edb56b1660 Make it possible to add extra strings to the version number
This will be used for the nightly tarballs (perhabs).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1062 726aef4b-f618-498e-8847-2d620e286838
2008-05-24 15:29:52 +00:00
psychon
a77de4ea65 CUser: Save CIRCSock* instead of looking it up every time
Via profiling ZNC it was found that much CPU time was spent inside FindSockByName()
which in turn was called by CUser::GetIRCSock():

w00t volunteered to write a patch to save that pointer inside CUser and
here is the result. Thanks.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1053 726aef4b-f618-498e-8847-2d620e286838
2008-05-13 18:18:51 +00:00
psychon
ff7a6c231a Remove some unneedef #ifdef's
MODULECALL doesn't need to be wrapped in #ifdef _MODULES, since main.h
already does this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1049 726aef4b-f618-498e-8847-2d620e286838
2008-05-10 15:09:46 +00:00
psychon
dde7921e6c Remove OnRehashDone and add OnPre/PostRehash
This patch is from SilverLeo.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1046 726aef4b-f618-498e-8847-2d620e286838
2008-05-09 14:48:06 +00:00
psychon
01bc68b1cb Move ChangeDir() and MakeDir() from CUtils to CDir
Those function were not modified. Only change is the name.

Those *Dir() functions really made no sense in CUtils when there is FileUtils
stuff. They really fit much better into here. I'll bet they'll make new friends
fast. I mean, why shouldn't they?
Uhm... sorry ;)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1044 726aef4b-f618-498e-8847-2d620e286838
2008-05-08 16:58:32 +00:00
psychon
fe361f7a18 Display a better error message if znc.conf cannot be opened
If znc.conf was a regular file which we just couldn't open (chmod 0), ZNC
reported that it was already running on this config.
This patch fixes this message.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1033 726aef4b-f618-498e-8847-2d620e286838
2008-04-29 12:15:48 +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
psychon
51dd3e2b32 Use unix EOLs (\n) instead of DOS ones (\r\n) for writing znc.conf
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1022 726aef4b-f618-498e-8847-2d620e286838
2008-04-15 14:33:37 +00:00
psychon
52f755f0fd Reuse the FD for locking the config for reading it
This saves us one whole open() :P
Honestly, this fixes some (stupid) locking problems with cygwin and shouldn't
hurt much otherwise (And no, cygwin still isn't supported yet).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1020 726aef4b-f618-498e-8847-2d620e286838
2008-04-08 18:53:05 +00:00
psychon
246e71fe45 Fix a memory leak in rehashing
The fake user rehashing uses was leaked completly (BAD)

Thanks to SilverLeo for reporting and x-x for making me track this one down :P


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@992 726aef4b-f618-498e-8847-2d620e286838
2008-03-24 22:22:41 +00:00
imaginos
322483ab8e decided to restore the config checking during rehash to original state. I came to what i figure is a good compromise which is to allow global modules to have config lines that are prefixed with 'GM:', thus allowing core config checking and allowing global modules to do their own config checking
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@985 726aef4b-f618-498e-8847-2d620e286838
2008-03-17 18:26:06 +00:00
imaginos
6f80fdd02f could be a global config line
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@984 726aef4b-f618-498e-8847-2d620e286838
2008-03-17 15:30:28 +00:00
imaginos
fd614b5555 inverted condition, woops
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@983 726aef4b-f618-498e-8847-2d620e286838
2008-03-17 15:13:02 +00:00
imaginos
df1c36ca08 added back the ability for global modules to handle unhandled config lines
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@980 726aef4b-f618-498e-8847-2d620e286838
2008-03-17 04:21:53 +00:00
psychon
f6d86fac43 Only save a single backup of the znc config file
The ~/.znc/configs/backups/ directory quickly got quite big, so we don't do
that but instead only save on backup as ~/.znc/configs/znc.conf-backup


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@975 726aef4b-f618-498e-8847-2d620e286838
2008-03-01 16:30:08 +00:00
psychon
cb066e2425 Add OnRehashDone() module call
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@969 726aef4b-f618-498e-8847-2d620e286838
2008-02-29 16:47:34 +00:00
psychon
46f6651ba1 Try to get the user's home (~) from the env ($HOME) by default
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@966 726aef4b-f618-498e-8847-2d620e286838
2008-02-21 16:40:14 +00:00
psychon
8f22dcc60d Fix all those warnings from -Wshadow
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@964 726aef4b-f618-498e-8847-2d620e286838
2008-02-19 20:25:21 +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
cbb0fcf881 Only read from stdin if stdin is a TTY
This fixes an endless loop on rehash.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@952 726aef4b-f618-498e-8847-2d620e286838
2008-02-10 16:46:28 +00:00
psychon
e326f6eb35 Rehash on SIGHUP
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@951 726aef4b-f618-498e-8847-2d620e286838
2008-02-10 16:45:18 +00:00
psychon
8e33a7370f Add rehashing
This is only stuff for core which users can't use yet!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@950 726aef4b-f618-498e-8847-2d620e286838
2008-02-10 16:38:57 +00:00
psychon
9a1c3874bc Remove the pid file when ZNC exits
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@948 726aef4b-f618-498e-8847-2d620e286838
2008-02-08 20:52:20 +00:00
psychon
0adf4e5af3 Remove OnConfigLine() module call
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@945 726aef4b-f618-498e-8847-2d620e286838
2008-02-07 22:25:58 +00:00
psychon
64d6d0d5af Error if a channel is defined more than once
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@944 726aef4b-f618-498e-8847-2d620e286838
2008-02-07 22:23:51 +00:00
psychon
c20f8427bb Start the connect user time in ParseConfig()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@943 726aef4b-f618-498e-8847-2d620e286838
2008-02-07 22:23:14 +00:00
psychon
077b25e77d Move the check for listeners from main() to CZNC::ParseConfig()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@942 726aef4b-f618-498e-8847-2d620e286838
2008-02-07 22:22:03 +00:00
psychon
05df4919f6 Increase the connect timeout to 2 mins
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@936 726aef4b-f618-498e-8847-2d620e286838
2008-01-20 16:55:17 +00:00
psychon
45dae8a109 Move user deletion to CUser::HandleUserDeletion()
This does not include any behaviour change.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@934 726aef4b-f618-498e-8847-2d620e286838
2008-01-20 16:24:20 +00:00
psychon
5370a54012 Add DenySetVHost patch from Veit Wahlich aka cru
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@925 726aef4b-f618-498e-8847-2d620e286838
2008-01-18 22:18:36 +00:00
psychon
47c0cb9b82 Some code clean up and change KeepBuffer and KeepNick default for --makeconf
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@924 726aef4b-f618-498e-8847-2d620e286838
2008-01-18 22:11:53 +00:00
psychon
cc20744683 Small cleanup to calling of OnBoot() for user modules
There is no reason to call it indirectly and this should also
decrease the binary size a little.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@919 726aef4b-f618-498e-8847-2d620e286838
2008-01-08 19:48:45 +00:00
psychon
5210c3bfae Fix for OpenBSD and don't busy loop for file locks
I don't think there is a high change that the file lock becomes available
in the short time we did loop and retry the lock, so that code served no
real purpose.

Also, this includes unistd.h in Utils.h which is needed for OpenBSD.
Thanks to fred for testing on his openbsd/sparc box.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@918 726aef4b-f618-498e-8847-2d620e286838
2008-01-08 17:13:10 +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
55a3fa0e05 Remove OnFinishedConfig() module call
No one used it anyway


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@909 726aef4b-f618-498e-8847-2d620e286838
2008-01-03 21:00:25 +00:00
psychon
c4891c5dd8 Fix a segfault on exit
When we ran CZNC::~CZNC() we called DeleteUsers() which called
RestartConnectUser(). Since we had already deleted that timer, we called
some already deleted class.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@908 726aef4b-f618-498e-8847-2d620e286838
2008-01-03 20:01:26 +00:00
psychon
10519ae595 Change the tag CZNC::GetTag() returns to be shorter
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@906 726aef4b-f618-498e-8847-2d620e286838
2007-12-27 20:42:52 +00:00
psychon
b490b12058 Fix some gcc 4.3 warnings
These are mostly string casts, handling function's return value and some
weird warning about missing spaces on empty while loops.

These were reported by and fixed with Marcus Rueckert <darix@opensu.se>.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@904 726aef4b-f618-498e-8847-2d620e286838
2007-12-20 18:31:48 +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
cf41b0acd0 Switch back to a min select timeout of 500 msec
x-x noticed that ConnectDelay = 4 would break with a min timeout of 5 sec...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@894 726aef4b-f618-498e-8847-2d620e286838
2007-12-02 15:25:11 +00:00
psychon
b51302be13 Change the list of to-be-deleted users into a std::map
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@893 726aef4b-f618-498e-8847-2d620e286838
2007-12-02 15:16:21 +00:00
psychon
d78369fee0 Main part is: Add disconnect and connect to *status
Other stuff included here:
- Always send the quit message when disconnecting from IRC
- Partly rewrite CConnectUserTimer::RunJob() for some de-uglification


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@874 726aef4b-f618-498e-8847-2d620e286838
2007-11-16 22:37:27 +00:00
psychon
59c8522a96 Add some comments to make clear what this code does (yay, some comments in the source!)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@869 726aef4b-f618-498e-8847-2d620e286838
2007-11-12 21:28:07 +00:00
psychon
a213258c99 Move code for creating CIRCSocks into a CCron and use DynamicSelectLoop
DynamicSelectLoop checks when the next cron runs and sleeps until then (with an
upper and lower border).
To fix the connecting code it needed to be moved into a cron.



git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@860 726aef4b-f618-498e-8847-2d620e286838
2007-11-03 20:04:24 +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
8a9ddda247 Only expand the PidFile config option when writing the pid file.
This way if we rewrite the config PidFile gets the same value it had when znc
was started.
-> we don't turn it into an absolute path which is bad if data dir is changed


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@839 726aef4b-f618-498e-8847-2d620e286838
2007-09-08 16:22:10 +00:00
psychon
61ddeac102 Fix my broken indentation.
Thanks x-x for reporting this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@828 726aef4b-f618-498e-8847-2d620e286838
2007-08-19 13:57:08 +00:00