* Don't allow more then 255 connects from one IP number, ever
*/
if (0 == ++entry->connected)
+ {
+ entry->connected--;
return 0;
+ }
if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_PERIOD)
entry->attempts = 0;
#ifdef NOTHROTTLE
return 1;
#else
+ assert(entry->connected > 0);
--entry->connected;
return 0;
#endif
{
struct IPRegistryEntry* entry = ip_registry_find(addr);
if (entry)
- --entry->attempts;
+ {
+ if (0 == --entry->attempts)
+ ++entry->attempts;
+ }
}
/*
/*
* If this was the last one, set `last_connect' to disconnect time (used for expiration)
*/
+ /* assert(entry->connected > 0); */
if (0 == --entry->connected) {
if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_LIMIT * IPCHECK_CLONE_PERIOD) {
/*