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:
@@ -68,7 +68,8 @@ class RConConnection():
|
|||||||
if not toread:
|
if not toread:
|
||||||
raise RConException(self.rid, "Request timed out.")
|
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 = self.sock.recv(res_len - 4 - 4)
|
||||||
res_data = res_data[:-2]
|
res_data = res_data[:-2]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user