diff --git a/go.mod b/go.mod index 77f9a73..8fe5207 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.12 require ( github.com/ahmetb/go-linq/v3 v3.1.0 github.com/dgraph-io/badger v1.6.0 - github.com/elliotcourant/buffers v1.0.0 + github.com/elliotcourant/buffers v0.0.0-20191201042100-3d9daf6f332b github.com/elliotcourant/timber v0.0.0-20190831033938-85b1f62dde82 github.com/hashicorp/go-hclog v0.9.2 github.com/hashicorp/raft v1.1.1 diff --git a/go.sum b/go.sum index 3ff5dc3..9610ade 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,8 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczC github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elliotcourant/buffers v0.0.0-20190811025309-24fdba97ca9b h1:hnBfbE6sWwWGpCiFwSWvzsOxxuEujfmk+xYr+a98pHc= -github.com/elliotcourant/buffers v0.0.0-20190811025309-24fdba97ca9b/go.mod h1:9+oLElsEQnueTyoq0dyr6RiJwELNE+YtLXh4BNAsnKg= +github.com/elliotcourant/buffers v0.0.0-20191201042100-3d9daf6f332b h1:35ZXu2t4bU1snDlC1BwLAZ7f425Pxz+abdRd9hhzflU= +github.com/elliotcourant/buffers v0.0.0-20191201042100-3d9daf6f332b/go.mod h1:9+oLElsEQnueTyoq0dyr6RiJwELNE+YtLXh4BNAsnKg= github.com/elliotcourant/timber v0.0.0-20190831033938-85b1f62dde82 h1:rAx7YfNNnDIik1N7Zj/lQjt2b/5aejQLGQEc+v18t7M= github.com/elliotcourant/timber v0.0.0-20190831033938-85b1f62dde82/go.mod h1:Qt+GcRn3FBq5YMmfc+MtIgGyN4fq3lZaRNYDlkOeigg= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= diff --git a/raft_wire.go b/raft_wire.go index 222f43f..79d7b7b 100644 --- a/raft_wire.go +++ b/raft_wire.go @@ -153,7 +153,6 @@ type serverWireBase struct { } func (r *serverWireBase) Send(msg serverMessage) error { - // time.Sleep(time.Millisecond * 1) _, err := r.w.Write(writeWireMessage(msg)) return err } @@ -167,7 +166,7 @@ func (r *serverWireBase) Receive() (clientMessage, error) { buf := buffers.NewBytesReader(header) r.msgType = buf.NextUint8() - r.bodyLen = buf.NextInt32() + r.bodyLen = buf.NextInt32() - 4 } msgBody, err := r.cr.Next(int(r.bodyLen)) @@ -251,7 +250,6 @@ func (r *clientWireBase) handshake(intention handshakeIntention) error { } func (r *clientWireBase) Send(msg clientMessage) error { - // time.Sleep(time.Millisecond * 1) _, err := r.w.Write(writeWireMessage(msg)) return err } @@ -265,7 +263,7 @@ func (r *clientWireBase) Receive() (serverMessage, error) { buf := buffers.NewBytesReader(header) r.msgType = buf.NextUint8() - r.bodyLen = buf.NextInt32() + r.bodyLen = buf.NextInt32() - 4 } msgBody, err := r.cr.Next(int(r.bodyLen))