summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--plugins/check_http.c16
2 files changed, 12 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 5ba4758..743857f 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,7 @@ This file documents the major additions and syntax changes between releases.
20 Re-bundled libtap as a built-in library (--enable-libtap): detects system library as pre-1.4.13 and does not install the built-in library anymore 20 Re-bundled libtap as a built-in library (--enable-libtap): detects system library as pre-1.4.13 and does not install the built-in library anymore
21 Fixed check_mrtg returning UNKNOWN instead of OK (bug #2378068) 21 Fixed check_mrtg returning UNKNOWN instead of OK (bug #2378068)
22 Fixed check_http behaviour: all check are now performed as long as a valid response is returned (sf.net #1460312) 22 Fixed check_http behaviour: all check are now performed as long as a valid response is returned (sf.net #1460312)
23 check_http --onredirect=sticky follows using the same IP address (sf.net #2550208).
23 24
241.4.13 25th Sept 2008 251.4.13 25th Sept 2008
25 Fix Debian bug #460097: check_http --max-age broken (Hilko Bengen) 26 Fix Debian bug #460097: check_http --max-age broken (Hilko Bengen)
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 933e9d4..620e157 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -106,6 +106,7 @@ int display_html = FALSE;
106char **http_opt_headers; 106char **http_opt_headers;
107int http_opt_headers_count = 0; 107int http_opt_headers_count = 0;
108int onredirect = STATE_OK; 108int onredirect = STATE_OK;
109int followsticky = 0;
109int use_ssl = FALSE; 110int use_ssl = FALSE;
110int verbose = FALSE; 111int verbose = FALSE;
111int sd; 112int sd;
@@ -299,8 +300,10 @@ process_arguments (int argc, char **argv)
299 server_port = HTTPS_PORT; 300 server_port = HTTPS_PORT;
300 break; 301 break;
301 case 'f': /* onredirect */ 302 case 'f': /* onredirect */
303 if (!strcmp (optarg, "sticky"))
304 onredirect = STATE_DEPENDENT, followsticky = 1;
302 if (!strcmp (optarg, "follow")) 305 if (!strcmp (optarg, "follow"))
303 onredirect = STATE_DEPENDENT; 306 onredirect = STATE_DEPENDENT, followsticky = 0;
304 if (!strcmp (optarg, "unknown")) 307 if (!strcmp (optarg, "unknown"))
305 onredirect = STATE_UNKNOWN; 308 onredirect = STATE_UNKNOWN;
306 if (!strcmp (optarg, "ok")) 309 if (!strcmp (optarg, "ok"))
@@ -1200,8 +1203,10 @@ redir (char *pos, char *status_line)
1200 free (host_name); 1203 free (host_name);
1201 host_name = strdup (addr); 1204 host_name = strdup (addr);
1202 1205
1203 free (server_address); 1206 if (followsticky == 0) {
1204 server_address = strdup (addr); 1207 free (server_address);
1208 server_address = strdup (addr);
1209 }
1205 1210
1206 free (server_url); 1211 free (server_url);
1207 server_url = url; 1212 server_url = url;
@@ -1338,8 +1343,9 @@ print_help (void)
1338 printf (" %s\n", _(" Any other tags to be sent in http header. Use multiple times for additional headers")); 1343 printf (" %s\n", _(" Any other tags to be sent in http header. Use multiple times for additional headers"));
1339 printf (" %s\n", "-L, --link"); 1344 printf (" %s\n", "-L, --link");
1340 printf (" %s\n", _("Wrap output in HTML link (obsoleted by urlize)")); 1345 printf (" %s\n", _("Wrap output in HTML link (obsoleted by urlize)"));
1341 printf (" %s\n", "-f, --onredirect=<ok|warning|critical|follow>"); 1346 printf (" %s\n", "-f, --onredirect=<ok|warning|critical|follow|sticky>");
1342 printf (" %s\n", _("How to handle redirected pages")); 1347 printf (" %s\n", _("How to handle redirected pages. sticky is like follow but stick to the"));
1348 printf (" %s\n", _("specified IP address"));
1343 printf (" %s\n", "-m, --pagesize=INTEGER<:INTEGER>"); 1349 printf (" %s\n", "-m, --pagesize=INTEGER<:INTEGER>");
1344 printf (" %s\n", _("Minimum page size required (bytes) : Maximum page size required (bytes)")); 1350 printf (" %s\n", _("Minimum page size required (bytes) : Maximum page size required (bytes)"));
1345 1351