Fix errors in line buffer code
This commit is contained in:
parent
36a3127ce6
commit
581b456651
1 changed files with 3 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import socket
|
||||||
|
|
||||||
class BufferOverflow(Exception):
|
class BufferOverflow(Exception):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Buffer overflow")
|
super().__init__("Buffer overflow")
|
||||||
|
@ -17,7 +19,7 @@ class LineBuffer():
|
||||||
# Check and see if there is already a line in the
|
# Check and see if there is already a line in the
|
||||||
# internal buffer.
|
# internal buffer.
|
||||||
#
|
#
|
||||||
offset = self.buf.find(b'\n', self.offset, self.count)
|
offset = self.buf.find(b'\n', self.offset, len(self.buf))
|
||||||
|
|
||||||
if offset < 0:
|
if offset < 0:
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Reference in a new issue