Ticket #16705: v1-0003-RemoteControlHttpsServer-end-mainloop-if-server.i.patch

File v1-0003-RemoteControlHttpsServer-end-mainloop-if-server.i.patch, 1.4 KB (added by ris, 8 months ago)
  • src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java

    From efbc801dfcfc4c5633210e137aa87fb1559c5321 Mon Sep 17 00:00:00 2001
    From: Robert Scott <code@humanleg.org.uk>
    Date: Sun, 2 Sep 2018 13:32:51 +0100
    Subject: [PATCH v1 3/3] RemoteControlHttpsServer: end mainloop if
     server.isClosed()
    
    this corresponds to a similar line in RemoteControlHttpServer which
    appears to be missing in RemoteControlHttpsServer, meaning that a
    RemoteControlHttpsServer thread that's been "stopped" would actually just
    spin forever, erroring on the closed ServerSocket.
    ---
     .../openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java  | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java b/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
    index 3ce0a80d9..412ca2460 100644
    a b public class RemoteControlHttpsServer extends Thread { 
    416416            } catch (SocketException e) {
    417417                if (!server.isClosed()) {
    418418                    Logging.error(e);
     419                } else {
     420                    // stop the thread automatically if server is stopped
     421                    return;
    419422                }
    420423            } catch (IOException ioe) {
    421424                Logging.error(ioe);