From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/450271-check_http.c.patch | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 web/attachments/450271-check_http.c.patch (limited to 'web/attachments/450271-check_http.c.patch') diff --git a/web/attachments/450271-check_http.c.patch b/web/attachments/450271-check_http.c.patch new file mode 100644 index 0000000..aa0fd6d --- /dev/null +++ b/web/attachments/450271-check_http.c.patch @@ -0,0 +1,48 @@ +--- check_http.c.orig 2010-07-27 16:47:16.000000000 -0400 ++++ check_http.c 2011-04-05 12:02:56.000000000 -0400 +@@ -94,6 +94,7 @@ + char server_type[6] = "http"; + char *server_address; + char *host_name; ++char *host_header; + char *server_url; + char *user_agent; + int server_url_length; +@@ -346,6 +347,13 @@ + case 'u': /* URL path */ + server_url = strdup (optarg); + server_url_length = strlen (server_url); ++ // Also set HTTP host header ++ char delim[] = "/"; ++ if (!strncmp(optarg, "http://", 7) ) { ++ host_header=strdup(strtok(optarg+7, delim)); ++ } else if (!strncmp(optarg, "https://", 8) ) { ++ host_header=strdup(strtok(optarg+8, delim)); ++ } + break; + case 'p': /* Server port */ + if (!is_intnonneg (optarg)) +@@ -823,7 +831,10 @@ + asprintf (&buf, "%sConnection: close\r\n", buf); + + /* optionally send the host header info */ +- if (host_name) { ++ if (!host_header) { ++ host_header=strdup(host_name); ++ } ++ if (host_header) { + /* + * Specify the port only if we're using a non-default port (see RFC 2616, + * 14.23). Some server applications/configurations cause trouble if the +@@ -831,9 +842,9 @@ + */ + if ((use_ssl == FALSE && server_port == HTTP_PORT) || + (use_ssl == TRUE && server_port == HTTPS_PORT)) +- asprintf (&buf, "%sHost: %s\r\n", buf, host_name); ++ asprintf (&buf, "%sHost: %s\r\n", buf, host_header); + else +- asprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, server_port); ++ asprintf (&buf, "%sHost: %s:%d\r\n", buf, host_header, server_port); + } + + /* optionally send any other header tag */ -- cgit v1.2.3-74-g34f1