Commit Graph

83 Commits

Author SHA1 Message Date
Alexey Sokolov ddb1af86fd Ask for port > 1024 in --makeconf
There're so many people who try lower ports and get permission denied :(
Who really wants to use privileged port, can add it using /znc addport
2012-03-10 08:24:19 +07:00
Kyle Fuller aa9a629bf3 CString("off").ToBool() shouldn't be true 2012-03-06 18:00:43 +00:00
Kyle Fuller f44b7fc7c4 Clear channel buffers if keep buffer is disabled and we're online 2012-03-06 17:55:14 +00:00
Kyle Fuller c54b3d0b87 webadmin: Implement clone user
Closes #127
2012-02-24 17:26:04 +00:00
Alexey Sokolov 7ac61474ed ZNC-Extra no more.
Few the most useless modules are just removed, the others are moved to
standard modules.
2012-02-21 19:34:36 +07:00
Kyle Fuller 11e5f7636d Add 381 to the buffer (You are now an IRC Operator) 2012-02-19 14:39:03 +00:00
Uli Schlachter 1dd8d9bf3e Block all signals in DNS threads
A DNS thread should never handle any kind of signal. The main thread is
responsible for handling signals and it does so without any kind of locking.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-19 12:26:19 +01:00
Uli Schlachter 252e6d7151 Threaded DNS: Handle spurious wakeups
As DarthGandalf noticed, POSIX allows spurious wakeups from pthread_cond_wait.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-19 12:13:25 +01:00
Kyle Fuller 8863d853c9 Allow disabling the use of adding networks for non admins
Closes #122
2012-02-15 16:27:47 +00:00
Kyle Fuller b9ff3ddcb1 The connect queue shouldn't be unpaused when ZNC starts 2012-02-14 19:34:02 +00:00
Kyle Fuller 59ad967d77 Merge branch 'queue' 2012-02-14 19:32:03 +00:00
Uli Schlachter 0bdb18a427 Threaded DNS: Use a thread pool
When a DNS thread is done with its lookup, instead of existing immediately, it
now waits for another DNS lookup to do instead. This avoids the cost of
starting/stopping threads all the time.

To make sure that (for whatever reason) the number of waiting threads doesn't
get too high, threads exit if there are more than two DNS threads idling around
with nothing to do.

Fixes #132.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-14 20:28:28 +01:00
Kyle Fuller 30fb68023b Pause connect queue should pause and resume a timer
So we don't cheat the connect delay
2012-02-14 19:22:50 +00:00
Kyle Fuller e47f76db6c Allow the connection queue to be paused 2012-02-14 19:22:33 +00:00
Kyle Fuller ec1202daf3 {unload,reload}mod: Don't get modinfo if the type is defined
This allows us to unload a module if we supply the type and mod info
cannot be loaded (such as if the module file has been moved).
2012-02-14 12:10:07 +00:00
Kyle Fuller e08d53dcd5 Show network modules on the web interface menu
Closes #121
2012-02-13 23:58:32 +00:00
Kyle Fuller 5c844cf81a Send nick changes to clients before we use call the OnNick module hook
This fixes a bug where sending anything to a client, such as with
PutModule will fail because it will refer to the new nick before the
client knows about it. The watch module did this.
2012-02-12 20:07:57 +00:00
Kyle Fuller b1ed9c9b74 Add methods to CModule to get the web path
Add these values to the template and use them when linking to any module
2012-02-09 17:07:28 +00:00
Kyle Fuller b1593238d5 Make the URL's for web modules include the module type (#121) 2012-02-09 14:19:26 +00:00
silverleo bb666b0ab7 Fix an Unrecoverable config error issue when reading from an old config.
Default this boolean to true incase there are no networks to loop over. This
will silently drop any network modules for the user, but since there are no
networks anyway it doesn't really matter.
2012-02-05 16:45:00 +02:00
Alexey Sokolov 47c427c39d Merge branch 'master' of github.com:znc/znc 2012-02-05 17:44:31 +07:00
Alexey Sokolov 94f785948b Check that modules are in place on start.
There're many people who forget to run "make install" and then wonder
why they can't load any module.

This should fix it, hopefully.
2012-02-05 17:41:40 +07:00
Uli Schlachter 95d6041018 Fix a busy loop with the connection queue
If connecting to a server failed without needing any time for DNS, the connect
timer would busy loop over the networks, because a network re-inserted itself
into the queue and the timer would try the network again.

Fix this by moving the connection queue to a separate instance of std::list when
the timer fires. From then on, we just iterate through that list while networks
which want to try again add themselves to the "real" connection queue instead.

We only have to make sure that any networks that are left in the old connection
queue after the timer is done get prepended to the "real" connection queue.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-04 19:53:03 +01:00
Uli Schlachter 1d16d1ce7d Fix a stupid bug in CUser::~CUser()
A CIRCNetwork's destructor removes the network from its associated user's list
of networks. Now that you know this, stare at the diff until you figure out the
problem. Yeah, "ouch".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-04 14:16:54 +01:00
Uli Schlachter 233897b3a8 threaded DNS: Remove an unneeded function
This inlines the function into its only caller.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-04 14:15:52 +01:00
Uli Schlachter 94c7b04245 Threaded DNS: Remove TDNS mutex
POSIX actually guarantees for us that this white is atomic and thus a partial
write is not allowed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-04 14:15:52 +01:00
Alexey Sokolov b811ea83d5 Describe how to use networks. 2012-01-30 00:38:51 +07:00
Alexey Sokolov fa287ef791 Make networks a bit less confusing.
If user is connected without network, try "default" network first, if it
exists. If not, try "user" network. If it doesn't exist too, just use
the first one.

Also configs converted from old configs have "default" network instead
of "user" one.
2012-01-27 22:51:09 +07:00
Uli Schlachter 29564f1c7e CFile: Make sure errno is always set correctly
This fixes weird problems were strerror() made us print garbage.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-22 18:51:01 +01:00
Uli Schlachter beacc0180c TDNS: Fix a use-after-free-race-with-threads
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-19 19:41:21 +01:00
Kyle Fuller b447169011 Allow setting a network-specific settings the same as the user setting
Fixes #94
2012-01-17 22:01:19 +00:00
Kyle Fuller f5dbe86543 CTCP's with no values should not be passed to the client
Fixes #105
2012-01-17 21:40:14 +00:00
Alexey Sokolov 937998d4a5 Merge branch 'master' into tdns 2012-01-15 13:12:28 +07:00
Alexey Sokolov ff8065ed32 TDNS: Fix few incompabilities with last Csocket. 2012-01-15 13:11:56 +07:00
Alexey Sokolov 0a7ef76de3 Use @t=time instead of @time for server-time capability.
It's incompatible change, but it makes protocol more flexible.
Version with @time was never released anyway.
2012-01-15 12:51:03 +07:00
Kyle Fuller 2d9a537c33 "no" should be false in CString::ToBool() 2012-01-15 05:18:13 +00:00
Kyle Fuller 13cfb161c9 Add outgoing lines to the buffer if we are "offline" 2012-01-15 03:54:52 +00:00
Stéphan Kochen 4bb365cda3 Update to Csocket 6da41d339f
Fixes build on OS X.
2012-01-15 02:36:03 +01:00
Uli Schlachter 10ece5d2cc CHTTPSock: Remove some useless member methods
The defaults from Csock / CSocket will be fine.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-14 12:09:25 +01:00
Uli Schlachter c87e7cf5ba Update Csocket to e00323f9f18
This breaks API for Csock::SockError()!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-14 11:33:38 +01:00
Uli Schlachter 02e42958f0 Make certs valid for 10 years
Previously, a certificate generated with --makepem expired after a year which is
weird and pointless (come on, it's self-signed!).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-13 20:57:10 +01:00
Kyle Fuller c2316321b8 JUMPNETWORK: Tell the user we have switched network before we do
The reason for this is so that any messages sent in *status by attaching
a new network will show up after the switched message.

<*status> Switched to efnet
<*status> You are currently disconnected from IRC. Use 'connect' to reconnect.
2012-01-11 14:49:25 +00:00
Kyle Fuller 3d7d1793aa Move IRCConnectEnabled to each network instead of a global user setting 2012-01-11 14:49:17 +00:00
Kyle Fuller 4abf3feae4 Remove trailing whitespace 2012-01-11 13:18:54 +00:00
Un1matr1x 73270ff023 Welcome in 2012 2012-01-01 09:30:19 +01:00
Uli Schlachter 01341cfb0a Fix some invalid iterator uses
This fixes #96. When the last user in a partyline channel is deleted, the
channel is deleted, too. This invalidates the iterator used in OnDeleteUser().
This fix is to increase the iterator before the channel can be deleted.

After the above fix, znc still crashed due to another broken use of iterators.
When a network is deleted, it takes all its clients with it (why aren't they
just moved into the "no network"-state?"). However, deleting a CClient removes
it from the network's list of clients via CClient::Disconnect(). This resulted
in another invalid use of iterators.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-29 13:54:24 +01:00
Uli Schlachter cdc27e1434 Automatically load autoaway if away is requested
This module was renamed in f604709cf0.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-29 13:54:24 +01:00
Alexey Sokolov 57a51dfd78 Fix codestyle. 2011-12-29 11:52:41 +07:00
Alexey Sokolov 6bf026599c Change c-ares to tdns in output of /znc version 2011-12-28 10:39:12 +07:00
Alexey Sokolov 717d0596e3 Use threads for resolving DNS.
Drop support for c-ares. Though Csocket still supports it, ZNC's
configure script doesn't enable it anymore.

This should fix big brokenness of c-ares library, which tried to
connect via IPv6 even when IPv6 is disabled on the system.

Also should fix github issue #37
2011-12-27 00:29:51 +07:00