Changeset 31851 for main/trunk/gli
- Timestamp:
- 2017-08-03T19:28:08+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/gui/DownloadPane.java
r31843 r31851 613 613 boolean noMoreRedirects = false; 614 614 boolean gotException = false; 615 615 final int TIMEOUT = 2 * 1000; // ms 616 616 617 HttpURLConnection connection = null; 617 618 if(url_str.startsWith("http:") || url_str.startsWith("https:")) { // only test http urls … … 625 626 // find out whether we are dealing with redirects in the first place 626 627 connection.setInstanceFollowRedirects(false); 627 connection.setConnectTimeout(5 * 1000); // ms 628 // Connection timeout: if we can't connect, like if the proxy is wrong, don't wait forever 629 // Read timeout: *idle time* when retrieving a link. Don't wait forever to retrieve a page (e.g. if page doesn't exist) 630 // https://stackoverflow.com/questions/6829801/httpurlconnection-setconnecttimeout-has-no-effect 631 connection.setConnectTimeout(TIMEOUT); 632 connection.setReadTimeout(TIMEOUT); 628 633 629 634 // now check for whether we get a redirect response
Note:
See TracChangeset
for help on using the changeset viewer.