mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
Flush the output stream before rather than after waiting for packets.
See bug #27.
This commit is contained in:
@@ -106,11 +106,11 @@ class DuplexOutgoingSession implements MessagingSession, EventListener {
|
||||
// Write packets until interrupted
|
||||
try {
|
||||
while(!interrupted) {
|
||||
// Flush the stream if it's going to be idle
|
||||
if(writerTasks.isEmpty()) out.flush();
|
||||
ThrowingRunnable<IOException> task = writerTasks.take();
|
||||
if(task == CLOSE) break;
|
||||
task.run();
|
||||
// Flush the stream if it's going to be idle
|
||||
if(writerTasks.isEmpty()) out.flush();
|
||||
}
|
||||
out.flush();
|
||||
} catch(InterruptedException e) {
|
||||
|
||||
Reference in New Issue
Block a user