static void destructor(void *arg) { struct sipsess_sock *sock = arg; mem_deref(sock->lsnr_resp); mem_deref(sock->lsnr_req); hash_flush(sock->ht_sess); mem_deref(sock->ht_sess); hash_flush(sock->ht_ack); mem_deref(sock->ht_ack); }
/** * Close all SIP Sessions * * @param sock SIP Session socket */ void sipsess_close_all(struct sipsess_sock *sock) { if (!sock) return; hash_flush(sock->ht_sess); }
static void destructor(void *arg) { struct request * request = arg; mem_deref(request->tcp); if(request->ssl) mem_deref(request->ssl); mem_deref(request->host); mem_deref(request->path); hash_flush(request->hdrht); mem_deref(request->hdrht); mem_deref(request->response); if(request->auth) request->auth = mem_deref(request->auth); if(request->body) request->body = mem_deref(request->body); if(request->post) request->post = mem_deref(request->post); list_flush(&request->cachel); list_flush(&request->addrl); list_flush(&request->srvl); DEBUG_INFO("dealloc connection\n"); }
static void destructor(void *arg) { struct turnd *turnd = (struct turnd *)arg; hash_flush(turnd->ht_alloc); mem_deref(turnd->ht_alloc); }
static void chanlist_destructor(void *arg) { struct chanlist *cl = arg; hash_flush(cl->ht_numb); mem_deref(cl->ht_numb); mem_deref(cl->ht_peer); }
/** * Flush all transports of a SIP stack instance * * @param sip SIP stack instance */ void sip_transp_flush(struct sip *sip) { if (!sip) return; hash_flush(sip->ht_conn); list_flush(&sip->transpl); }
static void destructor(void *arg) { struct sip_msg *msg = arg; list_flush(&msg->hdrl); hash_flush(msg->hdrht); mem_deref(msg->hdrht); mem_deref(msg->sock); mem_deref(msg->mb); }
static void destructor(void *arg) { struct tls_sock *ts = arg; hash_flush(ts->ht_conn); mem_deref(ts->ht_conn); mem_deref(ts->uh); mem_deref(ts->us); mem_deref(ts->tls); }
static void tcp_estab_handler(void *arg) { DEBUG_INFO("connection established\n"); int ok; struct request * request = arg; struct mbuf *mb; char CN[256]; if(request->secure) { ok = tls_verify_cert(request->ssl, CN, sizeof(CN)); if(ok!=0) goto fail; DEBUG_INFO("https CN %s\n", CN); ok = strcmp(request->host, CN); if(ok!=0) goto fail; } mb = mbuf_alloc(1024); mbuf_printf(mb, "%s %s HTTP/1.1\r\n", request->meth, request->path); mbuf_printf(mb, "Host: %s\r\n", request->host); write_auth(request, mb); mbuf_write_str(mb, "Connection: close\r\n"); hash_apply(request->hdrht, hdr_write, mb); hash_flush(request->hdrht); if(request->post) { request->post->pos = 0; mbuf_printf(mb, "Content-Length: %d\r\n", mbuf_get_left(request->post)); if(request->form) mbuf_printf(mb, "Content-Type: " "application/x-www-form-urlencoded\r\n"); mbuf_printf(mb, "\r\n"); mbuf_write_mem(mb, mbuf_buf(request->post), mbuf_get_left(request->post)); } else { mbuf_write_str(mb, "\r\n"); } mb->pos = 0; tcp_send(request->tcp, mb); mem_deref(mb); return; fail: DEBUG_WARNING("ssl fail %p %d\n", request->app->tls, ok); }
static void dnsc_destructor(void *data) { struct dnsc *dnsc = data; (void)hash_apply(dnsc->ht_query, query_close_handler, NULL); hash_flush(dnsc->ht_tcpconn); mem_deref(dnsc->ht_tcpconn); mem_deref(dnsc->ht_query); mem_deref(dnsc->us); }
static void report(struct tcuplinks *ups, struct list* upl) { upd(ups, upl); if(ups->data_c) { hash_flush(ups->data_c); ups->data_c = mem_deref(ups->data_c); } ups->data_c = ups->uris_c; ups->uris_c = NULL; }
static int module_close(void) { hash_flush(turnd.ht_alloc); turnd.ht_alloc = mem_deref(turnd.ht_alloc); restund_cmd_unsubscribe(&cmd_turnstats); restund_cmd_unsubscribe(&cmd_turn); restund_stun_unregister_handler(&stun); restund_debug("turn: module closed\n"); return 0; }
static void sess_destructor(void *data) { struct rtcp_sess *sess = data; if (sess->cname) (void)send_bye_packet(sess); tmr_cancel(&sess->tmr); mem_deref(sess->cname); hash_flush(sess->members); mem_deref(sess->members); mem_deref(sess->lock); }
static void destructor(void *arg) { struct sip *sip = arg; if (sip->closing) { sip->closing = false; mem_ref(sip); if (sip->exith) sip->exith(sip->arg); return; } sip_request_close(sip); sip_request_close(sip); hash_flush(sip->ht_ctrans); mem_deref(sip->ht_ctrans); hash_flush(sip->ht_strans); hash_clear(sip->ht_strans_mrg); mem_deref(sip->ht_strans); mem_deref(sip->ht_strans_mrg); hash_flush(sip->ht_conn); mem_deref(sip->ht_conn); hash_flush(sip->ht_udpconn); mem_deref(sip->ht_udpconn); list_flush(&sip->transpl); list_flush(&sip->lsnrl); mem_deref(sip->software); mem_deref(sip->dnsc); mem_deref(sip->stun); }
static void destructor(void *arg) { struct turnc *turnc = arg; if (turnc->allocated) (void)refresh_request(turnc, 0, true, NULL, NULL); tmr_cancel(&turnc->tmr); mem_deref(turnc->ct); hash_flush(turnc->perms); mem_deref(turnc->perms); mem_deref(turnc->chans); mem_deref(turnc->username); mem_deref(turnc->password); mem_deref(turnc->nonce); mem_deref(turnc->realm); mem_deref(turnc->stun); mem_deref(turnc->uh); mem_deref(turnc->sock); }