mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Write any records in the queue before ending session.
This commit is contained in:
@@ -166,6 +166,9 @@ class DuplexOutgoingSession implements SyncSession, EventListener {
|
||||
dataToFlush = true;
|
||||
}
|
||||
}
|
||||
// Write any records that were already in the queue
|
||||
ThrowingRunnable<IOException> task;
|
||||
while ((task = writerTasks.poll()) != null) task.run();
|
||||
streamWriter.sendEndOfStream();
|
||||
} catch (InterruptedException e) {
|
||||
LOG.info("Interrupted while waiting for a record to write");
|
||||
|
||||
@@ -95,6 +95,9 @@ class SimplexOutgoingSession implements SyncSession, EventListener {
|
||||
if (task == CLOSE) break;
|
||||
task.run();
|
||||
}
|
||||
// Write any records that were already in the queue
|
||||
ThrowingRunnable<IOException> task;
|
||||
while ((task = writerTasks.poll()) != null) task.run();
|
||||
streamWriter.sendEndOfStream();
|
||||
} catch (InterruptedException e) {
|
||||
LOG.info("Interrupted while waiting for a record to write");
|
||||
|
||||
Reference in New Issue
Block a user