Remove compression

This commit is contained in:
Jakob Borg 2014-07-14 23:52:11 +02:00
parent 35b5999cba
commit 39a691a7e6
3 changed files with 12 additions and 29 deletions

View File

@ -735,6 +735,9 @@ next:
protoConn := protocol.NewConnection(remoteID, conn, wr, m)
l.Infof("Established secure connection to %s at %v", remoteID, conn.RemoteAddr())
if debugNet {
l.Debugf("cipher suite %04X", conn.ConnectionState().CipherSuite)
}
events.Default.Log(events.NodeConnected, map[string]string{
"id": remoteID.String(),
"addr": conn.RemoteAddr().String(),

View File

@ -25,24 +25,17 @@ Transport and Authentication
----------------------------
BEP is deployed as the highest level in a protocol stack, with the lower
level protocols providing compression, encryption and authentication.
level protocols providing encryption and authentication.
+-----------------------------|
| Block Exchange Protocol |
|-----------------------------|
| Compression (RFC 1951) |
|-----------------------------|
| Encryption & Auth (TLS 1.2) |
|-----------------------------|
| TCP |
|-----------------------------|
v ... v
Compression is started directly after a successful TLS handshake,
before the first message is sent. The compression is flushed at each
message boundary. Compression SHALL use the DEFLATE format as specified
in RFC 1951.
The encryption and authentication layer SHALL use TLS 1.2 or a higher
revision. A strong cipher suite SHALL be used, with "strong cipher
suite" being defined as being without known weaknesses and providing

View File

@ -6,7 +6,6 @@ package protocol
import (
"bufio"
"compress/flate"
"errors"
"fmt"
"io"
@ -78,14 +77,12 @@ type rawConnection struct {
receiver Model
state int
reader io.ReadCloser
cr *countingReader
xr *xdr.Reader
cr *countingReader
xr *xdr.Reader
writer io.WriteCloser
cw *countingWriter
wb *bufio.Writer
xw *xdr.Writer
cw *countingWriter
wb *bufio.Writer
xw *xdr.Writer
awaiting []chan asyncResult
awaitingMut sync.Mutex
@ -113,21 +110,15 @@ func NewConnection(nodeID NodeID, reader io.Reader, writer io.Writer, receiver M
cr := &countingReader{Reader: reader}
cw := &countingWriter{Writer: writer}
flrd := flate.NewReader(cr)
flwr, err := flate.NewWriter(cw, flate.BestSpeed)
if err != nil {
panic(err)
}
wb := bufio.NewWriter(flwr)
rb := bufio.NewReader(cr)
wb := bufio.NewWriter(cw)
c := rawConnection{
id: nodeID,
receiver: nativeModel{receiver},
state: stateInitial,
reader: flrd,
cr: cr,
xr: xdr.NewReader(flrd),
writer: flwr,
xr: xdr.NewReader(rb),
cw: cw,
wb: wb,
xw: xdr.NewWriter(wb),
@ -485,10 +476,6 @@ func (c *rawConnection) flush() error {
return err
}
if f, ok := c.writer.(flusher); ok {
return f.Flush()
}
return nil
}