Changeset 31839 for main/trunk/gli/src


Ignore:
Timestamp:
2017-08-01T22:13:20+12:00 (7 years ago)
Author:
ak19
Message:

Fixing a bug in my previous commit: redirectURL() should stop its recursive calls to self on exception. On Mac, it gets an SSLHandShakeShakeException when it resolves a URL to https and tries to retrieve the page (to check for further redirects) before sending off the resolved URL to wget. Fortunately, the newer versions of wget we use being no longer 1.11, but 1.15/1.17 and up, don't require redirectURL to resolve the final URL to start downloading from, as newer versions of wget resolve the final URL for themselves

File:
1 edited

Legend:

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

    r31821 r31839  
    611611    private String getRedirectURL(String url_str) {
    612612    boolean noMoreRedirects = false;
    613    
     613    boolean gotException = false;
     614
    614615    HttpURLConnection connection = null;
    615616    if(url_str.startsWith("http:") || url_str.startsWith("https:")) { // only test http urls
     
    642643        connection.disconnect();
    643644        } catch(Exception e) {
     645        gotException = true;
    644646        if(connection != null) {
    645647            connection.disconnect();
     
    650652    }
    651653
    652     if(noMoreRedirects) {
     654    if(noMoreRedirects || gotException) {
    653655        return url_str;
    654656    }
Note: See TracChangeset for help on using the changeset viewer.