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! diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index ce966c3..b024821 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 v0.10-9-g596f