* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
- * $Id: packet.c 262 2005-09-22 00:38:45Z jilles $
+ * $Id: packet.c 3446 2007-05-14 22:21:16Z jilles $
*/
#include "stdinc.h"
-#include "tools.h"
-#include "commio.h"
#include "s_conf.h"
#include "s_serv.h"
#include "client.h"
#include "parse.h"
#include "packet.h"
#include "irc_string.h"
-#include "memory.h"
#include "hook.h"
#include "send.h"
if(IsUnknown(client_p))
{
- int i = 0;
-
for (;;)
{
- /* rate unknown clients at MAX_FLOOD per loop */
- if(i >= MAX_FLOOD)
+ if(client_p->localClient->sent_parsed >= client_p->localClient->allow_read)
break;
dolen = linebuf_get(&client_p->localClient->
break;
client_dopacket(client_p, readBuf, dolen);
- i++;
+ client_p->localClient->sent_parsed++;
/* He's dead cap'n */
if(IsAnyDead(client_p))
* to the parsing for their appropriate status. --fl
*/
if(!IsUnknown(client_p))
+ {
+ /* reset their flood limits, they're now
+ * graced to flood
+ */
+ client_p->localClient->sent_parsed = 0;
break;
+ }
}
}
return;
/* and finally, reset the flood check */
- comm_setflush(fd, 1000, flood_recalc, client_p);
+ rb_setflush(fd, 1000, flood_recalc, client_p);
}
/*
nodata:
/* If we get here, we need to register for another COMM_SELECT_READ */
- comm_setselect(fd, FDLIST_SERVER, COMM_SELECT_READ, read_ctrl_packet, server, 0);
+ rb_setselect(fd, FDLIST_SERVER, COMM_SELECT_READ, read_ctrl_packet, server, 0);
}
/*
* I personally think it makes the code too hairy to make sane.
* -- adrian
*/
- length = read(client_p->localClient->fd, readBuf, READBUF_SIZE);
+ length = client_p->localClient->F->read_impl(client_p->localClient->F, readBuf, READBUF_SIZE);
if(length <= 0)
{
if((length == -1) && ignoreErrno(errno))
{
- comm_setselect(client_p->localClient->fd, FDLIST_IDLECLIENT,
+ rb_setselect(client_p->localClient->F->fd, FDLIST_IDLECLIENT,
COMM_SELECT_READ, read_packet, client_p, 0);
return;
}
/* If we get here, we need to register for another COMM_SELECT_READ */
if(PARSE_AS_SERVER(client_p))
{
- comm_setselect(client_p->localClient->fd, FDLIST_SERVER, COMM_SELECT_READ,
+ rb_setselect(client_p->localClient->F->fd, FDLIST_SERVER, COMM_SELECT_READ,
read_packet, client_p, 0);
}
else
{
- comm_setselect(client_p->localClient->fd, FDLIST_IDLECLIENT,
+ rb_setselect(client_p->localClient->F->fd, FDLIST_IDLECLIENT,
COMM_SELECT_READ, read_packet, client_p, 0);
}
}