Channel buffers are loaded from disk when we join a channel (OnJoin) and when
the module is loaded (OnBoot(), called from OnLoad()) and only if KeepBuffer
for that channel is turned on. So every case is handled.
If we now also load channel buffers in SaveBufferToDisk() we will only reload
old channel buffers which were deleted since then
(e.g. /msg *status clearallchannelbuffers).
Thanks to Julian for finding this bug and helping me debug.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1345 726aef4b-f618-498e-8847-2d620e286838
This makes it clearer what this variable is and it makes porting to windows
easier, because we can just change the typedef to HMODULE.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1344 726aef4b-f618-498e-8847-2d620e286838
In theory this could lead to extra copies of the password in memory, but since
no caller actually makes sure that those passwords are forgotten as fast as
possible, I don't see why this should be done the Old Way(tm).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1343 726aef4b-f618-498e-8847-2d620e286838
CUtils::GetLongIP() had a bug where it would overflow an integer for IPs
which started which a number higher than 127.
This is now fixed by using unsigned integers and doing that shift on a long.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1340 726aef4b-f618-498e-8847-2d620e286838
This shouldn't contain any major behaviour change, but there are some minor
ones. Also, the API for a shared lock wasn't used and thus is dropped.
Thanks to cnu for this idea.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1337 726aef4b-f618-498e-8847-2d620e286838
Now a module with unresolved symbols will fail to load instead of
potentially getting ZNC killed when an undefined symbol was used.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1332 726aef4b-f618-498e-8847-2d620e286838
The stuff in CUtils::GetHashPass() and CUtils::GetSaltedHashPass() shouldn't
hurt, since we don't do such stuff in other places for passwords either.
This should improve the readability of the code a lot.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1324 726aef4b-f618-498e-8847-2d620e286838
This removes ReadFile(), WriteFile(), ReadLine(), Lower() and Upper() from
Utils.h and adds CFile::ReadFile().
The biggest part of this patch fixes modules to use CFile and CString instead
of these global functions.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1311 726aef4b-f618-498e-8847-2d620e286838
IMHO it is now a little clearer how this function works and it might be
a little faster. Biggest change is that we now read 4k of the file at once
instead of reading it in 64byte chunks. I doubt that this causes a lot more
memory usage, because CFile instances usually dont live for long, but it
should really lower the number of syscalls we need for reading a file.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1306 726aef4b-f618-498e-8847-2d620e286838
- schat now works again (yay)
- it now uses CSocket instead of Csock directly
- list only displays schat's own sockets
- other minor stuff
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1303 726aef4b-f618-498e-8847-2d620e286838
This removes some not-so-important cache and uses a CString instead of a
set<unsigned char> for saving the flags this nick has (op, voice, ...).
set is huge!
Before the virtual removal (r1300), CNick had 144 bytes, without the virtuals
it only took 112 bytes. Now after this commit it is down to 40 bytes. (amd64)
Happy Christmas tomaw ;)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1302 726aef4b-f618-498e-8847-2d620e286838
This is mostly done by removing unused members, but there is also removes a
cache which saved how many opped, voiced etc users are on a channel.
This shouldn't result in a big slowdown, since this data is only ever used
for /msg *status listchans.
Also, this replaces the API to access this data with a version which should
be faster especially for big channels.
On amd64 the size of CChan was 600 bytes before and is 400 bytes now.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1301 726aef4b-f618-498e-8847-2d620e286838