MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / free_cell

Function free_cell

modules/tm/h_table.c:116–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114
115
116void free_cell( struct cell* dead_cell )
117{
118 char *b;
119 int i;
120 struct sip_msg *rpl;
121 struct totag_elem *tt, *foo;
122 struct proxy_l *p;
123 struct ua_client *uac;
124
125 if ( has_tran_tmcbs( dead_cell, TMCB_TRANS_DELETED) )
126 run_trans_callbacks( TMCB_TRANS_DELETED, dead_cell, 0, 0, 0);
127
128 empty_tmcb_list(&dead_cell->tmcb_hl);
129
130 context_destroy(CONTEXT_TRAN, context_of(dead_cell));
131
132 release_cell_lock( dead_cell );
133
134 shm_lock();
135
136 /* UA Server */
137 if ( dead_cell->uas.request )
138 free_cloned_msg_unsafe( dead_cell->uas.request );
139
140 if ( dead_cell->uas.response.buffer.s )
141 shm_free_bulk( dead_cell->uas.response.buffer.s );
142
143 /* UA Clients */
144 for ( i =0 ; i<dead_cell->nr_of_outgoings; i++ )
145 {
146 uac = & TM_BRANCH( dead_cell, i);
147 /* retransmission buffer */
148 if ( (b=uac->request.buffer.s) )
149 shm_free_bulk( b );
150 b=uac->local_cancel.buffer.s;
151 if (b!=0 && b!=BUSY_BUFFER)
152 shm_free_bulk( b );
153 rpl=uac->reply;
154 if (rpl && rpl!=FAKED_REPLY && rpl->msg_flags&FL_SHM_CLONE) {
155 free_cloned_msg_unsafe( rpl );
156 }
157 if ( (p=uac->proxy)!=NULL ) {
158 if ( p->host.h_addr_list )
159 shm_free_bulk( p->host.h_addr_list );
160 if ( p->dn ) {
161 if ( p->dn->kids )
162 shm_free_bulk( p->dn->kids );
163 shm_free_bulk( p->dn );
164 }
165 shm_free_bulk(p);
166 }
167
168 _clean_branch( *uac, shm_free_bulk, destroy_avp_list_bulk);
169
170 if (uac->on_reply)
171 shm_free_bulk(uac->on_reply);
172 }
173

Callers 4

t_uacFunction · 0.85
free_hash_tableFunction · 0.85
delete_cellFunction · 0.85
unlink_timer_listsFunction · 0.85

Calls 6

run_trans_callbacksFunction · 0.85
empty_tmcb_listFunction · 0.85
context_destroyFunction · 0.85
release_cell_lockFunction · 0.85
shm_free_bulkFunction · 0.85
destroy_avp_list_bulkFunction · 0.85

Tested by

no test coverage detected