Changeset 763 in josm


Ignore:
Timestamp:
2008-08-11T00:32:08+02:00 (16 years ago)
Author:
stoecker
Message:

Fix upload aborts. Closes #263. Patch by Florian Heer.

Location:
trunk/src/org/openstreetmap/josm/io
Files:
2 edited

Legend:

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

    r662 r763  
    128128                cancel = true;
    129129                if (activeConnection != null) {
    130                         activeConnection.setConnectTimeout(1);
    131                         activeConnection.setReadTimeout(1);
     130                        activeConnection.setConnectTimeout(100);
     131                        activeConnection.setReadTimeout(100);
     132                        try {
     133                                Thread.sleep(100);
     134                        } catch (InterruptedException ex) {}
    132135                        activeConnection.disconnect();
    133136                }
     
    135138
    136139        protected void addAuth(HttpURLConnection con) throws CharacterCodingException {
    137             CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder();
    138             String auth = Main.pref.get("osm-server.username") + ":" + Main.pref.get("osm-server.password");
    139             ByteBuffer bytes = encoder.encode(CharBuffer.wrap(auth));
    140             con.addRequestProperty("Authorization", "Basic "+Base64.encode(bytes));
    141     }
     140                CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder();
     141                String auth = Main.pref.get("osm-server.username") + ":" + Main.pref.get("osm-server.password");
     142                ByteBuffer bytes = encoder.encode(CharBuffer.wrap(auth));
     143                con.addRequestProperty("Authorization", "Basic "+Base64.encode(bytes));
     144        }
    142145}
  • trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java

    r679 r763  
    5555         * Whether the operation should be aborted as soon as possible.
    5656         */
    57         private boolean cancel = false;
    58        
     57        // use the inherited variable
     58        // private boolean cancel = false;
     59
    5960        /**
    6061         * Object describing current changeset
Note: See TracChangeset for help on using the changeset viewer.