summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 098d3be)
raw | patch | inline | side by side (parent: 098d3be)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Wed, 14 Feb 2007 10:11:07 +0000 (10:11 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Wed, 14 Feb 2007 10:11:07 +0000 (10:11 +0000) |
to make it more standards compliant
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1620 f882894a-f735-0410-b71e-b25c423dba1c
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1620 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_tcp.c | patch | blob | history | |
plugins/t/check_tcp.t | patch | blob | history |
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 1c9a07b759fb5dca783233e0f1dc3a600dfcc11e..57e1f0df0306a7d704f602e8f70a262a114d943b 100644 (file)
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
printf (_(UT_IPv46));
printf (" %s\n", "-E, --escape");
- printf (" %s\n", _("Can use \\n, \\r, \\t or \\ in send or quit string."));
+ printf (" %s\n", _("Can use \\n, \\r, \\t or \\ in send or quit string. Must come before send or quit option"));
printf (" %s\n", _("Default: nothing added to send, \\r\\n added to end of quit"));
printf (" %s\n", "-s, --send=STRING");
printf (" %s\n", _("String to send to the server"));
diff --git a/plugins/t/check_tcp.t b/plugins/t/check_tcp.t
index 67e527a0f78a6c7f1440d9f46df862020fac5f9c..c38fca7ff515317c202818bf6c158a38a16c818f 100644 (file)
--- a/plugins/t/check_tcp.t
+++ b/plugins/t/check_tcp.t
$t += checkCmd( "./check_tcp $host_tcp_http -p 81 -wt 0 -ct 0 -to 1", 2 ); # use invalid port for this test
$t += checkCmd( "./check_tcp $host_nonresponsive -p 80 -wt 0 -ct 0 -to 1", 2 );
$t += checkCmd( "./check_tcp $hostname_invalid -p 80 -wt 0 -ct 0 -to 1", 2 );
-$t += checkCmd( "./check_tcp $host_tcp_http -p 80 -s 'GET /\n' -e 'ThisShouldntMatch' -j", 1, $failedExpect );
+
+# Need the \r\n to make it more standards compliant with web servers. Need the various quotes
+# so that perl doesn't interpret the \r\n and is passed onto command line correctly
+$t += checkCmd( "./check_tcp $host_tcp_http -p 80 -E -s ".'"GET /\r\n\r\n"'." -e 'ThisShouldntMatch' -j", 1, $failedExpect );
exit(0) if defined($Test::Harness::VERSION);
exit($tests - $t);