mirror of
https://github.com/adulau/ssldump.git
synced 2024-12-22 07:55:57 +00:00
Fix inactive connection removal
This commit is contained in:
parent
05fe4a619c
commit
d5dc74824d
1 changed files with 3 additions and 2 deletions
|
@ -161,6 +161,7 @@ int tcp_destroy_conn(conn)
|
|||
free_tcp_segment_queue(conn->i2r.oo_queue);
|
||||
free_tcp_segment_queue(conn->r2i.oo_queue);
|
||||
zero_conn(conn);
|
||||
free(conn->backptr);
|
||||
free(conn);
|
||||
|
||||
return(0);
|
||||
|
@ -176,11 +177,11 @@ int clean_old_conn() {
|
|||
return 0; // Still processing first block of packets
|
||||
|
||||
for(conn=first_conn;conn;conn=conn->next) {
|
||||
i++;
|
||||
tcpconn = &conn->conn;
|
||||
timestamp_diff(&last_packet_seen_time, &tcpconn->last_seen_time, &dt);
|
||||
if(dt.tv_sec > conn_ttl) {
|
||||
tcp_destroy_conn(&(first_conn->conn));
|
||||
i++;
|
||||
tcp_destroy_conn(tcpconn);
|
||||
}
|
||||
}
|
||||
return i;
|
||||
|
|
Loading…
Reference in a new issue