mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 21:59:54 +01:00
Remove raw messages from SyncRecordWriter interface.
This commit is contained in:
@@ -307,7 +307,7 @@ class DuplexOutgoingSession implements SyncSession, EventListener {
|
||||
@Override
|
||||
public void run() throws IOException {
|
||||
if (interrupted) return;
|
||||
for (Message m : batch) recordWriter.writeMessage(m.getRaw());
|
||||
for (Message m : batch) recordWriter.writeMessage(m);
|
||||
LOG.info("Sent batch");
|
||||
generateBatch();
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ class SimplexOutgoingSession implements SyncSession, EventListener {
|
||||
@Override
|
||||
public void run() throws IOException {
|
||||
if (interrupted) return;
|
||||
for (Message m : batch) recordWriter.writeMessage(m.getRaw());
|
||||
for (Message m : batch) recordWriter.writeMessage(m);
|
||||
LOG.info("Sent batch");
|
||||
dbExecutor.execute(new GenerateBatch());
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.bramble.api.record.Record;
|
||||
import org.briarproject.bramble.api.record.RecordWriter;
|
||||
import org.briarproject.bramble.api.sync.Ack;
|
||||
import org.briarproject.bramble.api.sync.Message;
|
||||
import org.briarproject.bramble.api.sync.MessageId;
|
||||
import org.briarproject.bramble.api.sync.Offer;
|
||||
import org.briarproject.bramble.api.sync.Request;
|
||||
@@ -44,8 +45,8 @@ class SyncRecordWriterImpl implements SyncRecordWriter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeMessage(byte[] raw) throws IOException {
|
||||
writer.writeRecord(new Record(PROTOCOL_VERSION, MESSAGE, raw));
|
||||
public void writeMessage(Message m) throws IOException {
|
||||
writer.writeRecord(new Record(PROTOCOL_VERSION, MESSAGE, m.getRaw()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user