Check throttle space when queueing more data not whether there's no queued data

This commit is contained in:
jesopo 2019-02-20 16:52:45 +00:00
parent 98215f66eb
commit e343bf3e6a

View file

@ -122,8 +122,8 @@ class Socket(IRCObject.Object):
def _send(self) -> typing.List[str]: def _send(self) -> typing.List[str]:
decoded_sent = [] decoded_sent = []
if not len(self._write_buffer): throttle_space = self.throttle_space()
throttle_space = self.throttle_space() if throttle_space:
to_buffer = self._queued_lines[:throttle_space] to_buffer = self._queued_lines[:throttle_space]
self._queued_lines = self._queued_lines[throttle_space:] self._queued_lines = self._queued_lines[throttle_space:]
for line in to_buffer: for line in to_buffer: