-/*\r
- * flood_recalc\r
- *\r
- * recalculate the number of allowed flood lines. this should be called\r
- * once a second on any given client. We then attempt to flush some data.\r
- */\r
-void\r
-flood_recalc(void *unused)\r
-{\r
- rb_dlink_node *ptr, *next;\r
- struct Client *client_p;\r
-\r
- RB_DLINK_FOREACH_SAFE(ptr, next, lclient_list.head)\r
- {\r
- client_p = ptr->data;\r
-\r
- if(unlikely(IsMe(client_p)))\r
- continue;\r
- \r
- if(unlikely(client_p->localClient == NULL))\r
- continue;\r
- \r
- if(IsFloodDone(client_p))\r
- client_p->localClient->sent_parsed -= 2;\r
- else\r
- client_p->localClient->sent_parsed = 0;\r
- \r
- if(client_p->localClient->sent_parsed < 0)\r
- client_p->localClient->sent_parsed = 0;\r
-\r
- if(--client_p->localClient->actually_read < 0)\r
- client_p->localClient->actually_read = 0;\r
-\r
- parse_client_queued(client_p);\r
- \r
- if(unlikely(IsAnyDead(client_p)))\r
- continue;\r
-\r
- }\r
-\r
- RB_DLINK_FOREACH_SAFE(ptr, next, unknown_list.head)\r
- {\r
- client_p = ptr->data;\r
-\r
- if(client_p->localClient == NULL)\r
- continue;\r
-\r
- client_p->localClient->sent_parsed--;\r
-\r
- if(client_p->localClient->sent_parsed < 0)\r
- client_p->localClient->sent_parsed = 0;\r
-\r
- if(--client_p->localClient->actually_read < 0)\r
- client_p->localClient->actually_read = 0;\r
-\r
- parse_client_queued(client_p);\r
- }\r
-}
-