Skip to content
Snippets Groups Projects
Commit a848490a authored by bontric's avatar bontric
Browse files

cleanup MailboxManager

parent ab5bc606
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -174,16 +174,16 @@ public class MailboxManagerImpl implements MailboxManager { ...@@ -174,16 +174,16 @@ public class MailboxManagerImpl implements MailboxManager {
ioExecutor.execute(mailboxProtocol); ioExecutor.execute(mailboxProtocol);
try {
mailboxSession.run(); mailboxSession.run();
mailboxProtocol.stop(); mailboxProtocol.stop();
disposeConnection(false);
} catch (IOException e) { disposeConnection(false);
logException(LOG, WARNING, e);
} finally { connectionRegistry
connectionRegistry .unregisterConnection(contactId, MailboxConstants.ID,
.unregisterConnection(contactId, MailboxConstants.ID, incoming); incoming);
}
} }
private void handleOutgoingStream() throws DbException, IOException { private void handleOutgoingStream() throws DbException, IOException {
...@@ -221,10 +221,10 @@ public class MailboxManagerImpl implements MailboxManager { ...@@ -221,10 +221,10 @@ public class MailboxManagerImpl implements MailboxManager {
throw new IOException( throw new IOException(
"Unrecognised tag for returning stream"); "Unrecognised tag for returning stream");
if (!incomingCtx.getContactId().equals(contactId)) { if (!incomingCtx.getContactId().equals(contactId))
throw new IOException( throw new IOException(
"ContactId for Incoming stream does not match expected ContactId"); "ContactId for Incoming stream does not match expected ContactId");
}
} }
private void handleIncomingStream() throws IOException { private void handleIncomingStream() throws IOException {
...@@ -238,7 +238,6 @@ public class MailboxManagerImpl implements MailboxManager { ...@@ -238,7 +238,6 @@ public class MailboxManagerImpl implements MailboxManager {
} }
private void disposeConnection(boolean exception) { private void disposeConnection(boolean exception) {
// Interrupt the outgoing session so it finishes cleanly
try { try {
reader.dispose(exception, incomingCtx != null); reader.dispose(exception, incomingCtx != null);
writer.dispose(exception); writer.dispose(exception);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment