X-Git-Url: http://git.indexdata.com/?p=simpleserver-moved-to-github.git;a=blobdiff_plain;f=SimpleServer.pm;h=f6a4c399b84b02263b068638fb756ea986cb4d5c;hp=0abbb92dcf6a4c5ae60d1d1aa1a87e9054921c17;hb=eb69046dd58ade30eada3a5ec5f2d4c05fb3b9b5;hpb=c987ce263013255ff651b58eb78b63200feb31c1 diff --git a/SimpleServer.pm b/SimpleServer.pm index 0abbb92..f6a4c39 100644 --- a/SimpleServer.pm +++ b/SimpleServer.pm @@ -25,7 +25,7 @@ ## ## -## $Id: SimpleServer.pm,v 1.32 2007-08-08 10:27:43 mike Exp $ +## $Id: SimpleServer.pm,v 1.35 2007-08-15 13:21:22 mike Exp $ package Net::Z3950::SimpleServer; @@ -69,6 +69,13 @@ sub launch_server { my $self = shift; my @args = @_; + ### This modal internal interface, in which we set a bunch of + # globals and then call start_server(), is asking for + # trouble. Instead, we should just pass the $self object + # as a parameter into start_server(). + if (defined($self->{GHANDLE})) { + set_ghandle($self->{GHANDLE}); + } if (defined($self->{INIT})) { set_init_handler($self->{INIT}); } @@ -589,8 +596,10 @@ an index of a book, you always find something! The parameters exchanged are $args = { ## Client request - GHANDLE => $obj ## Global handler specified at creation - HANDLE => $ref ## Reference to data structure + GHANDLE => $obj, ## Global handler specified at creation + HANDLE => $ref, ## Reference to data structure + DATABASES => ["xxx"], ## Reference to a list of data- + ## bases to search TERM => 'start', ## The start term NUMBER => xx, ## Number of requested terms POS => yy, ## Position of starting point @@ -624,10 +633,11 @@ should point at a data structure of this kind, ... ]; -The $status flag should be assigned one of two values: +The $status flag is only meaningful after a successful scan, and +should be assigned one of two values: - Net::Z3950::SimpleServer::ScanSuccess On success (default) - Net::Z3950::SimpleServer::ScanPartial Less terms returned than requested + Net::Z3950::SimpleServer::ScanSuccess Full success (default) + Net::Z3950::SimpleServer::ScanPartial Fewer terms returned than requested The STEP member contains the requested number of entries in the term-list between two adjacent entries in the response.