Less magic numbers for timeout settings

Currently the connection timeout handling of znc uses three magic numbers, each
of which is at least repeated in two unrelated places. This commits defines the
numbers in CIRCNetwork and makes the other places just use this number.

This also renames PING_TIMEOUT to PING_FREQUENCY because I feel that describes
this constant better.

I am not really happy about the name NO_TRAFFIC_TIMEOUT that is used for the
real timeout, but I couldn't think of a better name. PING_TIMEOUT isn't good
because that sounds like the time between sending a PING and the resulting
timeout.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Fix typo in last commit

Thanks to drbean for reporting this in FreeNode/#znc.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Store CTCP ACTIONs recieved as well as normal PRIVMSGs.

Prepends CTCP ACTION messages recieved with a "* " before storing them.
Additionally change AddMessage to accept const CString&
Merge pull request #599 from NuclearW/awaystore-action

In awaystore, store CTCP ACTIONs
make the log filename lower case always

this fixes an annoying bug where two separate log files will be written
if an irc client sends to channel #Foobar and another irc client sends
to channel #foobar.
Merge pull request #590 from FruitieX/master

Use only lower case characters in log filenames
Add numerics 307 and 379 to route_replies for whois
UnrealIRCd (at least version Unreal3.2.10+) sends numerics 307 and 379 on whois if the client is an IRCop.
These are non-rfc and they can be seen documented here: https://www.alien.net.au/irc/irc2numerics.html
Merge pull request #600 from NuclearW/route-reply

Add numerics 307 and 379 to route_replies for whois
Add timestamp parsing to awaystore away messages
Pass the given reason through CUtils::FormatTime before setting it, allows use of strftime formatting in away messages.
Initialize OpenSSL locking functions
Merge pull request #611 from NuclearW/awaystore-timestamp

Add timestamp parsing to awaystore away messages
Full-fledged query buffers

Store query buffers per query the same way it's done for channels.

This allows clients to implement persistent query buffers. Queries
remain open across clients and sessions until a client explicitly
sends a command to clear a (closed) query buffer.

A new config option AutoClearQueryBuffer that default to false
ensures behavioral backwards compatibility, and another config
MaxQueries protects from OOM eg. due to PM attacks.
controlpanel: add support for AutoClearQueryBuffer & MaxQueries
webadmin: add support for AutoClearQueryBuffer & MaxQueries
clearbufferonmsg: handle query buffers
savebuff: handle query buffers
Threads: Add some undefined constructors etc

This is needed to "get rid" of the C++ default implementation. Yes, I know that
this can be done way nicer with C++11...

Signed-off-by: Uli Schlachter <psychon@znc.in>
StringTest: Make a local function static

Signed-off-by: Uli Schlachter <psychon@znc.in>
Add a ThreadTest to the testsuite

Signed-off-by: Uli Schlachter <psychon@znc.in>
modpython, modperl: Parse all headers

Signed-off-by: Uli Schlachter <psychon@znc.in>