Changeset 4854 in josm


Ignore:
Timestamp:
2012-01-22T21:35:37+01:00 (8 years ago)
Author:
bastiK
Message:

see #6823 - josm starts extremely slow when osm api is offline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r4815 r4854  
    560560    private String sendRequest(String requestMethod, String urlSuffix,String requestBody, ProgressMonitor monitor, boolean doAuthenticate, boolean fastFail) throws OsmTransferException {
    561561        StringBuffer responseBody = new StringBuffer();
    562         int retries = getMaxRetries();
     562        int retries = fastFail ? 0 : getMaxRetries();
    563563
    564564        while(true) { // the retry loop
     
    568568                activeConnection = (HttpURLConnection)url.openConnection();
    569569                activeConnection.setConnectTimeout(fastFail ? 1000 : Main.pref.getInteger("socket.timeout.connect",15)*1000);
     570                activeConnection.setReadTimeout(fastFail ? 1000 : Main.pref.getInteger("socket.timeout.read",15)*1000);
    570571                activeConnection.setRequestMethod(requestMethod);
    571572                if (doAuthenticate) {
Note: See TracChangeset for help on using the changeset viewer.