| 58 |
|
|
| 59 |
|
struct Callback *setup_socket_cb = NULL; |
| 60 |
|
|
| 61 |
< |
static void comm_connect_callback(fde_t *fd, int status); |
| 61 |
> |
static void comm_connect_callback(fde_t *, int); |
| 62 |
|
static PF comm_connect_timeout; |
| 63 |
|
static void comm_connect_dns_callback(void *, const struct irc_ssaddr *, const char *); |
| 64 |
|
static PF comm_connect_tryconnect; |
| 213 |
|
* If the connection has been up for a long amount of time, schedule |
| 214 |
|
* a 'quick' reconnect, else reset the next-connect cycle. |
| 215 |
|
*/ |
| 216 |
< |
if ((conf = find_conf_exact(SERVER_TYPE, |
| 217 |
< |
client_p->name, client_p->username, |
| 218 |
< |
client_p->host))) |
| 216 |
> |
if ((conf = find_conf_exact(SERVER_TYPE, client_p->name, |
| 217 |
> |
client_p->username, client_p->host))) |
| 218 |
|
{ |
| 219 |
|
/* |
| 220 |
|
* Reschedule a faster reconnect, if this was a automatically |
| 222 |
|
* a rehash in between, the status has been changed to |
| 223 |
|
* CONF_ILLEGAL). But only do this if it was a "good" link. |
| 224 |
|
*/ |
| 225 |
< |
aconf = (struct AccessItem *)map_to_conf(conf); |
| 226 |
< |
aclass = (struct ClassItem *)map_to_conf(aconf->class_ptr); |
| 225 |
> |
aconf = map_to_conf(conf); |
| 226 |
> |
aclass = map_to_conf(aconf->class_ptr); |
| 227 |
|
aconf->hold = time(NULL); |
| 228 |
|
aconf->hold += (aconf->hold - client_p->since > HANGONGOODLINK) ? |
| 229 |
|
HANGONRETRYDELAY : ConFreq(aclass); |
| 231 |
– |
if (nextconnect > aconf->hold) |
| 232 |
– |
nextconnect = aconf->hold; |
| 230 |
|
} |
| 231 |
|
} |
| 232 |
|
else if (IsClient(client_p)) |
| 324 |
|
memcpy(&new_client->localClient->ip, irn, sizeof(struct irc_ssaddr)); |
| 325 |
|
|
| 326 |
|
irc_getnameinfo((struct sockaddr*)&new_client->localClient->ip, |
| 327 |
< |
new_client->localClient->ip.ss_len, new_client->sockhost, |
| 328 |
< |
HOSTIPLEN, NULL, 0, NI_NUMERICHOST); |
| 327 |
> |
new_client->localClient->ip.ss_len, new_client->sockhost, |
| 328 |
> |
sizeof(new_client->sockhost), NULL, 0, NI_NUMERICHOST); |
| 329 |
|
new_client->localClient->aftype = new_client->localClient->ip.ss.ss_family; |
| 330 |
|
#ifdef IPV6 |
| 331 |
|
if (new_client->sockhost[0] == ':') |
| 734 |
|
* reserved fd limit, but we can deal with that when comm_open() |
| 735 |
|
* also does it. XXX -- adrian |
| 736 |
|
*/ |
| 737 |
< |
newfd = accept(lptr->fd.fd, (struct sockaddr *)pn, (socklen_t *)&addrlen); |
| 737 |
> |
newfd = accept(lptr->fd.fd, (struct sockaddr *)pn, &addrlen); |
| 738 |
|
if (newfd < 0) |
| 739 |
|
return -1; |
| 740 |
|
|