| 1 | #! /bin/sh /usr/share/dpatch/dpatch-run
|
|---|
| 2 | ## 50_OsmServerWriter.dpatch by Andreas Putzo <andreas@putzo.net>
|
|---|
| 3 | ##
|
|---|
| 4 | ## DP: Create Outputstream prior connect() for uploading with the classpath library.
|
|---|
| 5 |
|
|---|
| 6 | @DPATCH@
|
|---|
| 7 | diff -urNad josm-0.0.0.20080316~/src/org/openstreetmap/josm/io/OsmServerWriter.java josm-0.0.0.20080316/src/org/openstreetmap/josm/io/OsmServerWriter.java
|
|---|
| 8 | --- josm-0.0.0.20080316~/src/org/openstreetmap/josm/io/OsmServerWriter.java 2008-01-30 17:02:38.000000000 +0000
|
|---|
| 9 | +++ josm-0.0.0.20080316/src/org/openstreetmap/josm/io/OsmServerWriter.java 2008-03-25 19:56:21.000000000 +0000
|
|---|
| 10 | @@ -191,15 +191,15 @@
|
|---|
| 11 | activeConnection = (HttpURLConnection)url.openConnection();
|
|---|
| 12 | activeConnection.setConnectTimeout(15000);
|
|---|
| 13 | activeConnection.setRequestMethod(requestMethod);
|
|---|
| 14 | - if (addBody)
|
|---|
| 15 | + addAuth(activeConnection);
|
|---|
| 16 | + if (addBody) {
|
|---|
| 17 | activeConnection.setDoOutput(true);
|
|---|
| 18 | - activeConnection.connect();
|
|---|
| 19 | - System.out.println("connected");
|
|---|
| 20 | - if (addBody) {
|
|---|
| 21 | OutputStream out = activeConnection.getOutputStream();
|
|---|
| 22 | OsmWriter.output(out, new OsmWriter.Single(osm, true));
|
|---|
| 23 | out.close();
|
|---|
| 24 | - }
|
|---|
| 25 | + }
|
|---|
| 26 | + activeConnection.connect();
|
|---|
| 27 | + System.out.println("connected");
|
|---|
| 28 |
|
|---|
| 29 | int retCode = activeConnection.getResponseCode();
|
|---|
| 30 | if (retCode == 200 && osm.id == 0)
|
|---|