If no messages are added to a batch, don't call BatchWriter.finish() -
this allows the caller to avoid creating an empty packet by delaying creation of the packet's header and trailer until something's written to the packet's body. Changed the return semantics of DatabaseComponent.generateBatch(ContactId, BatchWriter, Collection<MessageId>) so that the IDs of messages considered for inclusion in the batch but no longer sendable are also returned - this allows the caller to remove them from the set of requested IDs.
Showing
- api/net/sf/briar/api/db/DatabaseComponent.java 3 additions, 2 deletionsapi/net/sf/briar/api/db/DatabaseComponent.java
- components/net/sf/briar/db/ReadWriteLockDatabaseComponent.java 18 additions, 13 deletions...nents/net/sf/briar/db/ReadWriteLockDatabaseComponent.java
- components/net/sf/briar/db/SynchronizedDatabaseComponent.java 27 additions, 15 deletions...onents/net/sf/briar/db/SynchronizedDatabaseComponent.java
Loading
Please register or sign in to comment