Skip to content

Commit

Permalink
Fixed acknowledgement logic in dmsg.Transport's Read method.
Browse files Browse the repository at this point in the history
  • Loading branch information
林志宇 committed Jun 19, 2019
1 parent 4cfde04 commit ab70929
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/dmsg/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (tp *Transport) Read(p []byte) (n int, err error) {
startRead:
tp.bufMx.Lock()
n, err = tp.buf.Read(p)
if tp.bufSize -= n; tp.bufSize < tpBufCap {
if tp.bufSize -= n; tp.bufSize < tpBufCap && len(tp.ackBuf) > 0 {
acks := tp.ackBuf
tp.ackBuf = make([]byte, 0, tpAckCap)
go func() {
Expand Down

0 comments on commit ab70929

Please sign in to comment.