The enum is a bit more verbose, but leads to more readable code:
str.Equals("foo", true)
// vs.
str.Equals("foo", CString::CaseSensitive)
Deprecate the old Equals() and leave out the length parameter
from the new version => use StartsWith() or StrCmp() instead.
The following modules are enabled by default:
- global: webadmin
- user: controlpanel, chansaver
- network: simple_away
This reduces a lot makeconf noise and fixes#541.
This adds CThreadPool::cancelJob() and cancelJobs() which can cancel a set of
jobs synchronously. These functions only return when the job was successfully
cancelled.
It tries to cancel the jobs as quickly as possible, skipping any callbacks on
CJob that were not yet called. A job that is already running can use
CJob::wasCancelled() to check if it should quit.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
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.
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>
This patch splits CUserTimer into two other timers:
CIRCNetworkPingTimer: This timer sends PING messages to connected
client's and IRC servers.
CIRCNetworkJoinTimer: This timer enforces the MaxJoin setting by only
allowing a specified amount of channels to join at the same time.
JoinChans() is modified to reset the ping timer once we hit the MaxJoin.
This allows us to call it from any function without breaking the timing
logic.
Previous commit added support of it to Csocket.
When encoding is specified, core will convert incoming messages to UTF-8,
and outgoing messages from UTF-8.
When no encoding is specified, it will do nothing to bytes, like before.
This is to be changed somewhere in future, to have UTF-8 on wire by
default too.
When encoding's name starts with *, incoming messages will be treated as
UTF-8, if it is already correct UTF-8. Otherwise, it's converted.
Fix#151Fix#366
CString::Join works like python's string join, except that it takes 2
iterators (or pointers) instead of a whole collection
CString::Convert casts a string to another type using an intermediary
stringstream.