Skip to content

Commit b222aa6

Browse files
authored
update
The problem is when we open a file and start reading from it, the position of file dose not get reset until I close it. So we have to open can close the file multiple time or we have to move to beginning of the file as we are passing the file to multiple functions
1 parent 24f9797 commit b222aa6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

chapter04/find_ddos.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,10 @@ def find_attack(pcap):
9292
with open(pcap_file, 'rb') as file:
9393
_pcap = dpkt.pcap.Reader(file)
9494
find_download(_pcap)
95+
with open(pcap_file, 'rb') as file:
96+
_pcap = dpkt.pcap.Reader(file)
9597
find_hivemind(_pcap)
98+
99+
with open(pcap_file, 'rb') as file:
100+
_pcap = dpkt.pcap.Reader(file)
96101
find_attack(_pcap)

0 commit comments

Comments
 (0)