summaryrefslogtreecommitdiff
path: root/src/common/socket.c
diff options
context:
space:
mode:
authorshennetsind <notind@gmail.com>2013-06-08 13:15:28 -0700
committershennetsind <notind@gmail.com>2013-06-08 13:15:28 -0700
commit13f5061b2640f017028c0d6f9ea0b657631b46c3 (patch)
tree0304d4af4a803632f2fb9a8aa32455af49882375 /src/common/socket.c
parent6d042dcbb41cc278f14706e7306412642ea90d3a (diff)
parentd73783f22b2bb881aab74524d153d89a5932a199 (diff)
downloadhercules-13f5061b2640f017028c0d6f9ea0b657631b46c3.tar.gz
hercules-13f5061b2640f017028c0d6f9ea0b657631b46c3.tar.bz2
hercules-13f5061b2640f017028c0d6f9ea0b657631b46c3.tar.xz
hercules-13f5061b2640f017028c0d6f9ea0b657631b46c3.zip
Merge pull request #39 from Earisu/master
Help with renewal phase one and HPM system
Diffstat (limited to 'src/common/socket.c')
-rw-r--r--src/common/socket.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index 0459004cc..15b20b16f 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -947,9 +947,9 @@ static int connect_check_(uint32 ip)
if( hist->ddos )
{// flagged as DDoS
return (connect_ok == 2 ? 1 : 0);
- } else if( DIFF_TICK(gettick(),hist->tick) < ddos_interval )
+ } else if( DIFF_TICK(iTimer->gettick(),hist->tick) < ddos_interval )
{// connection within ddos_interval
- hist->tick = gettick();
+ hist->tick = iTimer->gettick();
if( hist->count++ >= ddos_count )
{// DDoS attack detected
hist->ddos = 1;
@@ -959,7 +959,7 @@ static int connect_check_(uint32 ip)
return connect_ok;
} else
{// not within ddos_interval, clear data
- hist->tick = gettick();
+ hist->tick = iTimer->gettick();
hist->count = 0;
return connect_ok;
}
@@ -970,7 +970,7 @@ static int connect_check_(uint32 ip)
CREATE(hist, ConnectHistory, 1);
memset(hist, 0, sizeof(ConnectHistory));
hist->ip = ip;
- hist->tick = gettick();
+ hist->tick = iTimer->gettick();
hist->next = connect_history[ip&0xFFFF];
connect_history[ip&0xFFFF] = hist;
return connect_ok;
@@ -1331,8 +1331,8 @@ void socket_init(void)
#ifndef MINICORE
// Delete old connection history every 5 minutes
memset(connect_history, 0, sizeof(connect_history));
- add_timer_func_list(connect_check_clear, "connect_check_clear");
- add_timer_interval(gettick()+1000, connect_check_clear, 0, 0, 5*60*1000);
+ iTimer->add_timer_func_list(connect_check_clear, "connect_check_clear");
+ iTimer->add_timer_interval(iTimer->gettick()+1000, connect_check_clear, 0, 0, 5*60*1000);
#endif
ShowInfo("Server supports up to '"CL_WHITE"%u"CL_RESET"' concurrent connections.\n", rlim_cur);