Store each connection window slot as a database row.

This is less memory-efficient but necessary for the coming forward
secrecy changes.
This commit is contained in:
akwizgran
2011-11-15 13:08:20 +00:00
parent cf49a28c95
commit df054b1743
19 changed files with 152 additions and 140 deletions

View File

@@ -48,4 +48,7 @@ public interface ProtocolConstants {
/** The length of a message's random salt in bytes. */
static final int SALT_LENGTH = 8;
/** The size of the connection reordering window. */
static final int CONNECTION_WINDOW_SIZE = 32;
}

View File

@@ -4,13 +4,9 @@ import java.util.Collection;
public interface ConnectionWindow {
long getCentre();
int getBitmap();
boolean isSeen(long connection);
void setSeen(long connection);
Collection<Long> getUnseenConnectionNumbers();
Collection<Long> getUnseen();
}

View File

@@ -1,6 +1,10 @@
package net.sf.briar.api.transport;
import java.util.Collection;
public interface ConnectionWindowFactory {
ConnectionWindow createConnectionWindow(long centre, int bitmap);
ConnectionWindow createConnectionWindow();
ConnectionWindow createConnectionWindow(Collection<Long> unseen);
}

View File

@@ -5,7 +5,7 @@ import net.sf.briar.api.protocol.TransportIndex;
public interface StreamConnectionFactory {
void createIncomingConnection(TransportIndex i, ContactId c,
void createIncomingConnection(TransportIndex i, ContactId c,
StreamTransportConnection s, byte[] encryptedIv);
void createOutgoingConnection(TransportIndex i, ContactId c,