mirror of
https://github.com/adulau/ssldump.git
synced 2024-12-22 16:05:58 +00:00
Initialize initial reference timeval
Avoids wrong cleaning of first connection(s)
This commit is contained in:
parent
3ca46766e4
commit
05fe4a619c
2 changed files with 5 additions and 2 deletions
|
@ -91,8 +91,8 @@ int packet_cnt = 0; // Packet counter used for connection pool cleaning
|
|||
int conn_freq = 100; // Number of packets after which a connection pool
|
||||
// cleaning is performed
|
||||
int conn_ttl = 100; // TTL of inactive connections in connection pool
|
||||
struct timeval last_packet_seen_time; // Timestamp of the last packet of the
|
||||
// last block of conn_freq packets seen
|
||||
struct timeval last_packet_seen_time = // Timestamp of the last packet of the
|
||||
(struct timeval) {0}; // last block of conn_freq packets seen
|
||||
|
||||
int err_exit(str,num)
|
||||
char *str;
|
||||
|
|
|
@ -172,6 +172,9 @@ int clean_old_conn() {
|
|||
struct timeval dt;
|
||||
int i = 0;
|
||||
|
||||
if(!last_packet_seen_time.tv_sec)
|
||||
return 0; // Still processing first block of packets
|
||||
|
||||
for(conn=first_conn;conn;conn=conn->next) {
|
||||
i++;
|
||||
tcpconn = &conn->conn;
|
||||
|
|
Loading…
Reference in a new issue