mirror of
https://github.com/adulau/ssldump.git
synced 2024-11-07 12:06:27 +00:00
commit
2c7500b968
1 changed files with 6 additions and 3 deletions
|
@ -161,6 +161,7 @@ int tcp_destroy_conn(conn)
|
||||||
free_tcp_segment_queue(conn->i2r.oo_queue);
|
free_tcp_segment_queue(conn->i2r.oo_queue);
|
||||||
free_tcp_segment_queue(conn->r2i.oo_queue);
|
free_tcp_segment_queue(conn->r2i.oo_queue);
|
||||||
zero_conn(conn);
|
zero_conn(conn);
|
||||||
|
free(conn->backptr);
|
||||||
free(conn);
|
free(conn);
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
@ -175,12 +176,14 @@ int clean_old_conn() {
|
||||||
if(!last_packet_seen_time.tv_sec)
|
if(!last_packet_seen_time.tv_sec)
|
||||||
return 0; // Still processing first block of packets
|
return 0; // Still processing first block of packets
|
||||||
|
|
||||||
for(conn=first_conn;conn;conn=conn->next) {
|
conn = first_conn;
|
||||||
i++;
|
while(conn) {
|
||||||
tcpconn = &conn->conn;
|
tcpconn = &conn->conn;
|
||||||
|
conn=conn->next;
|
||||||
timestamp_diff(&last_packet_seen_time, &tcpconn->last_seen_time, &dt);
|
timestamp_diff(&last_packet_seen_time, &tcpconn->last_seen_time, &dt);
|
||||||
if(dt.tv_sec > conn_ttl) {
|
if(dt.tv_sec > conn_ttl) {
|
||||||
tcp_destroy_conn(&(first_conn->conn));
|
i++;
|
||||||
|
tcp_destroy_conn(tcpconn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
|
|
Loading…
Reference in a new issue