[Pkg-nagios-changes] [pkg-nagios-plugins] 155/413: add support for virtual servers

Jan Wagner waja at moszumanska.debian.org
Tue Nov 26 23:13:17 UTC 2013


This is an automated email from the git hooks/post-receive script.

waja pushed a commit to branch master
in repository pkg-nagios-plugins.

commit ae251d3e02823395b5457574781ea95f492d71ed
Author: Jan Wagner <waja at cyconet.org>
Date:   Sat Aug 23 14:20:27 2008 +0000

    add support for virtual servers
---
 debian/changelog                                   |  2 ++
 .../patches/41_check_http_fix_http_header.dpatch   | 33 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 8970726..2d1eec8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ nagios-plugins (1.4.12-3) UNRELEASED; urgency=low
   * rename 40_check_http_status_line.patch to 40_check_http_status_line.dpatch
     and make it able to apply
   * add 40_check_http_status_line.dpatch to 00list to really fix #486932
+  * add 41_check_http_fix_http_header.dpatch to support virtual servers
+    (Closes: #494835)
 
  -- Jan Wagner <waja at cyconet.org>  Fri, 04 Jul 2008 17:04:02 +0200
 
diff --git a/debian/patches/41_check_http_fix_http_header.dpatch b/debian/patches/41_check_http_fix_http_header.dpatch
new file mode 100755
index 0000000..5cacd50
--- /dev/null
+++ b/debian/patches/41_check_http_fix_http_header.dpatch
@@ -0,0 +1,33 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 41_check_http_fix_http_header.dpatch by Jan Wagner <waja at cyconet.org>, taken
+## from upstream svn
+##
+## DP: Re-structure the HTTP 1.1 headers to prevent 301s on servers with virtual hosts
+
+ at DPATCH@
+diff -urNad nagios-plugins-1.4.12~/plugins/check_http.c nagios-plugins-1.4.12/plugins/check_http.c
+--- nagios-plugins-1.4.12~/plugins/check_http.c	2008-08-23 15:41:49.000000000 +0200
++++ nagios-plugins-1.4.12/plugins/check_http.c	2008-08-23 15:50:14.000000000 +0200
+@@ -749,15 +749,17 @@
+   }
+ #endif /* HAVE_SSL */
+ 
+-  asprintf (&buf, "%s %s HTTP/1.0\r\n%s\r\n", http_method, server_url, user_agent);
++  /* If a hostname is provided, use HTTP/1.1 and send the hostname before the
++  *  Useragent. This fixes an issue with getting 301 responses from servers
++  *  with virtual hosts */
++  if (host_name)
++    asprintf (&buf, "%s %s HTTP/1.1\r\nHost: %s\r\n%s\r\n", http_method, server_url, host_name, user_agent);
++  else
++    asprintf (&buf, "%s %s HTTP/1.0\r\n%s\r\n", http_method, server_url, user_agent);
+ 
+   /* tell HTTP/1.1 servers not to keep the connection alive */
+   asprintf (&buf, "%sConnection: close\r\n", buf);
+ 
+-  /* optionally send the host header info */
+-  if (host_name)
+-    asprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, server_port);
+-
+   /* optionally send any other header tag */
+   if (http_opt_headers_count) {
+     for (i = 0; i < http_opt_headers_count ; i++) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagios-plugins.git



More information about the Pkg-nagios-changes mailing list