From cfb50add532c1b5c80ea8214340b0a908a7fab65 Mon Sep 17 00:00:00 2001 From: juliopedreira Date: Tue, 10 Sep 2013 10:11:12 +0200 Subject: check_tcp: Don't close connection too early Closing the connection because the bytes received are less than the buffer size assumes that all the bytes will be received in one go. This is not always true! --- plugins/check_tcp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index ce966c38..b024821e 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c @@ -277,10 +277,7 @@ main (int argc, char **argv) memcpy(&status[len], buffer, i); len += i; - /* stop reading if user-forced or data-starved */ - if(i < sizeof(buffer) || (maxbytes && len >= maxbytes)) - break; - + /* stop reading if user-forced */ if (maxbytes && len >= maxbytes) break; } -- cgit v1.2.3-74-g34f1