mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Handle exceptions thrown by connections' dispose() methods.
This commit is contained in:
@@ -88,7 +88,11 @@ class IncomingSimplexConnection {
|
|||||||
transport.dispose(false, true);
|
transport.dispose(false, true);
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
||||||
transport.dispose(true, true);
|
try {
|
||||||
|
transport.dispose(true, true);
|
||||||
|
} catch(IOException e1) {
|
||||||
|
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
connRegistry.unregisterConnection(contactId, transportId);
|
connRegistry.unregisterConnection(contactId, transportId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import net.sf.briar.api.transport.ConnectionWriterFactory;
|
|||||||
class OutgoingSimplexConnection {
|
class OutgoingSimplexConnection {
|
||||||
|
|
||||||
private static final Logger LOG =
|
private static final Logger LOG =
|
||||||
Logger.getLogger(OutgoingSimplexConnection.class.getName());
|
Logger.getLogger(OutgoingSimplexConnection.class.getName());
|
||||||
|
|
||||||
private final DatabaseComponent db;
|
private final DatabaseComponent db;
|
||||||
private final ConnectionRegistry connRegistry;
|
private final ConnectionRegistry connRegistry;
|
||||||
@@ -103,10 +103,18 @@ class OutgoingSimplexConnection {
|
|||||||
transport.dispose(false);
|
transport.dispose(false);
|
||||||
} catch(DbException e) {
|
} catch(DbException e) {
|
||||||
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
||||||
transport.dispose(true);
|
try {
|
||||||
|
transport.dispose(true);
|
||||||
|
} catch(IOException e1) {
|
||||||
|
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
||||||
|
}
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
||||||
transport.dispose(true);
|
try {
|
||||||
|
transport.dispose(true);
|
||||||
|
} catch(IOException e1) {
|
||||||
|
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
connRegistry.unregisterConnection(contactId, transportId);
|
connRegistry.unregisterConnection(contactId, transportId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import com.google.inject.Inject;
|
|||||||
class ConnectionDispatcherImpl implements ConnectionDispatcher {
|
class ConnectionDispatcherImpl implements ConnectionDispatcher {
|
||||||
|
|
||||||
private static final Logger LOG =
|
private static final Logger LOG =
|
||||||
Logger.getLogger(ConnectionDispatcherImpl.class.getName());
|
Logger.getLogger(ConnectionDispatcherImpl.class.getName());
|
||||||
|
|
||||||
private final Executor connExecutor;
|
private final Executor connExecutor;
|
||||||
private final ConnectionRecogniser recogniser;
|
private final ConnectionRecogniser recogniser;
|
||||||
@@ -96,10 +96,18 @@ class ConnectionDispatcherImpl implements ConnectionDispatcher {
|
|||||||
transport);
|
transport);
|
||||||
} catch(DbException e) {
|
} catch(DbException e) {
|
||||||
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
||||||
transport.dispose(true, false);
|
try {
|
||||||
|
transport.dispose(true, false);
|
||||||
|
} catch(IOException e1) {
|
||||||
|
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
||||||
|
}
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
||||||
transport.dispose(true, false);
|
try {
|
||||||
|
transport.dispose(true, false);
|
||||||
|
} catch(IOException e1) {
|
||||||
|
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user