From 2286428ab898b5ab9f3495373e4b20db48024ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=BE=D0=BB=D1=8F=D1=80=D0=BE=D0=B2=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Tue, 16 May 2017 11:07:53 +0500 Subject: [PATCH] fixed: dont read socket to the bottom if it contains lot of data --- haproxy/haproxy.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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()