diff options
author | Mikhail Faraponov <11322032+moredure@users.noreply.github.com> | 2021-10-18 13:45:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-18 13:45:56 +0300 |
commit | 4e989ad8ae789c64ccc38178129e2c238ede8f13 (patch) | |
tree | 32295d90378e329938989ae75cc0c5ba2cee2bce | |
parent | f2f512db170db82ad41590c4ba3b7718b13317d2 (diff) |
Update block_write_stream.go
-rw-r--r-- | internal/transfer/block_write_stream.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/transfer/block_write_stream.go b/internal/transfer/block_write_stream.go index 9c9d208..24c6e99 100644 --- a/internal/transfer/block_write_stream.go +++ b/internal/transfer/block_write_stream.go @@ -55,7 +55,7 @@ type blockWriteStream struct { offset int64 closed bool - packets chan outboundPacket + packets chan int seqno int ackError error @@ -163,7 +163,7 @@ func (s *blockWriteStream) finish() error { checksums: []byte{}, data: []byte{}, } - s.packets <- lastPacket + s.packets <- lastPacket.seqno err := s.writePacket(lastPacket) if err != nil { @@ -191,7 +191,7 @@ func (s *blockWriteStream) flush(force bool) error { for s.buf.Len() > 0 && (force || s.buf.Len() >= outboundPacketSize) { packet := s.makePacket() - s.packets <- packet + s.packets <- packet.seqno s.offset += int64(len(packet.data)) s.seqno++ @@ -285,7 +285,7 @@ Acks: } } - if seqno != p.seqno { + if seqno != p { s.ackError = ErrInvalidSeqno break Acks } |