Skip to content

Commit

Permalink
[FIX] tcp: close pcap files
Browse files Browse the repository at this point in the history
  • Loading branch information
qdeconinck committed Apr 18, 2016
1 parent 25e8c40 commit 0041e69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 """
Expand Down

0 comments on commit 0041e69

Please sign in to comment.