Every socket which is based on CZNCSock will now use c-ares for its name
resolving. This is possible thanks to CSocket's Csock::GetAddrInfo() which
lets one override the DNS lookup.
This can be disabled with --disable-c-ares.
If IPv6 is enabled and Csocket didn't specify which kind of lookup (ipv4/ipv6)
it wants, we first do an ipv4 lookup. If that lookup doesn't yield any useful
result, we try again with an ipv6 lookup. If one wants to force ipv6 usage on a
domain which also resolves to an ipv4 address, he has to set an ipv6 vhost.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1551 726aef4b-f618-498e-8847-2d620e286838
Classes derived from Csock* can be casted implicitly to their base class, this
explicit casts are rather pointless.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1548 726aef4b-f618-498e-8847-2d620e286838
The following sequence triggered this bug:
/mode <chan> +ov-o <you> <you> <you>
The deop called CNick::RemPerm('@') which removed the '@' from the list of
perms via std::string::erase(<positiong of '@' in that string>). The bug was
that erase() by default erases till the end of the string, but we only wanted
to remove a single character. The fix is easy, just pass in '1' as a second
parameter. :)
Thanks to sp219 for finding and reporting this bug.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1547 726aef4b-f618-498e-8847-2d620e286838
Changes include...
- CString -
Addition of LCString typedef to list<CString>
Added four more args to CString::Token()...
bool bAllowEmpty = false <-- This default of false is NOT backward compatible but seems way more intuitive
const CString& sLeft = ""
const CString& sRight = ""
bool bTrimQuotes = true
Added CString::OptionSplit()
Added CString::QuoteSplit()
Added two new args to CString::Split()...
bool bTrimQuotes = true,
bool bTrimWhiteSpace = false
- CTemplate -
Added new class CTemplateTagHandler to provide capability to add custom tags and vars
Added var name pointer dereferencing in the form of <? VAR Name=*other_var ?> (use ** to start with a literal star)
Added a list of paths that can be used to look for a given filename in multiple locations
Added CTemplate::PrependPath()
Added CTemplate::AppendPath()
Added CTemplate::RemovePath()
Added CTemplate::ClearPath()
Added CTemplate::PrintString() for filling a CString& instead of a stream
Added <? LT ?> which outputs a literal "<?"
Added <? GT ?> which outputs a literal "?>"
Added <? SETBLOCK ?> and <? ENDSETBLOCK ?> for setting a variable's value to the contents between the tags
Added <? EXPAND ?> for expanding a filename to a path using the settable list of paths
Added <? BREAK ?> and <? CONTINUE ?> inner loop tags
Added <? EXIT ?> tag to stop processing
Added <? DEBUG ?> tag for printing to DEBUG()
Added REVERSE keyword to the <? LOOP ?> tag
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1537 726aef4b-f618-498e-8847-2d620e286838
If you now load stickychan with "#chan1,#chan2 bla" as its argument, both
channels are stuck where "bla" is the channel key for #chan2.
Thanks to FB-eYe for the suggestion.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1534 726aef4b-f618-498e-8847-2d620e286838
deque got constant time removal of elements at the beginning of the sequence,
vector doesn't. The plan is that this saves some CPU time in CBuffer::AddLine()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1532 726aef4b-f618-498e-8847-2d620e286838
When ZNC is restarted we have to pass on most of ZNC's arguments. Until now we
only handled --datadir. Now we also handle --debug, --foreground, --no-color
and --allow-root.
Thanks to kopn3ft0r for finding this.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1531 726aef4b-f618-498e-8847-2d620e286838
The code checked if every line received from the IRC server started with a
colon and contained at least two spaces using a wildcard comparison. Since not
doing this would violate the IRC specs, we can safely assume this.
This command removes this if and reindents a shitload of code. The only change
in there is a removed comment, everything else should be the same.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1528 726aef4b-f618-498e-8847-2d620e286838
I doubt this makes much of a difference, but some callgrind run with one hour
of #ubuntu pointed to this stuff. Let's hope it's at least a little little
little bit faster now
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1527 726aef4b-f618-498e-8847-2d620e286838
Because the precision defaults to 2, e.g. the traffic stats are now way more
readable.
Thanks to KiNgMaR for the idea and the patch.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1525 726aef4b-f618-498e-8847-2d620e286838
r1481 moved the /img/ subdir into /data/, but forgot to fix the path which
is used for the favicon, which meant we generated a 404 for the favicon.
Fix this by using the correct path and everyone is happy again.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1524 726aef4b-f618-498e-8847-2d620e286838
The last commit broke the order in which the traffic stats used to be displayed
and it turns out that KiNgMaR cannot live with that, so now we are back to the
old order.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1523 726aef4b-f618-498e-8847-2d620e286838
Removed CSmartPtr's GetCount and renamed GetClientCount to GetCount.
The version returning a pointer is not used anyway. Furthermore removed
a check for a null pointer which is already checked some lines above
and replaced m_pType = &(*CopyFrom) with m_tType = CopyFrom.m_pType,
since an overloaded operator & could break this code (it doesn't matter
if we check the m_pType afterwards. It could be nonezero and invalid
anyway).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1522 726aef4b-f618-498e-8847-2d620e286838
We now have a central function CZNC::GetTrafficStats() which does all the ugly
stuff and just returns the data which the caller can then display. We now also
include all unknown sockets (e.g. imapauth or webadmin sockets) in the traffic
stats in the "<ZNC>" section.
The only downside to all this gloriousness is that this breaks the ordering of
/msg *status traffic which is now sorted alphabetically which means that <ZNC>
<Users> and <Total> aren't anymore in the places in which they used to be.
I hope one can live with that...
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1521 726aef4b-f618-498e-8847-2d620e286838
This commit breaks webadmin. This was found with firefox. If you got any client
certificates imported into firefox, it will ask you to select which certificate
to use a couple of times per click (once per HTTP request which means also when
loading images etc).
Since webadmin by default shares the listen port with znc, we can't limit this
SSL_VERIFY_PEER to webadmin listening ports. The simplest solution is thus to
just drop this.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1514 726aef4b-f618-498e-8847-2d620e286838
Tcl fork()s to create a child process, the child exits and tcl tries to get
the child's exit code via waitpid() but when the child process exits, we get
SIGCHLD, call waitpid() ourselves and thus the exit code (and the whole
zombie) is discarded and tcl can't get the child's exit code.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1513 726aef4b-f618-498e-8847-2d620e286838
ZNC replies to /mode #chan with the cached channel modes without querying the
IRCd. This was added to avoid traffic spikes to the ircd when a client
logged in.
The logic in this code had a bug that made it also reply with stale cached
values if we once were but aren't anymore in that channel (e.g. after
you've been kicked).
Thanks to tomaw for reporting this.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1507 726aef4b-f618-498e-8847-2d620e286838
Now e.g. the message "Invalid Password" on login even reaches the other end
before the connection shoots itself in the foot.
There is one place in Client.cpp which I didn't change: ReachedMaxBuffer()
If a client is flooding is, why should we wait until we are done answering
that flood?...
Thanks to morelia for making me notice this.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1506 726aef4b-f618-498e-8847-2d620e286838
The old code failed to collect the following command to *shell correctly:
exec > /dev/null 2> /dev/null < /dev/null ; sleep 10
The timeout in CExecSock::close2() was over before the child processes exited
and a zombie was left behind. Plus we used some ugly busy looping while
waiting for the child to exit. Using SIGCHLD for collecting zombies is
soooooo much nicer.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1504 726aef4b-f618-498e-8847-2d620e286838
configure now generates to files for pkg-config:
znc.pc and znc-uninstalled.pc
This is supposed to replace the znc-config binary. Everything which can be done
with znc-config can now also be done with pkg-config.
znc-uninstalled.pc is only generated by configure, but not installed by the
Makefiles. It's there to fix some kind of bug we have with znc-config.
ZNC can run quite fine from the source, there is no need to ever run
"make install". The only problem is that e.g. znc-extra won't build, since
it gets -I/usr/local/include/znc from znc-config which doesn't work since znc
was never installed.
pkg-config has a nice fix for this: If you ask for "a", but "a-uninstalled"
exists, pkg-config will use the later one instead. This is used in
znc-uninstalled.pc to output a different -I flag which works for the
uninstalled headers.
(You only have to set $PKG_CONFIG_PATH to znc's source dir for this to work)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1503 726aef4b-f618-498e-8847-2d620e286838