mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
Remove compression
This commit is contained in:
parent
35b5999cba
commit
39a691a7e6
@ -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(),
|
||||
|
@ -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
|
||||
|
@ -6,7 +6,6 @@ package protocol
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"compress/flate"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@ -78,11 +77,9 @@ type rawConnection struct {
|
||||
receiver Model
|
||||
state int
|
||||
|
||||
reader io.ReadCloser
|
||||
cr *countingReader
|
||||
xr *xdr.Reader
|
||||
|
||||
writer io.WriteCloser
|
||||
cw *countingWriter
|
||||
wb *bufio.Writer
|
||||
xw *xdr.Writer
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user