aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2003-01-27 06:04:03 +0000
committerGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2003-01-27 06:04:03 +0000
commita305b2be1d979a6ba8b548e12b9e2aa40cf4c306 (patch)
tree1d1800957da2651c564bc29a01c8d65209492fef
parentc53487d26c5b14017aeec3d8af280c7f046c3514 (diff)
downloadmonitoring-plugins-a305b2be1d979a6ba8b548e12b9e2aa40cf4c306.tar.gz
we were sending extra CRLF
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@253 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins/check_http.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 2259c6ff..5da5750a 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -597,7 +597,7 @@ check_http (void)
}
}
- /* 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) {
@@ -615,12 +615,13 @@ check_http (void)
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;
+ }
}
}
@@ -652,7 +653,7 @@ check_http (void)
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");
@@ -662,10 +663,11 @@ check_http (void)
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