only count "\n"s (not "\r\n") that hit the wire, incase \r\n gets cut in half

This commit is contained in:
jesopo 2019-06-17 18:23:38 +01:00
parent 4bcc02f32d
commit 133ff1c0f6

View file

@ -146,7 +146,7 @@ class Socket(IRCObject.Object):
bytes_written_i = self._socket.send(self._write_buffer)
bytes_written = self._write_buffer[:bytes_written_i]
sent_lines_count = bytes_written.count(b"\r\n")
sent_lines_count = bytes_written.count(b"\n")
sent_lines = [] # type: typing.List[IRCLine.SentLine]
for i in range(sent_lines_count):
sent_lines.append(self._buffered_lines.pop(0))