This avoids blocking on upstream message rate limiting for too
long.
git-svn-id: file:///srv/svn/repo/suika/trunk@757 f0ae65fe-ee39-954e-97ec-027ff2717ef4
If a user goroutine panics, this correctly removes it from the
global map instead of leaving a dangling entry behind.
git-svn-id: file:///srv/svn/repo/suika/trunk@756 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Sometimes this command times out. Display the number of skipped
users.
git-svn-id: file:///srv/svn/repo/suika/trunk@755 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Makes it clearer what these fields are used for. The default value
for dc.nick is "*".
git-svn-id: file:///srv/svn/repo/suika/trunk@754 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Makes it easy to print debugging messages which aren't targeted at
the user. See [1] for motivation.
[1]: https://dave.cheney.net/2015/11/05/lets-talk-about-logging
git-svn-id: file:///srv/svn/repo/suika/trunk@747 f0ae65fe-ee39-954e-97ec-027ff2717ef4
It's extra code for something clients should ignore because it's
unreliable and useless.
git-svn-id: file:///srv/svn/repo/suika/trunk@745 f0ae65fe-ee39-954e-97ec-027ff2717ef4
If the nickname we want is taken, fallback to another one by
appending underscores. Use MONITOR to figure out when we can request
our desired nick again.
Closes: https://todo.sr.ht/~emersion/soju/35
git-svn-id: file:///srv/svn/repo/suika/trunk@743 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Clients aren't supposed to do this, but in case they do, let's
send them an error.
git-svn-id: file:///srv/svn/repo/suika/trunk@742 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Instead of hand-rolling our own rate-limiter based on goroutines,
use golang.org/x/time/rate.
git-svn-id: file:///srv/svn/repo/suika/trunk@741 f0ae65fe-ee39-954e-97ec-027ff2717ef4
If a client queues a high number of commands and then disconnects,
remove all of the pending commands. This avoids unnecessarily
sending commands whose results won't be used.
git-svn-id: file:///srv/svn/repo/suika/trunk@738 f0ae65fe-ee39-954e-97ec-027ff2717ef4
The first reconnection attempt waits for 1min, the second the 2min,
and so on up to 10min. There's a 1min jitter so that multiple failed
connections don't try to reconnect at the exact same time.
Closes: https://todo.sr.ht/~emersion/soju/161
git-svn-id: file:///srv/svn/repo/suika/trunk@735 f0ae65fe-ee39-954e-97ec-027ff2717ef4
It wasn't decremented on error. While at it, increment it when
connecting to the upstream network.
git-svn-id: file:///srv/svn/repo/suika/trunk@733 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This adds support for the draft/account-registration extension [1].
This allows downstreams to register on upstream networks.
[1]: https://ircv3.net/specs/extensions/account-registration
git-svn-id: file:///srv/svn/repo/suika/trunk@729 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This will stop clients from trying to issue AUTHENTICATE requests
after connection registration.
git-svn-id: file:///srv/svn/repo/suika/trunk@725 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Once the downstream connection has logged in with their bouncer
credentials, allow them to issue more SASL auths which will be
redirected to the upstream network. This allows downstream clients
to provide UIs to login to transparently login to upstream networks.
git-svn-id: file:///srv/svn/repo/suika/trunk@724 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This will allow clients to properly show/hide UI to login and
register.
git-svn-id: file:///srv/svn/repo/suika/trunk@722 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Implements the following recommendation from the spec:
> If the client completes registration (with CAP END, NICK, USER and any other
> necessary messages) while the SASL authentication is still in progress, the
> server SHOULD abort it and send a 906 numeric, then register the client
> without authentication.
git-svn-id: file:///srv/svn/repo/suika/trunk@721 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This patch adds a bit more compliance to the chathistory IRCv3 specification.
git-svn-id: file:///srv/svn/repo/suika/trunk@719 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Now that dc.nick is not blank during registration, sasl replies from the
server are correct and cap handling can be a bit simplified.
git-svn-id: file:///srv/svn/repo/suika/trunk@716 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This enables production debugging of the bouncer.
Closes: https://todo.sr.ht/~emersion/soju/155
git-svn-id: file:///srv/svn/repo/suika/trunk@713 f0ae65fe-ee39-954e-97ec-027ff2717ef4