Ignore:
Timestamp:
2017-08-07T19:09:21+12:00 (7 years ago)
Author:
ak19
Message:

If the proxy settings are wrong or set when not needed, pressing the Server Information button would take forever (freeze GLI GUI), and the wget that java launched through perl would also take forever, blocking. The wget will have to be terminated from Task Manager. To overcome issues of network settings misconfigurations, which Dr Bainbridge said are hard to detect, setting the number of tries on pressing the Server Info button to 2. The number of tries for pressing the Download button were already 2, so this just makes the two wget commands issued more similar (but the wget launched by the Download button now uses the --tries=2 rather than the shorthand -t 2 too, so that the code reads better). Setting the number of wget retries launched by the Server Info Dialog also ensures wget is eventually terminated, as happens when both tries fail. Some more informative messages are now displayed if the server is unavaiable, depending on whether proxying is on or not.

File:
1 edited

Legend:

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

    r31853 r31856  
    115115    }
    116116    #my $cmdWget = "-N -k -x -t 2 -P \"".$hashGeneralOptions->{"cache_dir"}."\" $strWgetOptions $strOptions ".$self->{'url'};
    117     my $cmdWget = "-N -k -x -t 2  $strWgetOptions $strOptions $cache_dir " .$self->{'url'};   
     117    my $cmdWget = "-N -k -x --tries=2 $strWgetOptions $strOptions $cache_dir " .$self->{'url'};
    118118
    119119    #print STDOUT "\n@@@@ RUNNING WGET CMD: $cmdWget\n\n";
     
    188188    my $strOptions = $self->getWgetOptions();
    189189
    190     my $strBaseCMD = $strOptions." -q -O - \"$self->{'url'}\"";
     190    my $strBaseCMD = $strOptions." --tries=2 -q -O - \"$self->{'url'}\"";
    191191
    192192 
     
    194194   
    195195    if (!defined $strIdentifyText or $strIdentifyText eq ""  ){
    196     print STDERR "Server information is unavailable.\n";
    197     print STDERR "<<Finished>>\n";
     196        print STDERR "Server information is unavailable.\n";           
     197        if ($self->{'proxy_on'} && $self->{'proxy_host'} && $self->{'proxy_port'}) { # if proxying set, the settings may be wrong
     198            print STDERR "Current proxy settings are:\n";
     199            print STDERR "- host=$self->{'proxy_host'}\n";
     200            print STDERR "- port=$self->{'proxy_port'}\n";
     201        } else { # else no proxy set, the user may need proxy settings
     202            prin STDERR "The external server might not be responding, or you might need to switch on proxy settings.\n";
     203        }
     204        print STDERR "<<Finished>>\n";
    198205         return; 
    199206    }
Note: See TracChangeset for help on using the changeset viewer.