Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

if a http client thread is still running but we do not wait for it any more, call an interrupt

Michael Peter Christen9a6912f2e628
diff --git a/source/net/yacy/cora/protocol/http/HTTPClient.java b/source/net/yacy/cora/protocol/http/HTTPClient.java
index 7d4ac41ce..2092ee997 100644
--- a/source/net/yacy/cora/protocol/http/HTTPClient.java
+++ b/source/net/yacy/cora/protocol/http/HTTPClient.java
@@ -703,6 +703,7 @@ public class HTTPClient {
};
t.start();
try {t.join(this.timeout);} catch (InterruptedException e) {}
+ if (t.isAlive()) try {t.interrupt();} catch (Throwable e) {}
if (te[0] != null) throw te[0];
if (thr[0] == null) throw new IOException("timout to client after " + this.timeout + "ms");
this.httpResponse = thr[0];