-
- # FIXME: this would catch the init command flood
- #if connection_id in potential_flooders:
- # if int(time.time() * 100) == potential_flooders[connection_id]:
- # continue
- #potential_flooders[connection_id] = int(time.time() * 100)
-
+ now = int(time.time() * 10)
+ if connection_id in potential_flooders and \
+ potential_flooders[connection_id][0] == now:
+ if potential_flooders[connection_id][1] > 10:
+ continue
+ potential_flooders[connection_id][1] += 1
+ else:
+ potential_flooders[connection_id] = [now, 1]