summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d77b785)
raw | patch | inline | side by side (parent: d77b785)
author | Holger Weiss <hweiss@users.sourceforge.net> | |
Sat, 21 Jul 2007 16:29:01 +0000 (16:29 +0000) | ||
committer | Holger Weiss <hweiss@users.sourceforge.net> | |
Sat, 21 Jul 2007 16:29:01 +0000 (16:29 +0000) |
servers to close the connection after completion of the response. This
should be compatible with HTTP/1.0, as HTTP/1.0 allows for custom header
fields which should be ignored if not recognized by the server. With
some server configurations, the server would keep the connection alive
without this header line (despite the plugin requesting HTTP/1.0),
resulting in the plugin running into either the server's or it's own
timeout (reported by Roman Schliessmeyer and Jesse Morgan via IRC).
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1759 f882894a-f735-0410-b71e-b25c423dba1c
should be compatible with HTTP/1.0, as HTTP/1.0 allows for custom header
fields which should be ignored if not recognized by the server. With
some server configurations, the server would keep the connection alive
without this header line (despite the plugin requesting HTTP/1.0),
resulting in the plugin running into either the server's or it's own
timeout (reported by Roman Schliessmeyer and Jesse Morgan via IRC).
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1759 f882894a-f735-0410-b71e-b25c423dba1c
NEWS | patch | blob | history | |
plugins/check_http.c | patch | blob | history |
index 79c427235e9095e465baf4974d411bf64155a5a3..ff9a5eefbc4a6d3a4eb97915a7796f0e4fb59d15 100644 (file)
--- a/NEWS
+++ b/NEWS
1.4.10 or 1.5 ??
Fix check_http buffer overflow vulnerability when following HTTP redirects
+ check_http now explicitly asks HTTP/1.1 servers to close the connection
+ after completion of the response
Check_ldaps' guessing which secure method to use (starttls vs. ssl on connect)
is now deprecated. See --help for further information.
Check_disk now calls stat() on all filesystems to check. (Old: only the ones selected using -p)
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 26a074df1f9f2de9401f94466a882d50c4b24520..b371cd6413267e6ccc556386869afe67390e8934 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
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\r\n", buf, host_name);