Skip to content

Commit

Permalink
Make sure session is locked while processing cancel.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Oct 25, 2024
1 parent 70741e4 commit 756ca19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sippy/ua.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,15 @@ REQ_LOOP:
if self.pr_rel {
t.SetPrackCBs(self.RecvPRACK, disc_fn)
}
cancel_cb := self.state.RecvCancel
cancel_fn := func(rtime *sippy_time.MonoTime, req sippy_types.SipRequest) {
self.session_lock.Lock()
cancel_cb(rtime, req)
self.session_lock.Unlock()
}
return &sippy_types.Ua_context{
Response : nil,
CancelCB : self.state.RecvCancel,
CancelCB : cancel_fn,
NoAckCB : disc_fn,
}
} else {
Expand Down

0 comments on commit 756ca19

Please sign in to comment.