Skip to content

Commit 03351fb

Browse files
authored
Re-interrupt thread instead of ignoring InterruptedException
1 parent 7a9d373 commit 03351fb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

core/src/main/java/org/nanohttpd/protocols/http/NanoHTTPD.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,8 @@ public void start(final int timeout, boolean daemon) throws IOException {
609609
while (!serverRunnable.hasBinded() && serverRunnable.getBindException() == null) {
610610
try {
611611
Thread.sleep(10L);
612-
} catch (Throwable e) {
613-
// on android this may not be allowed, that's why we
614-
// catch throwable the wait should be very short because we are
615-
// just waiting for the bind of the socket
612+
} catch (InterruptedException e) {
613+
Thread.currentThread().interrupt(); // re-interrupt
616614
}
617615
}
618616
if (serverRunnable.getBindException() != null) {

0 commit comments

Comments
 (0)