Changeset 19726 in josm for trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
- Timestamp:
- 2026-12-02T22:48:39+01:00 (less than one hour ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
r19711 r19726 197 197 @Override 198 198 public void run() { 199 // The locks ensure that we process the instructions in the order in which they came.200 // This is mostly important when the caller is attempting to create a new layer and add multiple download201 // instructions for that layer. See #23821 for additional details.202 ORDER_LOCK.lock();203 199 try (request; 204 200 Writer out = new OutputStreamWriter(new BufferedOutputStream(request.getOutputStream()), RESPONSE_CHARSET); … … 207 203 } catch (IOException ioe) { 208 204 Logging.debug(Logging.getErrorMessage(ioe)); 209 } finally {210 ORDER_LOCK.unlock();211 205 } 212 206 } … … 251 245 final Map<String, String> headers = parseHeaders(in); 252 246 final String sender = parseSender(headers, request); 253 callHandler(url, command, out, sender); 247 // The lock ensures that we process the instructions in the order in which they came. 248 // This is mostly important when the caller is attempting to create a new layer and add multiple download 249 // instructions for that layer. See #23821 for additional details. 250 // It must only be taken once the request has been read. Otherwise a client that opens a connection without 251 // sending anything (e.g. a browser preconnect) blocks every other remote control request until it gives up. 252 ORDER_LOCK.lock(); 253 try { 254 callHandler(url, command, out, sender); 255 } finally { 256 ORDER_LOCK.unlock(); 257 } 254 258 } catch (ReflectiveOperationException e) { 255 259 Logging.error(e);
Note:
See TracChangeset
for help on using the changeset viewer.
