Write the tag immediately even if there are no packets to send. Bug #27.

This commit is contained in:
akwizgran
2014-03-16 18:13:31 +00:00
parent 5755aed362
commit 8c18773141
4 changed files with 17 additions and 7 deletions

View File

@@ -140,8 +140,8 @@ public class OutgoingSimplexConnectionTest extends BriarTestCase {
will(returnValue(null));
}});
connection.write();
// Nothing should have been written
assertEquals(0, out.size());
// Only the tag and an empty final frame should have been written
assertEquals(TAG_LENGTH + HEADER_LENGTH + MAC_LENGTH, out.size());
// The transport should have been disposed with exception == false
assertTrue(transport.getDisposed());
assertFalse(transport.getException());

View File

@@ -75,8 +75,8 @@ public class OutgoingEncryptionLayerTest extends BriarTestCase {
FRAME_LENGTH, tag);
// Write an empty final frame without having written any other frames
o.writeFrame(new byte[FRAME_LENGTH - MAC_LENGTH], 0, true);
// Nothing should be written to the output stream
assertEquals(0, out.size());
// The tag and the empty frame should be written to the output stream
assertEquals(TAG_LENGTH + HEADER_LENGTH + MAC_LENGTH, out.size());
}
@Test