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

Function dm_update_unreplied_req

modules/aaa_diameter/dm_impl.c:169–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167
168
169static inline void dm_update_unreplied_req(struct msg *req)
170{
171 struct list_head *it, *aux;
172 struct fd_msg_list *rit, *ml;
173 unsigned int now = get_ticks();
174
175 lock_get(&dm_unreplied_req_lk);
176
177 list_for_each_safe (it, aux, &dm_unreplied_req) {
178 rit = list_entry(it, struct fd_msg_list, list);
179
180 if (rit->timeout_jf <= now) {
181 LM_DBG("Diameter request timeout (unhandled), cleaning up\n");
182 list_del(&rit->list);
183 fd_msg_free(rit->req);
184 pkg_free(rit);
185 } else {
186 break;
187 }
188 }
189
190 lock_release(&dm_unreplied_req_lk);
191
192 ml = pkg_malloc(sizeof *ml);
193 if (!ml) {
194 LM_ERR("oom\n");
195 return;
196 }
197 memset(ml, 0, sizeof *ml);
198
199 ml->req = req;
200 ml->timeout_jf = get_ticks() + dm_unreplied_req_timeout;
201
202 lock_get(&dm_unreplied_req_lk);
203 list_add_tail(&ml->list, &dm_unreplied_req);
204 lock_release(&dm_unreplied_req_lk);
205}
206
207
208int dm_remove_unreplied_req(struct msg *req)

Callers 1

dm_receive_reqFunction · 0.85

Calls 7

get_ticksFunction · 0.85
lock_getFunction · 0.85
list_for_each_safeFunction · 0.85
list_delFunction · 0.85
lock_releaseFunction · 0.85
list_add_tailFunction · 0.85
list_entryClass · 0.50

Tested by

no test coverage detected