]>
Commit | Line | Data |
---|---|---|
edb26b39 P |
1 | # HG changeset patch |
2 | # Parent df91b36c77f44e1598f34fe14beff27aa4731073 | |
3 | ||
4 | diff -r df91b36c77f4 include/s_bsd.h | |
5 | --- a/include/s_bsd.h Sun Jul 14 22:22:08 2013 +0100 | |
6 | +++ b/include/s_bsd.h Sun Jul 14 22:24:05 2013 +0100 | |
7 | @@ -69,5 +69,6 @@ | |
8 | extern void close_connections(int close_stderr); | |
9 | extern int init_connection_limits(void); | |
10 | extern void update_write(struct Client* cptr); | |
11 | +extern void reset_connection_timer(); | |
12 | ||
13 | #endif /* INCLUDED_s_bsd_h */ | |
14 | diff -r df91b36c77f4 ircd/ircd.c | |
15 | --- a/ircd/ircd.c Sun Jul 14 22:22:08 2013 +0100 | |
16 | +++ b/ircd/ircd.c Sun Jul 14 22:24:05 2013 +0100 | |
17 | @@ -316,6 +316,10 @@ | |
18 | timer_add(&connect_timer, try_connections, 0, TT_ABSOLUTE, next); | |
19 | } | |
20 | ||
21 | +void reset_connection_timer() { | |
22 | + Debug((DEBUG_NOTICE, "reset_connect_timer: Next connection check : %s", myctime(CurrentTime + feature_int(FEAT_HANGONRETRYDELAY) + 1))); | |
23 | + timer_chg(&connect_timer, TT_ABSOLUTE, CurrentTime + feature_int(FEAT_HANGONRETRYDELAY) + 1); | |
24 | +} | |
25 | ||
26 | /** Check for clients that have not sent a ping response recently. | |
27 | * Reschedules itself to run again at the appropriate time. | |
28 | diff -r df91b36c77f4 ircd/s_bsd.c | |
29 | --- a/ircd/s_bsd.c Sun Jul 14 22:22:08 2013 +0100 | |
30 | +++ b/ircd/s_bsd.c Sun Jul 14 22:24:05 2013 +0100 | |
31 | @@ -392,6 +392,9 @@ | |
32 | feature_int(FEAT_HANGONRETRYDELAY) : ConfConFreq(aconf)); | |
33 | /* if (nextconnect > aconf->hold) */ | |
34 | /* nextconnect = aconf->hold; */ | |
35 | + #ifdef DEBUGMODE | |
36 | + reset_connection_timer(); | |
37 | + #endif | |
38 | } | |
39 | } | |
40 | else if (IsUser(cptr)) { | |
41 | @@ -403,6 +406,16 @@ | |
42 | else | |
43 | ServerStats->is_ni++; | |
44 | ||
45 | + #ifdef DEBUGMODE | |
46 | + if (IsServerPort(cptr) || IsHandshake(cptr)) { | |
47 | + if ((aconf = find_conf_exact(cli_name(cptr), cptr, CONF_SERVER))) { | |
48 | + /* update aconf->hold for a failed connection (so as not to spam reconnect's */ | |
49 | + aconf->hold = CurrentTime + ConfConFreq(aconf); | |
50 | + } | |
51 | + reset_connection_timer(); | |
52 | + } | |
53 | + #endif | |
54 | + | |
55 | if (-1 < cli_fd(cptr)) { | |
56 | flush_connections(cptr); | |
57 | LocalClientArray[cli_fd(cptr)] = 0; |