mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Handle exceptions thrown by connections' dispose() methods.
This commit is contained in:
@@ -88,7 +88,11 @@ class IncomingSimplexConnection {
|
||||
transport.dispose(false, true);
|
||||
} catch(IOException e) {
|
||||
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 {
|
||||
connRegistry.unregisterConnection(contactId, transportId);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import net.sf.briar.api.transport.ConnectionWriterFactory;
|
||||
class OutgoingSimplexConnection {
|
||||
|
||||
private static final Logger LOG =
|
||||
Logger.getLogger(OutgoingSimplexConnection.class.getName());
|
||||
Logger.getLogger(OutgoingSimplexConnection.class.getName());
|
||||
|
||||
private final DatabaseComponent db;
|
||||
private final ConnectionRegistry connRegistry;
|
||||
@@ -103,10 +103,18 @@ class OutgoingSimplexConnection {
|
||||
transport.dispose(false);
|
||||
} catch(DbException e) {
|
||||
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) {
|
||||
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 {
|
||||
connRegistry.unregisterConnection(contactId, transportId);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.google.inject.Inject;
|
||||
class ConnectionDispatcherImpl implements ConnectionDispatcher {
|
||||
|
||||
private static final Logger LOG =
|
||||
Logger.getLogger(ConnectionDispatcherImpl.class.getName());
|
||||
Logger.getLogger(ConnectionDispatcherImpl.class.getName());
|
||||
|
||||
private final Executor connExecutor;
|
||||
private final ConnectionRecogniser recogniser;
|
||||
@@ -96,10 +96,18 @@ class ConnectionDispatcherImpl implements ConnectionDispatcher {
|
||||
transport);
|
||||
} catch(DbException e) {
|
||||
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) {
|
||||
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