Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt authored and MarcoPolo committed Apr 5, 2024
1 parent b93cd31 commit 7bb5722
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion association.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ var (
ErrChunkTypeUnhandled = errors.New("unhandled chunk type")
ErrHandshakeInitAck = errors.New("handshake failed (INIT ACK)")
ErrHandshakeCookieEcho = errors.New("handshake failed (COOKIE ECHO)")
ErrTooManyReconfigRequests = errors.New("too many outstanding reconfig requests")
)

const (
Expand Down Expand Up @@ -2152,7 +2153,7 @@ func (a *Association) handleReconfigParam(raw param) (*packet, error) {
// So, if the Re-configuration Timer is running and the RE-CONFIG chunk
// contains at least one request parameter, the chunk MUST be buffered.
// chrome: https://chromium.googlesource.com/external/webrtc/+/refs/heads/main/net/dcsctp/socket/stream_reset_handler.cc#271
return nil, fmt.Errorf("too many outstanding reconfig requests: %d", len(a.reconfigRequests))
return nil, fmt.Errorf("%w: %d", ErrTooManyReconfigRequests, len(a.reconfigRequests))
}
a.reconfigRequests[p.reconfigRequestSequenceNumber] = p
resp := a.resetStreamsIfAny(p)
Expand Down
5 changes: 3 additions & 2 deletions association_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3423,8 +3423,6 @@ func TestAssociation_ReconfigRequestsLimited(t *testing.T) {
}()

a1, a2 := <-a1chan, <-a2chan
defer a1.Close()
defer a2.Close()

writeStream, err := a1.OpenStream(1, PayloadTypeWebRTCString)
require.NoError(t, err)
Expand Down Expand Up @@ -3467,4 +3465,7 @@ func TestAssociation_ReconfigRequestsLimited(t *testing.T) {
a2.lock.RLock()
require.LessOrEqual(t, len(a2.reconfigRequests), maxReconfigRequests)
a2.lock.RUnlock()

require.NoError(t, a1.Close())
require.NoError(t, a2.Close())
}

0 comments on commit 7bb5722

Please sign in to comment.