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

@@ -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
}