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)
|
protoConn := protocol.NewConnection(remoteID, conn, wr, m)
|
||||||
|
|
||||||
l.Infof("Established secure connection to %s at %v", remoteID, conn.RemoteAddr())
|
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{
|
events.Default.Log(events.NodeConnected, map[string]string{
|
||||||
"id": remoteID.String(),
|
"id": remoteID.String(),
|
||||||
"addr": conn.RemoteAddr().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
|
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 |
|
| Block Exchange Protocol |
|
||||||
|-----------------------------|
|
|-----------------------------|
|
||||||
| Compression (RFC 1951) |
|
|
||||||
|-----------------------------|
|
|
||||||
| Encryption & Auth (TLS 1.2) |
|
| Encryption & Auth (TLS 1.2) |
|
||||||
|-----------------------------|
|
|-----------------------------|
|
||||||
| TCP |
|
| TCP |
|
||||||
|-----------------------------|
|
|-----------------------------|
|
||||||
v ... v
|
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
|
The encryption and authentication layer SHALL use TLS 1.2 or a higher
|
||||||
revision. A strong cipher suite SHALL be used, with "strong cipher
|
revision. A strong cipher suite SHALL be used, with "strong cipher
|
||||||
suite" being defined as being without known weaknesses and providing
|
suite" being defined as being without known weaknesses and providing
|
||||||
|
@ -6,7 +6,6 @@ package protocol
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"compress/flate"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@ -78,14 +77,12 @@ type rawConnection struct {
|
|||||||
receiver Model
|
receiver Model
|
||||||
state int
|
state int
|
||||||
|
|
||||||
reader io.ReadCloser
|
cr *countingReader
|
||||||
cr *countingReader
|
xr *xdr.Reader
|
||||||
xr *xdr.Reader
|
|
||||||
|
|
||||||
writer io.WriteCloser
|
cw *countingWriter
|
||||||
cw *countingWriter
|
wb *bufio.Writer
|
||||||
wb *bufio.Writer
|
xw *xdr.Writer
|
||||||
xw *xdr.Writer
|
|
||||||
|
|
||||||
awaiting []chan asyncResult
|
awaiting []chan asyncResult
|
||||||
awaitingMut sync.Mutex
|
awaitingMut sync.Mutex
|
||||||
@ -113,21 +110,15 @@ func NewConnection(nodeID NodeID, reader io.Reader, writer io.Writer, receiver M
|
|||||||
cr := &countingReader{Reader: reader}
|
cr := &countingReader{Reader: reader}
|
||||||
cw := &countingWriter{Writer: writer}
|
cw := &countingWriter{Writer: writer}
|
||||||
|
|
||||||
flrd := flate.NewReader(cr)
|
rb := bufio.NewReader(cr)
|
||||||
flwr, err := flate.NewWriter(cw, flate.BestSpeed)
|
wb := bufio.NewWriter(cw)
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
wb := bufio.NewWriter(flwr)
|
|
||||||
|
|
||||||
c := rawConnection{
|
c := rawConnection{
|
||||||
id: nodeID,
|
id: nodeID,
|
||||||
receiver: nativeModel{receiver},
|
receiver: nativeModel{receiver},
|
||||||
state: stateInitial,
|
state: stateInitial,
|
||||||
reader: flrd,
|
|
||||||
cr: cr,
|
cr: cr,
|
||||||
xr: xdr.NewReader(flrd),
|
xr: xdr.NewReader(rb),
|
||||||
writer: flwr,
|
|
||||||
cw: cw,
|
cw: cw,
|
||||||
wb: wb,
|
wb: wb,
|
||||||
xw: xdr.NewWriter(wb),
|
xw: xdr.NewWriter(wb),
|
||||||
@ -485,10 +476,6 @@ func (c *rawConnection) flush() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if f, ok := c.writer.(flusher); ok {
|
|
||||||
return f.Flush()
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user