176 |
|
void |
177 |
|
close_connection(struct Client *client_p) |
178 |
|
{ |
179 |
– |
struct ConfItem *conf; |
179 |
|
struct AccessItem *aconf; |
180 |
|
struct ClassItem *aclass; |
181 |
+ |
dlink_node *ptr = NULL; |
182 |
|
|
183 |
< |
assert(NULL != client_p); |
183 |
> |
assert(client_p); |
184 |
|
|
185 |
|
if (!IsDead(client_p)) |
186 |
|
{ |
207 |
|
ServerStats.is_sbr += client_p->localClient->recv.bytes; |
208 |
|
ServerStats.is_sti += CurrentTime - client_p->localClient->firsttime; |
209 |
|
|
210 |
< |
/* XXX Does this even make any sense at all anymore? |
211 |
< |
* scheduling a 'quick' reconnect could cause a pile of |
212 |
< |
* nick collides under TSora protocol... -db |
213 |
< |
*/ |
214 |
< |
/* |
215 |
< |
* If the connection has been up for a long amount of time, schedule |
216 |
< |
* a 'quick' reconnect, else reset the next-connect cycle. |
217 |
< |
*/ |
218 |
< |
if ((conf = find_conf_exact(SERVER_TYPE, client_p->name, |
219 |
< |
client_p->username, client_p->host))) |
210 |
> |
DLINK_FOREACH(ptr, server_items.head) |
211 |
|
{ |
212 |
+ |
struct ConfItem *conf = ptr->data; |
213 |
+ |
|
214 |
+ |
if (irccmp(conf->name, client_p->name)) |
215 |
+ |
continue; |
216 |
+ |
|
217 |
|
/* |
218 |
< |
* Reschedule a faster reconnect, if this was a automatically |
219 |
< |
* connected configuration entry. (Note that if we have had |
224 |
< |
* a rehash in between, the status has been changed to |
225 |
< |
* CONF_ILLEGAL). But only do this if it was a "good" link. |
218 |
> |
* Reset next-connect cycle of all connect{} blocks that match |
219 |
> |
* this servername. |
220 |
|
*/ |
221 |
|
aconf = map_to_conf(conf); |
222 |
|
aclass = map_to_conf(aconf->class_ptr); |
223 |
< |
aconf->hold = time(NULL); |
230 |
< |
aconf->hold += (aconf->hold - client_p->localClient->since > HANGONGOODLINK) ? |
231 |
< |
HANGONRETRYDELAY : aclass->con_freq; |
223 |
> |
aconf->hold = CurrentTime + aclass->con_freq; |
224 |
|
} |
225 |
|
} |
226 |
|
else |