ソースを参照

Fixed check_http not timing-out on redirects

Thomas Guyot-Sionnest thomas@aei.ca 17 年 前
コミット
3dd27fb063
2 ファイル変更4 行追加3 行削除
  1. 1 0
      NEWS
  2. 3 3
      plugins/check_http.c

+ 1 - 0
NEWS

@@ -24,6 +24,7 @@ This file documents the major additions and syntax changes between releases.
 	Fixed coredump from check_nt when invalid drive is specified (#2179754 - Olli Hauer)
 	Fixed passing of quotes in OID for check_snmp (#1985230 - Jan Wagner, patch by John Barbuto)
 	Fixed check_http sending HTTP/1.0 with v1.1 headers (#2638765)
+	Fixed check_http not timing-out on redirects
 
 1.4.13 25th Sept 2008
 	Fix Debian bug #460097: check_http --max-age broken (Hilko Bengen)

+ 3 - 3
plugins/check_http.c

@@ -894,9 +894,6 @@ check_http (void)
 #endif
   if (sd) close(sd);
 
-  /* reset the alarm */
-  alarm (0);
-
   /* Save check time */
   microsec = deltime (tv);
   elapsed_time = (double)microsec / 1.0e6;
@@ -999,6 +996,9 @@ check_http (void)
 
   } /* end else (server_expect_yn)  */
 
+  /* reset the alarm - must be called *after* redir or we'll never die on redirects! */
+  alarm (0);
+
   if (maximum_age >= 0) {
     result = max_state_alt(check_document_dates(header, &msg), result);
   }