| 281 | } |
| 282 | |
| 283 | static void dm_cond_signal(struct dm_cond *cond) |
| 284 | { |
| 285 | LM_INFO("singalling %p/%d\n", cond, cond->type); |
| 286 | switch (cond->type) { |
| 287 | case DM_TYPE_EVENT: |
| 288 | dm_cond_ref(cond); |
| 289 | if (ipc_send_rpc(cond->sync.event.pid, dm_cond_event_resume, cond) < 0) { |
| 290 | LM_ERR("could not resume async MI command!\n"); |
| 291 | dm_cond_unref(cond); |
| 292 | } |
| 293 | break; |
| 294 | case DM_TYPE_COND: |
| 295 | /* signal the blocked SIP worker that the auth result is available! */ |
| 296 | pthread_mutex_lock(&cond->sync.cond.mutex); |
| 297 | pthread_cond_signal(&cond->sync.cond.cond); |
| 298 | pthread_mutex_unlock(&cond->sync.cond.mutex); |
| 299 | break; |
| 300 | case DM_TYPE_CB: |
| 301 | if (cond->sync.cb.f) |
| 302 | cond->sync.cb.f(NULL, &cond->rpl, cond->sync.cb.p); |
| 303 | break; |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | |
| 308 | static int dm_auth_reply(struct msg **_msg, struct avp * avp, struct session * sess, void * data, enum disp_action * act) |
no test coverage detected