From 578dec468963d6123c24ab2da44d42df111f74d9 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 21 Nov 2012 23:52:00 +0000 Subject: Make the banner-reading optional - for services that don't need it. --- lib/custodian/protocoltest/tcp.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/custodian/protocoltest/tcp.rb b/lib/custodian/protocoltest/tcp.rb index 9806565..24389fe 100644 --- a/lib/custodian/protocoltest/tcp.rb +++ b/lib/custodian/protocoltest/tcp.rb @@ -129,7 +129,7 @@ class TCPTest < ProtocolTest # send the string "quit". # # - def run_test_internal( host, port, banner = nil ) + def run_test_internal( host, port, banner = nil, do_read = true ) begin timeout(30) do begin @@ -137,7 +137,8 @@ class TCPTest < ProtocolTest socket.puts( "QUIT") # read a banner from the remote server - read = socket.gets(nil) + read = nil + read = socket.gets(nil) if ( do_read ) # trim to a sane length & strip newlines. read = read[0,255] unless ( read.nil? ) -- cgit v1.2.1