124 |
|
{ |
125 |
|
int dolen = 0; |
126 |
|
int checkflood = 1; |
127 |
< |
struct Connection *lclient_p = client_p->localClient; |
127 |
> |
struct Connection *lclient_p = client_p->connection; |
128 |
|
|
129 |
|
if (IsUnknown(client_p)) |
130 |
|
{ |
231 |
|
SetFloodDone(client_p); |
232 |
|
|
233 |
|
/* Drop their flood limit back down */ |
234 |
< |
client_p->localClient->allow_read = MAX_FLOOD; |
234 |
> |
client_p->connection->allow_read = MAX_FLOOD; |
235 |
|
|
236 |
|
/* sent_parsed could be way over MAX_FLOOD but under MAX_FLOOD_BURST, |
237 |
|
* so reset it. |
238 |
|
*/ |
239 |
< |
client_p->localClient->sent_parsed = 0; |
239 |
> |
client_p->connection->sent_parsed = 0; |
240 |
|
} |
241 |
|
|
242 |
|
/* |
249 |
|
flood_recalc(fde_t *fd, void *data) |
250 |
|
{ |
251 |
|
struct Client *client_p = data; |
252 |
< |
struct Connection *lclient_p = client_p->localClient; |
252 |
> |
struct Connection *lclient_p = client_p->connection; |
253 |
|
|
254 |
|
/* allow a bursting client their allocation per second, allow |
255 |
|
* a client whos flooding an extra 2 per second |
333 |
|
return; |
334 |
|
} |
335 |
|
|
336 |
< |
dbuf_put(&client_p->localClient->buf_recvq, readBuf, length); |
336 |
> |
dbuf_put(&client_p->connection->buf_recvq, readBuf, length); |
337 |
|
|
338 |
< |
if (client_p->localClient->lasttime < CurrentTime) |
339 |
< |
client_p->localClient->lasttime = CurrentTime; |
340 |
< |
if (client_p->localClient->lasttime > client_p->localClient->since) |
341 |
< |
client_p->localClient->since = CurrentTime; |
338 |
> |
if (client_p->connection->lasttime < CurrentTime) |
339 |
> |
client_p->connection->lasttime = CurrentTime; |
340 |
> |
if (client_p->connection->lasttime > client_p->connection->since) |
341 |
> |
client_p->connection->since = CurrentTime; |
342 |
|
|
343 |
|
ClearPingSent(client_p); |
344 |
|
|
350 |
|
|
351 |
|
/* Check to make sure we're not flooding */ |
352 |
|
if (!(IsServer(client_p) || IsHandshake(client_p) || IsConnecting(client_p)) |
353 |
< |
&& (dbuf_length(&client_p->localClient->buf_recvq) > |
354 |
< |
get_recvq(&client_p->localClient->confs))) |
353 |
> |
&& (dbuf_length(&client_p->connection->buf_recvq) > |
354 |
> |
get_recvq(&client_p->connection->confs))) |
355 |
|
{ |
356 |
|
if (!(ConfigGeneral.no_oper_flood && HasUMode(client_p, UMODE_OPER))) |
357 |
|
{ |
388 |
|
/* |
389 |
|
* Update messages received |
390 |
|
*/ |
391 |
< |
++me.localClient->recv.messages; |
392 |
< |
++client_p->localClient->recv.messages; |
391 |
> |
++me.connection->recv.messages; |
392 |
> |
++client_p->connection->recv.messages; |
393 |
|
|
394 |
|
/* |
395 |
|
* Update bytes received |
396 |
|
*/ |
397 |
< |
client_p->localClient->recv.bytes += length; |
398 |
< |
me.localClient->recv.bytes += length; |
397 |
> |
client_p->connection->recv.bytes += length; |
398 |
> |
me.connection->recv.bytes += length; |
399 |
|
|
400 |
|
parse(client_p, buffer, buffer + length); |
401 |
|
} |