From: Mike Taylor Date: Wed, 8 Aug 2007 12:09:19 +0000 (+0000) Subject: Set global handle before calling start_server() X-Git-Tag: CPAN.1.12~87 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=6e84dcd4f3447ece4375eb1bf5200a771b8ff6c8;p=simpleserver-moved-to-github.git Set global handle before calling start_server() --- diff --git a/SimpleServer.pm b/SimpleServer.pm index 0abbb92..e3ee48e 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.33 2007-08-08 12:09:19 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}); }