Просмотр исходного кода

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 лет назад
Родитель
Сommit
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);
 			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;
 		}