Skip to content

Commit 77566ad

Browse files
committed
Add docstring
1 parent 00250a4 commit 77566ad

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scapy/sessions.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ def on_packet_received(self, pkt):
8484

8585

8686
class StringBuffer(object):
87+
"""StringBuffer is an object used to re-order data received during
88+
a TCP transmission.
89+
90+
Each TCP fragment contains a sequence number, which marks
91+
(relatively to the first sequence number) the index of the data contained
92+
in the fragment.
93+
94+
If a TCP fragment is missed, this class will fill the missing space with
95+
zeros.
96+
"""
8797
def __init__(self):
8898
self.content = bytearray(b"")
8999
self.content_len = 0
@@ -135,7 +145,7 @@ def tcp_reassemble(cls, data, metadata):
135145
# metadata = empty dictionary, that can be used to store data
136146
[...]
137147
# If the packet is available, return it. Otherwise don't.
138-
# Whenever you return a packet, the buffer will be discarder.
148+
# Whenever you return a packet, the buffer will be discarded.
139149
return pkt
140150
# Otherwise, maybe store stuff in metadata, and return None,
141151
# as you need additional data.

0 commit comments

Comments
 (0)