diff options
author | Daniel Stenberg <daniel@haxx.se> | 2010-08-25 00:56:14 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-08-25 14:22:43 +0200 |
commit | 2fbbddbe855d551a5acb5d9c514efba18c924c6e (patch) | |
tree | dbcf5f66bf352472abf2351aff49a9dee91593af | |
parent | ecb3fe63d782dafcd6bacf834f964414b087a793 (diff) |
gopher tests: revert parts of gopher in the pingpong server
Introduced in the initial gopher commits, there was added logic to do
GOPHER test serving in the pingpong server but as it resembles HTTP much
more than FTP or SMTP, the gopher testing has been moved over to instead
use the sws (HTTP) server. This change simply removes unused code.
-rw-r--r-- | tests/ftp.pm | 2 | ||||
-rwxr-xr-x | tests/ftpserver.pl | 44 | ||||
-rw-r--r-- | tests/serverhelp.pm | 7 |
3 files changed, 8 insertions, 45 deletions
diff --git a/tests/ftp.pm b/tests/ftp.pm index 535075ac5..6a46e7651 100644 --- a/tests/ftp.pm +++ b/tests/ftp.pm @@ -181,7 +181,7 @@ sub killsockfilters { my $pidfile; my $pid; - return if($proto !~ /^(ftp|imap|pop3|smtp|gopher)$/); + return if($proto !~ /^(ftp|imap|pop3|smtp)$/); die "unsupported sockfilter: $which" if($which && ($which !~ /^(main|data)$/)); diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 03d93341c..ed2a83268 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -29,9 +29,6 @@ # protocol per invoke. You need to start mulitple servers to support multiple # protocols simultaneously. # -# The gopher protocol test server also lives here, borrowing some of the -# routines. -# # It is meant to exercise curl, it is not meant to be a fully working # or even very standard compliant server. # @@ -344,7 +341,6 @@ sub senddata { # for the given protocol. References to protocol command callbacks are # stored in 'commandfunc' hash, and text which will be returned to the # client before the command callback runs is stored in 'displaytext'. -# Gopher is not handled here, however (it has a separate routine). # sub protocolsetup { my $proto = $_[0]; @@ -1298,7 +1294,7 @@ while(@ARGV) { } } elsif($ARGV[0] eq '--proto') { - if($ARGV[1] && ($ARGV[1] =~ /^(ftp|imap|pop3|smtp|gopher)$/)) { + if($ARGV[1] && ($ARGV[1] =~ /^(ftp|imap|pop3|smtp)$/)) { $proto = $1; shift @ARGV; } @@ -1425,7 +1421,7 @@ while(1) { &customize(); # read test control instructions - sendcontrol @welcome unless ($proto eq 'gopher'); + sendcontrol @welcome; #remove global variables from last connection if($ftplistparserstate) { @@ -1478,39 +1474,7 @@ while(1) { my $FTPCMD; my $FTPARG; my $full=$_; - - if($proto eq 'gopher') { - # Gopher protocol support lives right here and we handle it - # right here and now, since there will only ever be one selector - # and no other commands. - - my $sel = $_; - my $query = ''; - my @response = (); - ($sel, $query) = split(/\x09/, $_) if (/\x09/); - - if($sel eq 'erifiedserver') { - # NOT verifiedserver, the first character is the item type in - # a Gopher URL! - push(@response, "iWE ROOLZ: $$\x09\x09error.host\x091\r\n"); - } - if (length($query)) { # fake Veronica, gin up search results - push(@response, "iSearch results\x09\x09error.host\x091\r\n"); - push(@response, - "0Query $query\x09/foo\x09foo.bar.invalid\x0970\r\n"); - } else { # fake selector, gin up a menu - push(@response, "iMenu results\x09\x09error.host\x091\r\n"); - } - push(@response, - "0Selector $sel\x09/bar\x09bar.foo.invalid\x0970\r\n"); - push(@response, ".\r\n"); - sendcontrol @response; - - # disconnect the client now, no command. - $FTPCMD = $FTPARG = ''; - print SFWRITE "DISC\n"; - } - elsif($proto eq "imap") { + if($proto eq "imap") { # IMAP is different with its identifier first on the command line unless (m/^([^ ]+) ([^ ]+) (.*)/ || m/^([^ ]+) ([^ ]+)/) { @@ -1586,7 +1550,7 @@ while(1) { } } - if($check && $proto ne 'gopher') { + if($check) { logmsg "$FTPCMD wasn't handled!\n"; sendcontrol "500 $FTPCMD is not dealt with!\r\n"; } diff --git a/tests/serverhelp.pm b/tests/serverhelp.pm index 8429b405a..34b155d0e 100644 --- a/tests/serverhelp.pm +++ b/tests/serverhelp.pm @@ -148,8 +148,7 @@ sub server_pidfilename { sub server_logfilename { my ($logdir, $proto, $ipver, $idnum) = @_; my $trailer = '_server.log'; - $trailer = '_stunnel.log' if(lc($proto) =~ /^(ftp|http|imap|pop3|smtp)s$/|| - lc($proto) eq 'gopher'); + $trailer = '_stunnel.log' if(lc($proto) =~ /^(ftp|http|imap|pop3|smtp)s$/); return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer"; } @@ -190,7 +189,7 @@ sub server_outputfilename { sub mainsockf_pidfilename { my ($proto, $ipver, $idnum) = @_; die "unsupported protocol: $proto" unless($proto && - ((lc($proto) =~ /^(ftp|imap|pop3|smtp)s?$/) || lc($proto) eq 'gopher')); + (lc($proto) =~ /^(ftp|imap|pop3|smtp)s?$/)); my $trailer = (lc($proto) =~ /^ftps?$/) ? '_sockctrl.pid':'_sockfilt.pid'; return '.'. servername_canon($proto, $ipver, $idnum) ."$trailer"; } @@ -202,7 +201,7 @@ sub mainsockf_pidfilename { sub mainsockf_logfilename { my ($logdir, $proto, $ipver, $idnum) = @_; die "unsupported protocol: $proto" unless($proto && - ((lc($proto) =~ /^(ftp|imap|pop3|smtp)s?$/) || lc($proto) eq 'gopher')); + (lc($proto) =~ /^(ftp|imap|pop3|smtp)s?$/)); my $trailer = (lc($proto) =~ /^ftps?$/) ? '_sockctrl.log':'_sockfilt.log'; return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer"; } |