Skip to content

Commit

Permalink
debugging stuff for dpkt's failure to parse horserace-waterfront.pcap…
Browse files Browse the repository at this point in the history
… as http
  • Loading branch information
Andrew Fleenor committed Aug 23, 2010
1 parent 5fe2d84 commit 6745810
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion http.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def gather_messages(MessageClass, tcpdir):
messages = [] # [MessageClass]
pointer = 0
while pointer < len(tcpdir.data):
curr_data = tcpdir.data[pointer:pointer+200]
msg = MessageClass(tcpdir, pointer)
messages.append(msg)
pointer += msg.data_consumed
Expand All @@ -131,7 +132,8 @@ def parse_streams(request_stream, response_stream):
try:
requests = gather_messages(Request, request_stream)
responses = gather_messages(Response, response_stream)
except dpkt.UnpackError:
except dpkt.UnpackError as e:
print 'failed to parse http: ', e
return False, None, None
else:
return True, requests, responses

0 comments on commit 6745810

Please sign in to comment.