From 0041e69eac9d532e5c06bdee3db4b6d3e3a546c5 Mon Sep 17 00:00:00 2001 From: Quentin De Coninck Date: Mon, 18 Apr 2016 09:52:40 +0200 Subject: [PATCH] [FIX] tcp: close pcap files --- tcp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tcp.py b/tcp.py index 417a8df..7fdc643 100644 --- a/tcp.py +++ b/tcp.py @@ -864,6 +864,8 @@ def compute_tcp_acks_retrans(pcap_filepath, connections, inverse_conns, ts_syn_t except dpkt.NeedData as e: print(e, ": trying to continue...", file=sys.stderr) + finally: + pcap_file.close() return nb_acks @@ -1074,6 +1076,8 @@ def compute_mptcp_dss_retransmissions(pcap_filepath, mptcp_connections, fast_con # print(saddr, sport, daddr, dport, "haven't seen beginning...") continue + pcap_file.close() + def process_trace(pcap_filepath, graph_dir_exp, stat_dir_exp, failed_conns_dir_exp, acksize_tcp_dir_exp, tcpcsm, mptcp_connections=None, print_out=sys.stdout, light=False, return_dict=False): """ Process a tcp pcap file and generate stats of its connections """