mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 20:29:52 +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
|
// Write packets until interrupted
|
||||||
try {
|
try {
|
||||||
while(!interrupted) {
|
while(!interrupted) {
|
||||||
|
// Flush the stream if it's going to be idle
|
||||||
|
if(writerTasks.isEmpty()) out.flush();
|
||||||
ThrowingRunnable<IOException> task = writerTasks.take();
|
ThrowingRunnable<IOException> task = writerTasks.take();
|
||||||
if(task == CLOSE) break;
|
if(task == CLOSE) break;
|
||||||
task.run();
|
task.run();
|
||||||
// Flush the stream if it's going to be idle
|
|
||||||
if(writerTasks.isEmpty()) out.flush();
|
|
||||||
}
|
}
|
||||||
out.flush();
|
out.flush();
|
||||||
} catch(InterruptedException e) {
|
} catch(InterruptedException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user