You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/11/26 18:56:31 UTC
[lucy-commits] svn commit: r1206521 -
/incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchServer.pm
Author: marvin
Date: Sat Nov 26 17:56:30 2011
New Revision: 1206521
URL: http://svn.apache.org/viewvc?rev=1206521&view=rev
Log:
Make password optional in SearchServer.
Modified:
incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchServer.pm
Modified: incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchServer.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchServer.pm?rev=1206521&r1=1206520&r2=1206521&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchServer.pm (original)
+++ incubator/lucy/trunk/perl/lib/LucyX/Remote/SearchServer.pm Sat Nov 26 17:56:30 2011
@@ -137,7 +137,15 @@ sub serve {
sub do_handshake {
my ( $self, $args ) = @_;
- return { retval => $password{$$self} eq $args->{password} };
+ my $retval = 1;
+ if ( defined $password{$$self} ) {
+ if ( !defined $args->{password}
+ || $password{$$self} ne $args->{password} )
+ {
+ $retval = 0;
+ }
+ }
+ return { retval => $retval };
}
sub do_terminate {
@@ -188,8 +196,7 @@ LucyX::Remote::SearchServer - Make a Sea
);
my $search_server = LucyX::Remote::SearchServer->new(
searcher => $searcher,
- port => 7890,
- password => $pass,
+ port => 7890,
);
$search_server->serve;
@@ -210,8 +217,8 @@ across multiple nodes, each with its own
my $search_server = LucyX::Remote::SearchServer->new(
searcher => $searcher, # required
- port => 7890, # required
- password => $pass, # required
+ port => 7890, # required
+ password => $pass, # optional
);
Constructor. Takes hash-style parameters.
@@ -229,7 +236,8 @@ B<port> - the port on localhost that the
=item *
-B<password> - a password which must be supplied by clients.
+B<password> - an optional password which, if supplied, must also be supplied
+by clients.
=back