summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c53487d)
raw | patch | inline | side by side (parent: c53487d)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Mon, 27 Jan 2003 06:04:03 +0000 (06:04 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Mon, 27 Jan 2003 06:04:03 +0000 (06:04 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@253 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_http.c | patch | blob | history |
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 2259c6ff88ec241c0c1195f4d22d2fe713df1e2b..5da5750a7dc1e8bf5ea4d1e3914610cee5d30b04 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
}
}
- /* optionally send http POST data */
+ /* either send http POST data */
if (http_post_data) {
asprintf (&buf, "Content-Type: application/x-www-form-urlencoded\r\n");
if (SSL_write (ssl, buf, strlen (buf)) == -1) {
return STATE_CRITICAL;
}
}
-
- /* send a newline so the server knows we're done with the request */
- asprintf (&buf, "\r\n\r\n");
- if (SSL_write (ssl, buf, strlen (buf)) == -1) {
- ERR_print_errors_fp (stderr);
- return STATE_CRITICAL;
+ else {
+ /* or just a newline so the server knows we're done with the request */
+ asprintf (&buf, "\r\n");
+ if (SSL_write (ssl, buf, strlen (buf)) == -1) {
+ ERR_print_errors_fp (stderr);
+ return STATE_CRITICAL;
+ }
}
}
send (sd, buf, strlen (buf), 0);
}
- /* optionally send http POST data */
+ /* either send http POST data */
/* written by Chris Henesy <lurker@shadowtech.org> */
if (http_post_data) {
asprintf (&buf, "Content-Type: application/x-www-form-urlencoded\r\n");
http_post_data = strscat (http_post_data, "\r\n");
send (sd, http_post_data, strlen (http_post_data), 0);
}
-
- /* send a newline so the server knows we're done with the request */
- asprintf (&buf, "\r\n");
- send (sd, buf, strlen (buf), 0);
+ else {
+ /* send a newline so the server knows we're done with the request */
+ asprintf (&buf, "\r\n");
+ send (sd, buf, strlen (buf), 0);
+ }
#ifdef HAVE_SSL
}
#endif