22 |
|
* $Id$ |
23 |
|
*/ |
24 |
|
#include "stdinc.h" |
25 |
< |
#include "tools.h" |
25 |
> |
#include "list.h" |
26 |
|
#include "s_bsd.h" |
27 |
|
#include "s_conf.h" |
28 |
|
#include "s_serv.h" |
29 |
|
#include "client.h" |
30 |
|
#include "common.h" |
31 |
|
#include "ircd.h" |
32 |
– |
#include "list.h" |
32 |
|
#include "parse.h" |
33 |
|
#include "fdlist.h" |
34 |
|
#include "packet.h" |
36 |
|
#include "memory.h" |
37 |
|
#include "hook.h" |
38 |
|
#include "send.h" |
40 |
– |
#include "irc_getnameinfo.h" |
39 |
|
|
40 |
|
#define READBUF_SIZE 16384 |
41 |
|
|
164 |
|
client_dopacket(client_p, readBuf, dolen); |
165 |
|
} |
166 |
|
} |
167 |
< |
else if(IsClient(client_p)) |
167 |
> |
else if (IsClient(client_p)) |
168 |
|
{ |
169 |
|
if (ConfigFileEntry.no_oper_flood && (IsOper(client_p) || IsCanFlood(client_p))) |
170 |
|
{ |
388 |
|
} |
389 |
|
|
390 |
|
/* |
391 |
+ |
* iorecv_default - append a packet to the recvq dbuf |
392 |
+ |
*/ |
393 |
+ |
void * |
394 |
+ |
iorecv_default(va_list args) |
395 |
+ |
{ |
396 |
+ |
struct Client *client_p = va_arg(args, struct Client *); |
397 |
+ |
int length = va_arg(args, int); |
398 |
+ |
char *buf = va_arg(args, char *); |
399 |
+ |
|
400 |
+ |
dbuf_put(&client_p->localClient->buf_recvq, buf, length); |
401 |
+ |
return NULL; |
402 |
+ |
} |
403 |
+ |
|
404 |
+ |
/* |
405 |
|
* read_packet - Read a 'packet' of data from a connection and process it. |
406 |
|
*/ |
407 |
|
void |
438 |
|
errno = EWOULDBLOCK; |
439 |
|
case SSL_ERROR_SYSCALL: |
440 |
|
break; |
441 |
+ |
case SSL_ERROR_SSL: |
442 |
+ |
if (errno == EAGAIN) |
443 |
+ |
break; |
444 |
|
default: |
445 |
|
length = errno = 0; |
446 |
|
} |
449 |
|
#endif |
450 |
|
{ |
451 |
|
length = recv(fd->fd, readBuf, READBUF_SIZE, 0); |
437 |
– |
#ifdef _WIN32 |
438 |
– |
if (length < 0) |
439 |
– |
errno = WSAGetLastError(); |
440 |
– |
#endif |
452 |
|
} |
453 |
|
|
454 |
|
if (length <= 0) |
472 |
|
client_p->since = CurrentTime; |
473 |
|
ClearPingSent(client_p); |
474 |
|
|
464 |
– |
dbuf_put(&client_p->localClient->buf_recvq, readBuf, length); |
465 |
– |
|
475 |
|
/* Attempt to parse what we have */ |
476 |
|
parse_client_queued(client_p); |
477 |
|
|