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" |
200 |
|
|
201 |
|
assert(NULL != client_p); |
202 |
|
|
203 |
+ |
if (!IsDead(client_p)) |
204 |
+ |
{ |
205 |
+ |
/* attempt to flush any pending dbufs. Evil, but .. -- adrian */ |
206 |
+ |
/* there is still a chance that we might send data to this socket |
207 |
+ |
* even if it is marked as blocked (COMM_SELECT_READ handler is called |
208 |
+ |
* before COMM_SELECT_WRITE). Let's try, nothing to lose.. -adx |
209 |
+ |
*/ |
210 |
+ |
ClearSendqBlocked(client_p); |
211 |
+ |
send_queued_write(client_p); |
212 |
+ |
} |
213 |
+ |
|
214 |
|
if (IsServer(client_p)) |
215 |
|
{ |
216 |
< |
ServerStats->is_sv++; |
217 |
< |
ServerStats->is_sbs += client_p->localClient->send.bytes; |
218 |
< |
ServerStats->is_sbr += client_p->localClient->recv.bytes; |
219 |
< |
ServerStats->is_sti += CurrentTime - client_p->firsttime; |
216 |
> |
++ServerStats.is_sv; |
217 |
> |
ServerStats.is_sbs += client_p->localClient->send.bytes; |
218 |
> |
ServerStats.is_sbr += client_p->localClient->recv.bytes; |
219 |
> |
ServerStats.is_sti += CurrentTime - client_p->firsttime; |
220 |
|
|
221 |
|
/* XXX Does this even make any sense at all anymore? |
222 |
|
* scheduling a 'quick' reconnect could cause a pile of |
247 |
|
} |
248 |
|
else if (IsClient(client_p)) |
249 |
|
{ |
250 |
< |
ServerStats->is_cl++; |
251 |
< |
ServerStats->is_cbs += client_p->localClient->send.bytes; |
252 |
< |
ServerStats->is_cbr += client_p->localClient->recv.bytes; |
253 |
< |
ServerStats->is_cti += CurrentTime - client_p->firsttime; |
250 |
> |
++ServerStats.is_cl; |
251 |
> |
ServerStats.is_cbs += client_p->localClient->send.bytes; |
252 |
> |
ServerStats.is_cbr += client_p->localClient->recv.bytes; |
253 |
> |
ServerStats.is_cti += CurrentTime - client_p->firsttime; |
254 |
|
} |
255 |
|
else |
256 |
< |
ServerStats->is_ni++; |
247 |
< |
|
248 |
< |
if (!IsDead(client_p)) |
249 |
< |
{ |
250 |
< |
/* attempt to flush any pending dbufs. Evil, but .. -- adrian */ |
251 |
< |
/* there is still a chance that we might send data to this socket |
252 |
< |
* even if it is marked as blocked (COMM_SELECT_READ handler is called |
253 |
< |
* before COMM_SELECT_WRITE). Let's try, nothing to lose.. -adx |
254 |
< |
*/ |
255 |
< |
ClearSendqBlocked(client_p); |
256 |
< |
send_queued_write(client_p); |
257 |
< |
} |
256 |
> |
++ServerStats.is_ni; |
257 |
|
|
258 |
|
#ifdef HAVE_LIBCRYPTO |
259 |
|
if (client_p->localClient->fd.ssl) |
549 |
|
fd->dns_query = MyMalloc(sizeof(struct DNSQuery)); |
550 |
|
fd->dns_query->ptr = fd; |
551 |
|
fd->dns_query->callback = comm_connect_dns_callback; |
552 |
< |
gethost_byname(host, fd->dns_query); |
552 |
> |
if (aftype == AF_INET6) |
553 |
> |
gethost_byname_type(host, fd->dns_query, T_AAAA); |
554 |
> |
else |
555 |
> |
gethost_byname_type(host, fd->dns_query, T_A); |
556 |
|
} |
557 |
|
else |
558 |
|
{ |