Parcourir la source

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 il y a 12 ans
Parent
commit
cfb50add53
1 fichiers modifiés avec 1 ajouts et 4 suppressions
  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;
 		}