49 |
|
#include "s_conf.h" |
50 |
|
#include "s_log.h" |
51 |
|
#include "s_serv.h" |
52 |
– |
#include "s_stats.h" |
52 |
|
#include "send.h" |
53 |
|
#include "memory.h" |
54 |
|
#include "s_user.h" |
65 |
|
static void comm_connect_dns_callback(void *vptr, struct DNSReply *reply); |
66 |
|
static PF comm_connect_tryconnect; |
67 |
|
|
69 |
– |
extern void init_netio(void); |
68 |
|
|
69 |
|
/* check_can_use_v6() |
70 |
|
* Check if the system can open AF_INET6 sockets |
212 |
|
|
213 |
|
if (IsServer(client_p)) |
214 |
|
{ |
215 |
< |
ServerStats->is_sv++; |
216 |
< |
ServerStats->is_sbs += client_p->localClient->send.bytes; |
217 |
< |
ServerStats->is_sbr += client_p->localClient->recv.bytes; |
218 |
< |
ServerStats->is_sti += CurrentTime - client_p->firsttime; |
215 |
> |
++ServerStats.is_sv; |
216 |
> |
ServerStats.is_sbs += client_p->localClient->send.bytes; |
217 |
> |
ServerStats.is_sbr += client_p->localClient->recv.bytes; |
218 |
> |
ServerStats.is_sti += CurrentTime - client_p->firsttime; |
219 |
|
|
220 |
|
/* XXX Does this even make any sense at all anymore? |
221 |
|
* scheduling a 'quick' reconnect could cause a pile of |
246 |
|
} |
247 |
|
else if (IsClient(client_p)) |
248 |
|
{ |
249 |
< |
ServerStats->is_cl++; |
250 |
< |
ServerStats->is_cbs += client_p->localClient->send.bytes; |
251 |
< |
ServerStats->is_cbr += client_p->localClient->recv.bytes; |
252 |
< |
ServerStats->is_cti += CurrentTime - client_p->firsttime; |
249 |
> |
++ServerStats.is_cl; |
250 |
> |
ServerStats.is_cbs += client_p->localClient->send.bytes; |
251 |
> |
ServerStats.is_cbr += client_p->localClient->recv.bytes; |
252 |
> |
ServerStats.is_cti += CurrentTime - client_p->firsttime; |
253 |
|
} |
254 |
|
else |
255 |
< |
ServerStats->is_ni++; |
255 |
> |
++ServerStats.is_ni; |
256 |
|
|
257 |
|
#ifdef HAVE_LIBCRYPTO |
258 |
|
if (client_p->localClient->fd.ssl) |
356 |
|
#endif |
357 |
|
strlcat(new_client->host, new_client->sockhost,HOSTLEN+1); |
358 |
|
|
361 |
– |
new_client->connect_id = ++connect_id; |
359 |
|
new_client->localClient->listener = listener; |
360 |
|
++listener->ref_count; |
361 |
|
|
547 |
|
fd->dns_query = MyMalloc(sizeof(struct DNSQuery)); |
548 |
|
fd->dns_query->ptr = fd; |
549 |
|
fd->dns_query->callback = comm_connect_dns_callback; |
550 |
< |
gethost_byname(host, fd->dns_query); |
550 |
> |
if (aftype == AF_INET6) |
551 |
> |
gethost_byname_type(host, fd->dns_query, T_AAAA); |
552 |
> |
else |
553 |
> |
gethost_byname_type(host, fd->dns_query, T_A); |
554 |
|
} |
555 |
|
else |
556 |
|
{ |