0

rcon: Wait for buffer to fill

We should wait for the buffer to fill up to 12 bytes instead of
simply assuming it will.

Possible fix for #1273.
This commit is contained in:
Nicolas F
2016-01-30 13:58:36 +01:00
parent a0766974b5
commit c7f8cfee8c

View File

@@ -68,7 +68,8 @@ class RConConnection():
if not toread:
raise RConException(self.rid, "Request timed out.")
res_len, res_id, res_type = struct.unpack("<iii", self.sock.recv(12))
res_len, res_id, res_type = \
struct.unpack("<iii", self.sock.recv(12, socket.MSG_WAITALL))
res_data = self.sock.recv(res_len - 4 - 4)
res_data = res_data[:-2]