diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-07-03 12:47:38 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-07-03 12:47:38 +0200 |
commit | 430e8f73cfaa863cc7b49044a555fb8667f1fbb9 (patch) | |
tree | 93b5e5d3a5862e6c8f9ea5ddbc19fe90e12e07b7 /crafted-pkt/replay-chunks.py | |
parent | 039ac7638ede0097705b9819ebad7f8f1032ceb6 (diff) | |
download | wireshark-notes-430e8f73cfaa863cc7b49044a555fb8667f1fbb9.tar.gz |
replay-chunks.py: fix missing data
Not all bytes were captured, it turns out that data was never read (and
thus the send buffer becames full) which leads to data loss when the
connection is closed.
Diffstat (limited to 'crafted-pkt/replay-chunks.py')
-rwxr-xr-x | crafted-pkt/replay-chunks.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crafted-pkt/replay-chunks.py b/crafted-pkt/replay-chunks.py index b969b27..3b77612 100755 --- a/crafted-pkt/replay-chunks.py +++ b/crafted-pkt/replay-chunks.py @@ -52,8 +52,10 @@ class FollowParser(object): def add_data(self, data, is_reply): sock = self.sock_server if is_reply else self.sock_client + othersock = self.sock_client if is_reply else self.sock_server for i in range(0, len(data), self.chunk_size): - sock.send(data[i:i+self.chunk_size]) + sock.sendall(data[i:i+self.chunk_size]) + othersock.recv(self.chunk_size) print('{}: {}'.format('S->C' if is_reply else 'C->S', _dumpbytes(data))) def state_find_begin(self, line): |