mirror of
https://github.com/soypat/lneto.git
synced 2026-09-02 12:59:04 +00:00
fix codecov yaml
This commit is contained in:
+1
-15
@@ -2,7 +2,6 @@ package tcp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/soypat/lneto/internal"
|
||||
)
|
||||
@@ -18,9 +17,6 @@ type ringTx struct {
|
||||
rawbuf []byte
|
||||
// packets contains
|
||||
packets []ringidx
|
||||
// _firstPkt is the index of the oldest packet in the packets field.
|
||||
// _firstPkt int
|
||||
// _lastPkt int
|
||||
// unsentOff is the offset of start of unsent data into rawbuf.
|
||||
unsentoff int
|
||||
// unsentend is the offset of end of unsent data in rawbuf.
|
||||
@@ -38,9 +34,7 @@ type ringidx struct {
|
||||
end int
|
||||
// seq is the sequence number of the packet.
|
||||
seq Value
|
||||
t time.Time
|
||||
// acked flags if this packet has been acknowledged. Useful for SACK (selective acknowledgement)
|
||||
// acked bool
|
||||
// time is a measure of the instant of time message was sent at.
|
||||
}
|
||||
|
||||
// Reset resets the RingTx's internal state to use buf as the main ring buffer and creates or reuses
|
||||
@@ -130,14 +124,6 @@ func (tx *ringTx) MakePacket(b []byte) (int, Value, error) {
|
||||
return n, seq, nil
|
||||
}
|
||||
|
||||
func (tx *ringTx) packetRing(i int) internal.Ring {
|
||||
pkt := tx.packets[i]
|
||||
if pkt.off < 0 {
|
||||
return internal.Ring{}
|
||||
}
|
||||
return tx.ring(pkt.off, pkt.end)
|
||||
}
|
||||
|
||||
// RecvSegment processes an incoming segment and updates the sent packet queue
|
||||
func (tx *ringTx) RecvACK(ack Value) error {
|
||||
for i := range tx.packets {
|
||||
|
||||
+5
-1
@@ -34,7 +34,7 @@ func TestTxQueue_SequentialMessages(t *testing.T) {
|
||||
t.Fatalf("want %d unsent buffered, got %d", unsent, len(msg))
|
||||
}
|
||||
sent := rtx.BufferedSent()
|
||||
if sent > 0 {
|
||||
if sent != 0 {
|
||||
t.Fatalf("want 0 bytes sent, got %d", sent)
|
||||
}
|
||||
n, seq, err := rtx.MakePacket(data[:])
|
||||
@@ -47,6 +47,10 @@ func TestTxQueue_SequentialMessages(t *testing.T) {
|
||||
} else if seq != prevSeq {
|
||||
t.Fatalf("want seq %d, got %d", prevSeq, seq)
|
||||
}
|
||||
sent = rtx.BufferedSent()
|
||||
if sent != len(msg) {
|
||||
t.Fatalf("want %d sent, got %d", len(msg), sent)
|
||||
}
|
||||
prevSeq += Value(n)
|
||||
err = rtx.RecvACK(prevSeq)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user