osmux: Fix CID release for non-enabled connections
Change-Id: If65c70b421476776e20233733722d72aa26d69a8
This commit is contained in:
parent
9aaaab6b3b
commit
85978dadab
|
@ -14,7 +14,7 @@ enum {
|
|||
int osmux_init(int role, struct mgcp_config *cfg);
|
||||
int osmux_enable_conn(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn,
|
||||
struct in_addr *addr, uint16_t port);
|
||||
void osmux_disable_conn(struct mgcp_conn_rtp *conn);
|
||||
void conn_osmux_disable(struct mgcp_conn_rtp *conn);
|
||||
int conn_osmux_allocate_cid(struct mgcp_conn_rtp *conn, int osmux_cid);
|
||||
void conn_osmux_release_cid(struct mgcp_conn_rtp *conn);
|
||||
int osmux_xfrm_to_osmux(char *buf, int buf_len, struct mgcp_conn_rtp *conn);
|
||||
|
|
|
@ -125,7 +125,8 @@ static int mgcp_rtp_conn_init(struct mgcp_conn_rtp *conn_rtp, struct mgcp_conn *
|
|||
/* Cleanup rtp connection struct */
|
||||
static void mgcp_rtp_conn_cleanup(struct mgcp_conn_rtp *conn_rtp)
|
||||
{
|
||||
osmux_disable_conn(conn_rtp);
|
||||
if (mgcp_conn_rtp_is_osmux(conn_rtp))
|
||||
conn_osmux_disable(conn_rtp);
|
||||
mgcp_free_rtp_port(&conn_rtp->end);
|
||||
rate_ctr_group_free(conn_rtp->rate_ctr_group);
|
||||
}
|
||||
|
|
|
@ -487,18 +487,15 @@ int osmux_enable_conn(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn,
|
|||
|
||||
/*! disable OSXMUX circuit for a specified connection.
|
||||
* \param[in] conn connection to disable */
|
||||
void osmux_disable_conn(struct mgcp_conn_rtp *conn)
|
||||
void conn_osmux_disable(struct mgcp_conn_rtp *conn)
|
||||
{
|
||||
if (!conn)
|
||||
return;
|
||||
|
||||
if (conn->osmux.state != OSMUX_STATE_ENABLED)
|
||||
return;
|
||||
OSMO_ASSERT(conn->osmux.state != OSMUX_STATE_DISABLED);
|
||||
|
||||
LOGPCONN(conn->conn, DLMGCP, LOGL_INFO,
|
||||
"Releasing connection %s using Osmux CID %u\n",
|
||||
conn->conn->id, conn->osmux.cid);
|
||||
"Releasing connection using Osmux CID %u\n", conn->osmux.cid);
|
||||
|
||||
if (conn->osmux.state == OSMUX_STATE_ENABLED) {
|
||||
/* We are closing, we don't need pending RTP packets to be transmitted */
|
||||
osmux_xfrm_output_set_tx_cb(&conn->osmux.out, NULL, NULL);
|
||||
osmux_xfrm_output_flush(&conn->osmux.out);
|
||||
|
@ -508,6 +505,8 @@ void osmux_disable_conn(struct mgcp_conn_rtp *conn)
|
|||
conn_osmux_release_cid(conn);
|
||||
osmux_handle_put(conn->osmux.in);
|
||||
}
|
||||
conn_osmux_release_cid(conn);
|
||||
}
|
||||
|
||||
/*! relase OSXMUX cid, that had been allocated to this connection.
|
||||
* \param[in] conn connection with OSMUX cid to release */
|
||||
|
|
Loading…
Reference in New Issue