Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions association.go
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,8 @@
return nil
}

a.lock.Lock()
defer a.lock.Unlock()
a.handleChunksStart()

for _, c := range pkt.chunks {
Expand Down Expand Up @@ -3227,35 +3229,29 @@
return []*packet{p}
}

// caller must hold a.lock

Check failure on line 3232 in association.go

View workflow job for this annotation

GitHub Actions / lint / Go

Comment should end in a period (godot)
func (a *Association) handleChunksStart() {
a.lock.Lock()
defer a.lock.Unlock()

a.stats.incPacketsReceived()

a.delayedAckTriggered = false
a.immediateAckTriggered = false
}

// caller must hold a.lock

Check failure on line 3240 in association.go

View workflow job for this annotation

GitHub Actions / lint / Go

Comment should end in a period (godot)
func (a *Association) handleChunksEnd() {
a.lock.Lock()
defer a.lock.Unlock()

if a.immediateAckTriggered {
a.ackState = ackStateImmediate
a.ackTimer.stop()
a.awakeWriteLoop()
} else if a.delayedAckTriggered {
} else if a.delayedAckTriggered && a.ackState != ackStateImmediate { // don't cancel the scheduled ACK
// Will send delayed ack in the next ack timeout
a.ackState = ackStateDelay
a.ackTimer.start()
}
}

// caller must hold a.lock

Check failure on line 3253 in association.go

View workflow job for this annotation

GitHub Actions / lint / Go

Comment should end in a period (godot)
func (a *Association) handleChunk(receivedPacket *packet, receivedChunk chunk) error { //nolint:cyclop
a.lock.Lock()
defer a.lock.Unlock()

var packets []*packet
var err error

Expand Down
Loading