Opened 9 years ago
Closed 9 years ago
#1898 closed defect (fixed)
Transport may never gets destroyed when connected event comes while transport is shutting down
Reported by: | nanang | Owned by: | bennylp |
---|---|---|---|
Priority: | normal | Milestone: | release-2.5 |
Component: | pjsip | Version: | trunk |
Keywords: | Cc: | ||
Backport to 1.x milestone: | Backported: | no |
Description
Changeset r5000 tries to avoid transport-state "Connected" event getting propagated to application after the transport is shutdown. However it introduces a bug that may prevent the transport from getting destroyed because reference counter may never reaches zero.
Sample scenario in function stateless_send_transport_cb() in sip_util.c:
- pjsip_endpt_acquire_transport2() is invoked which creates a new TCP/TLS transport client. Note that this function also adds reference counter, and starts try to connect to remote.
- pjsip_transport_send() is invoked with callback set to itself (i.e: send_response_transport_cb()).
- Application (not sip_util.c) invokes pjsip_transport_shutdown() to this transport, e.g: because of IP change on iOS to close the TCP socket immediately (to avoid spurious wakeups, see #1482).
- Connected event comes from the ioqueue, TCP/TLS transport see that transport is being shutdown, so it simply returns (see r5000) without notifying application about the sending status.
- stateless_send_transport_cb() never gets notification of the sending status, so the transport reference counter never reaches zero.
Change History (1)
comment:1 Changed 9 years ago by nanang
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
In 5200: