Quellcode durchsuchen

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!
juliopedreira vor 12 Jahren
Ursprung
Commit
cfb50add53
1 geänderte Dateien mit 1 neuen und 4 gelöschten Zeilen
  1. 1 4
      plugins/check_tcp.c

+ 1 - 4
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;
 		}