mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 22:59:54 +01:00
Interrupt outgoing session when incoming session ends.
This commit is contained in:
@@ -300,8 +300,8 @@ class ConnectionManagerImpl implements ConnectionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void disposeReader(boolean exception, boolean recognised) {
|
private void disposeReader(boolean exception, boolean recognised) {
|
||||||
if (exception && outgoingSession != null)
|
// Interrupt the outgoing session so it finishes cleanly
|
||||||
outgoingSession.interrupt();
|
if (outgoingSession != null) outgoingSession.interrupt();
|
||||||
try {
|
try {
|
||||||
reader.dispose(exception, recognised);
|
reader.dispose(exception, recognised);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -310,6 +310,8 @@ class ConnectionManagerImpl implements ConnectionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void disposeWriter(boolean exception) {
|
private void disposeWriter(boolean exception) {
|
||||||
|
// Interrupt the incoming session if an exception occurred,
|
||||||
|
// otherwise wait for the end of stream marker
|
||||||
if (exception && incomingSession != null)
|
if (exception && incomingSession != null)
|
||||||
incomingSession.interrupt();
|
incomingSession.interrupt();
|
||||||
try {
|
try {
|
||||||
@@ -407,8 +409,8 @@ class ConnectionManagerImpl implements ConnectionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void disposeReader(boolean exception, boolean recognised) {
|
private void disposeReader(boolean exception, boolean recognised) {
|
||||||
if (exception && outgoingSession != null)
|
// Interrupt the outgoing session so it finishes cleanly
|
||||||
outgoingSession.interrupt();
|
if (outgoingSession != null) outgoingSession.interrupt();
|
||||||
try {
|
try {
|
||||||
reader.dispose(exception, recognised);
|
reader.dispose(exception, recognised);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -417,6 +419,8 @@ class ConnectionManagerImpl implements ConnectionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void disposeWriter(boolean exception) {
|
private void disposeWriter(boolean exception) {
|
||||||
|
// Interrupt the incoming session if an exception occurred,
|
||||||
|
// otherwise wait for the end of stream marker
|
||||||
if (exception && incomingSession != null)
|
if (exception && incomingSession != null)
|
||||||
incomingSession.interrupt();
|
incomingSession.interrupt();
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user