Changeset 34498


Ignore:
Timestamp:
2020-10-20T11:17:11+13:00 (3 years ago)
Author:
kjdon
Message:

small mods to prevent warnings when calling start_yaz without a url (as happens in url_information)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/downloaders/Z3950Download.pm

    r28250 r34498  
    11###########################################################################
    22#
    3 # WebDownload.pm -- base class for all the import plugins
     3# Z3950Download.pm -- downloading class for z3950 protocol
    44# A component of the Greenstone digital library software
    55# from the New Zealand Digital Library Project at the
     
    142142sub start_yaz
    143143{
    144     my ($self, $url) = @_;   
    145 
    146     print STDERR "Opening connection to $url\n";
    147      
     144    my ($self, $url) = @_;
     145   
    148146    my $yaz = $self->{'yaz'};
    149147   
     
    154152    $self->{'YAZIN'} = *YAZIN;
    155153
    156     my $strOpen = $self->open_connection("open $url"); 
    157 
    158     if (!$strOpen) {
    159         print STDERR "Cannot connect to $url\n";
    160         print STDERR "<<Finished>>\n"; 
    161     return 0;
    162     }
    163     return $strOpen;
     154    if (defined $url) {
     155        print STDERR "Opening connection to $url\n";
     156    my $strOpen = $self->open_connection("open $url"); 
     157
     158    if (!$strOpen) {
     159        print STDERR "Cannot connect to $url\n";
     160        print STDERR "<<Finished>>\n"; 
     161        return 0;
     162    }
     163   
     164    return $strOpen;
     165    }
     166    return 1;
    164167}
    165168
     
    389392   $url = $self->{'url'} unless defined $url;
    390393
    391    my $strOpen = $self->start_yaz();
    392 
    393    $strOpen = $self->run_command_with_output("open $url","^Options"); 
     394   #my $strOpen = $self->start_yaz();
     395   $self->start_yaz();
     396
     397   my $strOpen = $self->run_command_with_output("open $url","^Options"); 
    394398
    395399   $strOpen =~ s/Z> //g;
Note: See TracChangeset for help on using the changeset viewer.