mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 04:39:54 +01:00
Skip message header when parsing body.
This commit is contained in:
@@ -29,6 +29,8 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import static org.briarproject.api.sync.SyncConstants.MESSAGE_HEADER_LENGTH;
|
||||||
|
|
||||||
class ClientHelperImpl implements ClientHelper {
|
class ClientHelperImpl implements ClientHelper {
|
||||||
|
|
||||||
private final DatabaseComponent db;
|
private final DatabaseComponent db;
|
||||||
@@ -104,7 +106,8 @@ class ClientHelperImpl implements ClientHelper {
|
|||||||
throws DbException, FormatException {
|
throws DbException, FormatException {
|
||||||
byte[] raw = db.getRawMessage(txn, m);
|
byte[] raw = db.getRawMessage(txn, m);
|
||||||
if (raw == null) return null;
|
if (raw == null) return null;
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(raw);
|
ByteArrayInputStream in = new ByteArrayInputStream(raw,
|
||||||
|
MESSAGE_HEADER_LENGTH, raw.length - MESSAGE_HEADER_LENGTH);
|
||||||
BdfReader reader = bdfReaderFactory.createReader(in);
|
BdfReader reader = bdfReaderFactory.createReader(in);
|
||||||
BdfDictionary dictionary;
|
BdfDictionary dictionary;
|
||||||
try {
|
try {
|
||||||
@@ -138,7 +141,8 @@ class ClientHelperImpl implements ClientHelper {
|
|||||||
throws DbException, FormatException {
|
throws DbException, FormatException {
|
||||||
byte[] raw = db.getRawMessage(txn, m);
|
byte[] raw = db.getRawMessage(txn, m);
|
||||||
if (raw == null) return null;
|
if (raw == null) return null;
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(raw);
|
ByteArrayInputStream in = new ByteArrayInputStream(raw,
|
||||||
|
MESSAGE_HEADER_LENGTH, raw.length - MESSAGE_HEADER_LENGTH);
|
||||||
BdfReader reader = bdfReaderFactory.createReader(in);
|
BdfReader reader = bdfReaderFactory.createReader(in);
|
||||||
BdfList list;
|
BdfList list;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user