Przeglądaj źródła

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 12 lat temu
rodzic
commit
cfb50add53
1 zmienionych plików z 1 dodań i 4 usunięć
  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;
 		}