Plan B: Remove error correction and reliability layers and the

consequent distinction between segments and frames.
This commit is contained in:
akwizgran
2012-02-06 16:03:09 +00:00
parent 899ec5e19e
commit 6da30ca486
84 changed files with 296 additions and 2674 deletions

View File

@@ -10,13 +10,12 @@ import javax.crypto.ShortBufferException;
import net.sf.briar.api.crypto.ErasableKey;
class OutgoingAuthenticationLayerImpl implements OutgoingAuthenticationLayer {
class OutgoingAuthenticationLayerImpl implements FrameWriter {
private final OutgoingErrorCorrectionLayer out;
private final FrameWriter out;
private final Mac mac;
private final int maxFrameLength;
OutgoingAuthenticationLayerImpl(OutgoingErrorCorrectionLayer out, Mac mac,
OutgoingAuthenticationLayerImpl(FrameWriter out, Mac mac,
ErasableKey macKey) {
this.out = out;
this.mac = mac;
@@ -28,7 +27,6 @@ class OutgoingAuthenticationLayerImpl implements OutgoingAuthenticationLayer {
macKey.erase();
if(mac.getMacLength() != MAC_LENGTH)
throw new IllegalArgumentException();
maxFrameLength = out.getMaxFrameLength();
}
public void writeFrame(Frame f) throws IOException {
@@ -50,8 +48,4 @@ class OutgoingAuthenticationLayerImpl implements OutgoingAuthenticationLayer {
public long getRemainingCapacity() {
return out.getRemainingCapacity();
}
public int getMaxFrameLength() {
return maxFrameLength;
}
}