mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-02 06:26:37 +02:00
Disable handshake delay for users that are exempt from blacklist checking.
The handshake delay exists so results from DNSBL's can be checked before the user is fully online. Whenever someone is exempt from DNSBL checking it serves no purpose, so we mark it that the user has no handshake delay. This will speed up connecting by up to 2 seconds (by default). Also updated WebIRC example to suggest this now: https://www.unrealircd.org/docs/WebIRC_block#UnrealIRCd-side
This commit is contained in:
@@ -321,6 +321,7 @@ typedef enum ClientStatus {
|
||||
#define CLIENT_FLAG_DCCBLOCK 0x04000000 /**< Block all DCC send requests */
|
||||
#define CLIENT_FLAG_MAP 0x08000000 /**< Show this entry in /MAP (only used in map module) */
|
||||
#define CLIENT_FLAG_PINGWARN 0x10000000 /**< Server ping warning (remote server slow with responding to PINGs) */
|
||||
#define CLIENT_FLAG_NOHANDSHAKEDELAY 0x20000000 /**< No handshake delay */
|
||||
/** @} */
|
||||
|
||||
#define SNO_DEFOPER "+kscfvGqobS"
|
||||
@@ -421,6 +422,7 @@ typedef enum ClientStatus {
|
||||
#define IsOutgoing(x) ((x)->flags & CLIENT_FLAG_OUTGOING)
|
||||
#define IsPingSent(x) ((x)->flags & CLIENT_FLAG_PINGSENT)
|
||||
#define IsPingWarning(x) ((x)->flags & CLIENT_FLAG_PINGWARN)
|
||||
#define IsNoHandshakeDelay(x) ((x)->flags & CLIENT_FLAG_NOHANDSHAKEDELAY)
|
||||
#define IsProtoctlReceived(x) ((x)->flags & CLIENT_FLAG_PROTOCTL)
|
||||
#define IsQuarantined(x) ((x)->flags & CLIENT_FLAG_QUARANTINE)
|
||||
#define IsShunned(x) ((x)->flags & CLIENT_FLAG_SHUNNED)
|
||||
@@ -451,6 +453,7 @@ typedef enum ClientStatus {
|
||||
#define SetOutgoing(x) do { (x)->flags |= CLIENT_FLAG_OUTGOING; } while(0)
|
||||
#define SetPingSent(x) do { (x)->flags |= CLIENT_FLAG_PINGSENT; } while(0)
|
||||
#define SetPingWarning(x) do { (x)->flags |= CLIENT_FLAG_PINGWARN; } while(0)
|
||||
#define SetNoHandshakeDelay(x) do { (x)->flags |= CLIENT_FLAG_NOHANDSHAKEDELAY; } while(0)
|
||||
#define SetProtoctlReceived(x) do { (x)->flags |= CLIENT_FLAG_PROTOCTL; } while(0)
|
||||
#define SetQuarantined(x) do { (x)->flags |= CLIENT_FLAG_QUARANTINE; } while(0)
|
||||
#define SetShunned(x) do { (x)->flags |= CLIENT_FLAG_SHUNNED; } while(0)
|
||||
@@ -480,6 +483,7 @@ typedef enum ClientStatus {
|
||||
#define ClearOutgoing(x) do { (x)->flags &= ~CLIENT_FLAG_OUTGOING; } while(0)
|
||||
#define ClearPingSent(x) do { (x)->flags &= ~CLIENT_FLAG_PINGSENT; } while(0)
|
||||
#define ClearPingWarning(x) do { (x)->flags &= ~CLIENT_FLAG_PINGWARN; } while(0)
|
||||
#define ClearNoHandshakeDelay(x) do { (x)->flags &= ~CLIENT_FLAG_NOHANDSHAKEDELAY; } while(0)
|
||||
#define ClearProtoctlReceived(x) do { (x)->flags &= ~CLIENT_FLAG_PROTOCTL; } while(0)
|
||||
#define ClearQuarantined(x) do { (x)->flags &= ~CLIENT_FLAG_QUARANTINE; } while(0)
|
||||
#define ClearShunned(x) do { (x)->flags &= ~CLIENT_FLAG_SHUNNED; } while(0)
|
||||
|
||||
@@ -558,9 +558,15 @@ int blacklist_start_check(Client *client)
|
||||
{
|
||||
Blacklist *bl;
|
||||
|
||||
/* If the user is on 'except blacklist' then don't bother checking... */
|
||||
if (find_tkl_exception(TKL_BLACKLIST, client))
|
||||
{
|
||||
/* If the user is exempt from DNSBL checking then:
|
||||
* 1) Don't bother checking DNSBL's
|
||||
* 2) Disable handshake delay for this user, since it serves no purpose.
|
||||
*/
|
||||
SetNoHandshakeDelay(client);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!BLUSER(client))
|
||||
{
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ void parse_client_queued(Client *client)
|
||||
return; /* we delay processing of data until identd has replied */
|
||||
|
||||
if (!IsUser(client) && !IsServer(client) && (iConf.handshake_delay > 0) &&
|
||||
(TStime() - client->local->firsttime < iConf.handshake_delay))
|
||||
!IsNoHandshakeDelay(client) && (TStime() - client->local->firsttime < iConf.handshake_delay))
|
||||
{
|
||||
return; /* we delay processing of data until set::handshake-delay is reached */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user