client_p->localClient->lasttime = client_p->localClient->firsttime = CurrentTime;
- client_p->localClient->fd = -1;
+ client_p->localClient->F = NULL;
client_p->localClient->ctrlfd = -1;
client_p->preClient = (struct PreClient *) BlockHeapAlloc(pclient_heap);
client_p->localClient->listener = 0;
}
- if(client_p->localClient->fd >= 0)
- comm_close(client_p->localClient->fd);
+ if(client_p->localClient->F)
+ comm_close(client_p->localClient->F->fd);
if(client_p->localClient->passwd)
{
{
client_p = ptr->data;
- /*
- ** Note: No need to notify opers here. It's
- ** already done when "FLAGS_DEADSOCKET" is set.
- */
if(!MyConnect(client_p) || IsDead(client_p))
continue;
- if(IsPerson(client_p))
- {
- if(!IsExemptKline(client_p) &&
- GlobalSetOptions.idletime &&
- !IsOper(client_p) &&
- !IsIdlelined(client_p) &&
- ((CurrentTime - client_p->localClient->last) > GlobalSetOptions.idletime))
- {
- struct ConfItem *aconf;
-
- aconf = make_conf();
- aconf->status = CONF_KILL;
-
- DupString(aconf->host, client_p->host);
- DupString(aconf->passwd, "idle exceeder");
- DupString(aconf->user, client_p->username);
- aconf->port = 0;
- aconf->hold = CurrentTime + 60;
- add_temp_kline(aconf);
- sendto_realops_snomask(SNO_GENERAL, L_ALL,
- "Idle time limit exceeded for %s - temp k-lining",
- get_client_name(client_p, HIDE_IP));
-
- exit_client(client_p, client_p, &me, aconf->passwd);
- continue;
- }
- }
-
ping = get_client_ping(client_p);
if(ping < (CurrentTime - client_p->localClient->lasttime))
{
dlink_node *ptr, *next_ptr;
struct Client *client_p;
+ int timeout;
DLINK_FOREACH_SAFE(ptr, next_ptr, list->head)
{
* for > 30s, close them.
*/
- if((CurrentTime - client_p->localClient->firsttime) > 30)
+ timeout = IsAnyServer(client_p) ? ConfigFileEntry.connect_timeout : 30;
+ if((CurrentTime - client_p->localClient->firsttime) > timeout)
+ {
+ if(IsAnyServer(client_p))
+ {
+ sendto_realops_snomask(SNO_GENERAL, is_remote_connect(client_p) ? L_NETWIDE : L_ALL,
+ "No response from %s, closing link",
+ get_server_name(client_p, HIDE_IP));
+ ilog(L_SERVER,
+ "No response from %s, closing link",
+ log_client_name(client_p, HIDE_IP));
+ }
exit_client(client_p, client_p, &me, "Connection timed out");
+ }
}
}
else
ServerStats->is_ni++;
- if(-1 < client_p->localClient->fd)
+ if(client_p->localClient->F)
{
/* attempt to flush any pending dbufs. Evil, but .. -- adrian */
if(!IsIOError(client_p))
- send_queued_write(client_p->localClient->fd, client_p);
+ send_queued_write(client_p->localClient->F->fd, client_p);
- comm_close(client_p->localClient->fd);
- client_p->localClient->fd = -1;
+ comm_close(client_p->localClient->F->fd);
+ client_p->localClient->F = NULL;
}
if(-1 < client_p->localClient->ctrlfd)
* for reading even though it ends up being an EOF. -avalon
*/
char errmsg[255];
- int current_error = comm_get_sockerr(client_p->localClient->fd);
+ int current_error = comm_get_sockerr(client_p->localClient->F->fd);
SetIOError(client_p);