diff --git a/haproxy/haproxy.py b/haproxy/haproxy.py index 1703418..e9aaeac 100644 --- a/haproxy/haproxy.py +++ b/haproxy/haproxy.py @@ -41,8 +41,11 @@ def execute(self, command, timeout=200): for s in r: if (s is client): - buffer = buffer + client.recv(16384) - running = (len(buffer)==0) + tmp = client.recv(16384) + buffer = buffer + tmp + if tmp == '': + running = (len(buffer)==0) + client.close()