Changeset 31864 for main/trunk/gli

Show
Ignore:
Timestamp:
09.08.2017 20:24:33 (2 years ago)
Author:
ak19
Message:

1. Modified GLI and perl to set proxy_on, proxy_host and proxy_port for unix too, whereas in the past, only http(s)_proxy ENV vars were set by GLI for unix. If the env vars are not set, then perl assumes it's the wget setup for windows and passes the proxy vars that were set by GLI as flags to wget. If the env vars were set, then perl should run wget without setting the proxy vars as flags to wget, and wget will use the proxying info in the environment. So now, the decision as to whether proxy vars are set or not will result in context specific suggestion messages to the user when the Server Info button was pressed and if the URL could not be accessed for whatever reason. 2. Modified GLI code to not use proxy if proxying is toggled off, but use proxy when it's toggled back on. (Previously, if proxying was set at any point during a GLI session, then GLI remembered that even when proxying was turned off thereafter.)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/gui/DownloadPane.java

    r31860 r31864  
    766766 
    767767        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        
    772769           arg.setValue("true"); // proxy_on argument 
    773770           arg.setAssigned(true); 
     
    780777           arg.setValue(proxy_port); 
    781778           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()) { 
    782783         
    783784           arg = current_download.getArgument("user_name"); 
     
    799800        } 
    800801        else{ 
     802        // unset proxy_on argument 
     803        arg = current_download.getArgument("proxy_on"); 
     804        arg.setValue("false");  
     805        arg.setAssigned(false); 
    801806        return false; 
    802807        } 
    803808 
     809    } else { 
     810        // unset proxy_on argument 
     811        arg = current_download.getArgument("proxy_on"); 
     812        arg.setValue("false");  
     813        arg.setAssigned(false); 
    804814    } 
    805815     
     
    830840        String str_url = ""; 
    831841        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        */ 
    833849        } 
    834850 
     
    842858        no_check_cert_arg.setAssigned(false); // only assigned Arguments have values 
    843859        } 
    844          
    845          
    846         //str_url = getRedirectURL(str_url); // work out the real URL 
    847860 
    848861        server_info = new ServerInfoDialog(str_url ,proxy_url, mode,(Download)download_map.get(mode));