Changeset 31864
- Timestamp:
- 2017-08-09T20:24:33+12:00 (6 years ago)
- Location:
- main/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/gui/DownloadPane.java
r31860 r31864 766 766 767 767 if(user_pass.indexOf("@") != -1) { 768 769 // Write the use proxy command - we don't do this anymore, instead we set environment variables - hopefully these can't be spied on like the following can (using ps) - actually the environment stuff didn't work for windows, so lets go back to this 770 if (Utility.isWindows()) { 771 768 772 769 arg.setValue("true"); // proxy_on argument 773 770 arg.setAssigned(true); … … 780 777 arg.setValue(proxy_port); 781 778 arg.setAssigned(true); 779 780 781 // Write the use proxy command - we don't do this anymore, instead we set environment variables - hopefully these can't be spied on like the following can (using ps) - actually the environment stuff didn't work for windows, so lets go back to this 782 if (Utility.isWindows()) { 782 783 783 784 arg = current_download.getArgument("user_name"); … … 799 800 } 800 801 else{ 802 // unset proxy_on argument 803 arg = current_download.getArgument("proxy_on"); 804 arg.setValue("false"); 805 arg.setAssigned(false); 801 806 return false; 802 807 } 803 808 809 } else { 810 // unset proxy_on argument 811 arg = current_download.getArgument("proxy_on"); 812 arg.setValue("false"); 813 arg.setAssigned(false); 804 814 } 805 815 … … 830 840 String str_url = ""; 831 841 if( arg_url!= null && arg_url.isAssigned()) { 832 str_url = arg_url.getValue(); 842 str_url = arg_url.getValue(); 843 /* 844 String redirected_url = getRedirectURL(str_url); // work out the real URL 845 if(!str_url.equals(redirected_url)) { 846 arg_url.setValue(redirected_url); 847 } 848 */ 833 849 } 834 850 … … 842 858 no_check_cert_arg.setAssigned(false); // only assigned Arguments have values 843 859 } 844 845 846 //str_url = getRedirectURL(str_url); // work out the real URL847 860 848 861 server_info = new ServerInfoDialog(str_url ,proxy_url, mode,(Download)download_map.get(mode)); -
main/trunk/greenstone2/perllib/downloaders/WebDownload.pm
r31861 r31864 40 40 use strict; # every perl program should have this! 41 41 no strict 'refs'; # make an exception so we can use variables as filehandles 42 no strict 'subs'; 42 no strict 'subs'; # to pass STDERR/STDOUT to functions 43 43 44 use gsprintf 'gsprintf'; 44 45 … … 192 193 my $strBaseCMD = $strOptions." --tries=2 -q -O - \"$self->{'url'}\""; 193 194 194 #print STDOUT "\n@@@@ GETTING server_info with WGET CMD: $strBaseCMD\n\n";195 196 195 my $strIdentifyText = $self->useWget($strBaseCMD); 197 196 … … 200 199 print STDERR "Server information is unavailable.\n"; 201 200 201 #&util::print_env(STDERR, "https_proxy", "http_proxy"); 202 202 203 if ($self->{'proxy_on'} && $self->{'proxy_host'} && $self->{'proxy_port'}) { # if proxying set, the settings may be wrong 203 204 &gsprintf::gsprintf_multiline(STDERR, "{WebDownload.proxied_connect_failed_info}\n", $self->{'proxy_host'}, $self->{'proxy_port'}); -
main/trunk/greenstone2/perllib/downloaders/WgetDownload.pm
r31860 r31864 169 169 my ($self) = @_; 170 170 my $strOptions = ""; 171 172 if ($self->{'proxy_on'} && $self->{'proxy_host'} && $self->{'proxy_port'}) 173 { 174 175 if($self->{'url'} =~ m/^https\:/) { 171 172 # If http_proxy ENV VARS are not set, but proxy Perl vars are set, then we're on Windows 173 # and need to use the proxy vars as flags to wget 174 # If http_proxy Env Vars are set, then we're on Linux, wget will use the http(s) proxy 175 # env vars and we shouldn't be passing any proxy perl vars as flags 176 177 # Truth in Perl: https://home.ubalt.edu/abento/452/perl/perltruth.html 178 # http://www.perlmonks.org/?node=what%20is%20true%20and%20false%20in%20Perl%3F 179 180 if (!$ENV{'http_proxy'} && !$ENV{'https_proxy'}) { 181 if ($self->{'proxy_on'} && $self->{'proxy_host'} && $self->{'proxy_port'}) 182 { 183 184 if($self->{'url'} =~ m/^https\:/) { 176 185 $strOptions .= " -e https_proxy=$self->{'proxy_host'}:$self->{'proxy_port'} "; 177 } else {186 } else { 178 187 $strOptions .= " -e http_proxy=$self->{'proxy_host'}:$self->{'proxy_port'} "; 179 } 180 181 if ($self->{'user_name'} && $self->{'user_password'}) 182 { 183 $strOptions .= "--proxy-user=$self->{'user_name'}"." --proxy-passwd=$self->{'user_password'}"; 184 } 185 } 186 187 if ($self->{'proxy_on'}) { 188 $strOptions .= " --proxy "; 189 } 190 191 if($self->{'no_check_certificate'}) { #&& $self->{'url'} =~ m/^https\:/) { # URL may be http that gets redirected to https 192 188 } 189 190 if ($self->{'user_name'} && $self->{'user_password'}) 191 { 192 $strOptions .= "--proxy-user=$self->{'user_name'}"." --proxy-passwd=$self->{'user_password'}"; 193 } 194 } 195 196 if ($self->{'proxy_on'}) { 197 $strOptions .= " --proxy "; 198 } 199 } 200 201 if($self->{'no_check_certificate'}) { #&& $self->{'url'} =~ m/^https\:/) { # URL may be http that gets redirected to https, so if no_check_certificate is on, turn it on even if URL is http 202 193 203 $strOptions .= " --no-check-certificate "; 194 204 } … … 259 269 my $wget_file_path = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "wget"); 260 270 $command = "\"$wget_file_path\" $cmdWget"; 261 #print STDOUT "Command is: $command\n"; 262 271 #print STDOUT "Command is: $command\n"; # displayed in GLI output 272 #print STDERR "Command is: $command\n"; # goes into ServerInfoDialog 273 263 274 # Wget's output needs to be monitored to find out when it has naturally terminated. 264 275 # Wget's output is sent to its STDERR so we can't use open2 without doing 2>&1.
Note:
See TracChangeset
for help on using the changeset viewer.