فهرست منبع

Partial revert "fix check_http - was having constant socket timeouts"

This partially reverts changes applied by commit 2b38350d546ef9632ccd90e300eeaf6eda0ca32c

The mechanism brokes if there are CRs or LFs following the chunk header
Alessandro Cortiana 8 سال پیش
والد
کامیت
fc1bf94655
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 4 2
      plugins/check_http.c

+ 4 - 2
plugins/check_http.c

@@ -703,8 +703,10 @@ int chunk_header(char **buf)
         ++*buf;
 
     // soak up the leading CRLF
-    while (**buf != '\0' && (**buf == '\r' || **buf == '\n'))
-        ++*buf;
+    if (**buf && **buf == '\r' && *(++*buf) && **buf == '\n')
+      ++*buf;
+    else
+      die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse chunked body, invalid format\n"));
 
     return lth;
 }