summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-01-27 06:04:03 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-01-27 06:04:03 (GMT)
commita305b2be1d979a6ba8b548e12b9e2aa40cf4c306 (patch)
tree1d1800957da2651c564bc29a01c8d65209492fef /plugins
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
Diffstat (limited to 'plugins')
-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 2259c6f..5da5750 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -597,7 +597,7 @@ check_http (void)
597 } 597 }
598 } 598 }
599 599
600 /* optionally send http POST data */ 600 /* either send http POST data */
601 if (http_post_data) { 601 if (http_post_data) {
602 asprintf (&buf, "Content-Type: application/x-www-form-urlencoded\r\n"); 602 asprintf (&buf, "Content-Type: application/x-www-form-urlencoded\r\n");
603 if (SSL_write (ssl, buf, strlen (buf)) == -1) { 603 if (SSL_write (ssl, buf, strlen (buf)) == -1) {
@@ -615,12 +615,13 @@ check_http (void)
615 return STATE_CRITICAL; 615 return STATE_CRITICAL;
616 } 616 }
617 } 617 }
618 618 else {
619 /* send a newline so the server knows we're done with the request */ 619 /* or just a newline so the server knows we're done with the request */
620 asprintf (&buf, "\r\n\r\n"); 620 asprintf (&buf, "\r\n");
621 if (SSL_write (ssl, buf, strlen (buf)) == -1) { 621 if (SSL_write (ssl, buf, strlen (buf)) == -1) {
622 ERR_print_errors_fp (stderr); 622 ERR_print_errors_fp (stderr);
623 return STATE_CRITICAL; 623 return STATE_CRITICAL;
624 }
624 } 625 }
625 626
626 } 627 }
@@ -652,7 +653,7 @@ check_http (void)
652 send (sd, buf, strlen (buf), 0); 653 send (sd, buf, strlen (buf), 0);
653 } 654 }
654 655
655 /* optionally send http POST data */ 656 /* either send http POST data */
656 /* written by Chris Henesy <lurker@shadowtech.org> */ 657 /* written by Chris Henesy <lurker@shadowtech.org> */
657 if (http_post_data) { 658 if (http_post_data) {
658 asprintf (&buf, "Content-Type: application/x-www-form-urlencoded\r\n"); 659 asprintf (&buf, "Content-Type: application/x-www-form-urlencoded\r\n");
@@ -662,10 +663,11 @@ check_http (void)
662 http_post_data = strscat (http_post_data, "\r\n"); 663 http_post_data = strscat (http_post_data, "\r\n");
663 send (sd, http_post_data, strlen (http_post_data), 0); 664 send (sd, http_post_data, strlen (http_post_data), 0);
664 } 665 }
665 666 else {
666 /* send a newline so the server knows we're done with the request */ 667 /* send a newline so the server knows we're done with the request */
667 asprintf (&buf, "\r\n"); 668 asprintf (&buf, "\r\n");
668 send (sd, buf, strlen (buf), 0); 669 send (sd, buf, strlen (buf), 0);
670 }
669#ifdef HAVE_SSL 671#ifdef HAVE_SSL
670 } 672 }
671#endif 673#endif