Преглед изворни кода

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 година
родитељ
комит
cfb50add53
1 измењених фајлова са 1 додато и 4 уклоњено
  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);
 			memcpy(&status[len], buffer, i);
 			len += 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)
 			if (maxbytes && len >= maxbytes)
 				break;
 				break;
 		}
 		}