Ignore:
Timestamp:
2012-11-18T00:44:10+01:00 (11 years ago)
Author:
Don-vip
Message:

Single entry point in Utils to open HTTP connections

File:
1 edited

Legend:

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

    r5422 r5587  
    3636import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    3737import org.openstreetmap.josm.tools.CheckParameterUtil;
     38import org.openstreetmap.josm.tools.Utils;
    3839import org.xml.sax.Attributes;
    3940import org.xml.sax.InputSource;
     
    585586                URL url = new URL(new URL(getBaseUrl()), urlSuffix);
    586587                System.out.print(requestMethod + " " + url + "... ");
    587                 activeConnection = (HttpURLConnection)url.openConnection();
    588588                // fix #5369, see http://www.tikalk.com/java/forums/httpurlconnection-disable-keep-alive
    589                 activeConnection.setRequestProperty("Connection", "close");
     589                activeConnection = Utils.openHttpConnection(url, false);
    590590                activeConnection.setConnectTimeout(fastFail ? 1000 : Main.pref.getInteger("socket.timeout.connect",15)*1000);
    591591                if (fastFail) {
Note: See TracChangeset for help on using the changeset viewer.