[Pkg-nagios-changes] [pkg-nagios] r1557 - in nagios-plugins/trunk/debian: . patches

Jan Wagner waja-guest at alioth.debian.org
Sat Aug 23 14:20:28 UTC 2008


tags 494835 pending
thanks

Author: waja-guest
Date: 2008-08-23 14:20:27 +0000 (Sat, 23 Aug 2008)
New Revision: 1557

Added:
   nagios-plugins/trunk/debian/patches/41_check_http_fix_http_header.dpatch
Modified:
   nagios-plugins/trunk/debian/changelog
Log:
add support for virtual servers

Modified: nagios-plugins/trunk/debian/changelog
===================================================================
--- nagios-plugins/trunk/debian/changelog	2008-08-23 13:41:17 UTC (rev 1556)
+++ nagios-plugins/trunk/debian/changelog	2008-08-23 14:20:27 UTC (rev 1557)
@@ -3,6 +3,8 @@
   * 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
 

Added: nagios-plugins/trunk/debian/patches/41_check_http_fix_http_header.dpatch
===================================================================
--- nagios-plugins/trunk/debian/patches/41_check_http_fix_http_header.dpatch	                        (rev 0)
+++ nagios-plugins/trunk/debian/patches/41_check_http_fix_http_header.dpatch	2008-08-23 14:20:27 UTC (rev 1557)
@@ -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++) {


Property changes on: nagios-plugins/trunk/debian/patches/41_check_http_fix_http_header.dpatch
___________________________________________________________________
Name: svn:executable
   + *




More information about the Pkg-nagios-changes mailing list