mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
*) "Httpc object was not returned to object pool." bug fixed.
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@62 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
parent
47e426ff7e
commit
3756e6d20f
|
@ -167,8 +167,8 @@ public final class httpc {
|
|||
public static httpc getInstance(String server, int port, int timeout, boolean ssl) throws IOException {
|
||||
|
||||
httpc newHttpc = null;
|
||||
// fetching a new httpc from the object pool
|
||||
try {
|
||||
// fetching a new httpc from the object pool
|
||||
newHttpc = (httpc) httpc.theHttpcPool.borrowObject();
|
||||
|
||||
} catch (Exception e) {
|
||||
|
@ -176,7 +176,12 @@ public final class httpc {
|
|||
}
|
||||
|
||||
// initialize it
|
||||
newHttpc.init(server,port,timeout,ssl);
|
||||
try {
|
||||
newHttpc.init(server,port,timeout,ssl);
|
||||
} catch (IOException e) {
|
||||
try{ httpc.theHttpcPool.returnObject(newHttpc); } catch (Exception e1) {}
|
||||
throw e;
|
||||
}
|
||||
return newHttpc;
|
||||
|
||||
|
||||
|
@ -192,9 +197,11 @@ public final class httpc {
|
|||
}
|
||||
|
||||
protected void finalize() throws Throwable {
|
||||
if (!this.removedFromPool) System.err.println("Httpc object was not returned to object pool.");
|
||||
this.reset();
|
||||
httpc.theHttpcPool.invalidateObject(this);
|
||||
if (!this.removedFromPool) {
|
||||
System.err.println("Httpc object was not returned to object pool.");
|
||||
httpc.theHttpcPool.invalidateObject(this);
|
||||
}
|
||||
this.reset();
|
||||
}
|
||||
|
||||
public static String dnsResolve(String host) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user