summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dbaa9dd)
raw | patch | inline | side by side (parent: dbaa9dd)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Thu, 17 Oct 2002 06:09:06 +0000 (06:09 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Thu, 17 Oct 2002 06:09:06 +0000 (06:09 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@135 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_tcp.c | patch | blob | history |
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index c537729f0764da8261a3c23f4318f4a5123ae562..140915abe98732e88b6326c094253cf808439202 100644 (file)
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
if (server_send || server_expect_count > 0) {
+ asprintf (&status, "");
+
/* watch for the expect string */
#ifdef HAVE_SSL
if (use_ssl && SSL_read (ssl, buffer, MAX_INPUT_BUFFER - 1)>=0)
- status = strscat(status,buffer);
+ asprintf (&status, "%s%s", status, buffer);
else
#endif
{
if (recv (sd, buffer, MAX_INPUT_BUFFER - 1, 0) >= 0)
- status = strscat (status, buffer);
+ asprintf (&status, "%s%s", status, buffer);
}
strip (status);
if (server_expect_count > 0) {
for (i = 0;; i++) {
- printf ("%d %d\n", i, server_expect_count);
+ if (verbose)
+ printf ("%d %d\n", i, server_expect_count);
if (i >= server_expect_count)
terminate (STATE_WARNING, "Invalid response from host\n");
if (strstr (status, server_expect[i]))
case 's':
server_send = optarg;
break;
- case 'e':
+ case 'e': /* expect string (may be repeated) */
EXPECT = NULL;
if (server_expect_count == 0)
server_expect = malloc (++server_expect_count);