示例#1
0
static void destructor(void *arg)
{
	struct sip_request *req = arg;

	if (req->reqp && req->stateful) {
		/* user does deref before request has completed */
		*req->reqp = NULL;
		req->reqp  = NULL;
		req->sendh = NULL;
		req->resph = NULL;
		sip_request_cancel(mem_ref(req));
		return;
	}

	list_flush(&req->cachel);
	list_flush(&req->addrl);
	list_flush(&req->srvl);
	list_unlink(&req->le);
	mem_deref(req->dnsq);
	mem_deref(req->dnsq2);
	mem_deref(req->ct);
	mem_deref(req->met);
	mem_deref(req->uri);
	mem_deref(req->host);
	mem_deref(req->mb);
}
示例#2
0
文件: http.c 项目: muromec/rehttp
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");
}
示例#3
0
void ows_layer_storage_flush(ows_layer_storage * storage, FILE * output)
{
  assert(storage);
  assert(output);

  if (storage->schema) {
    fprintf(output, "schema: ");
    buffer_flush(storage->schema, output);
    fprintf(output, "\n");
  }

  if (storage->table) {
    fprintf(output, "table: ");
    buffer_flush(storage->table, output);
    fprintf(output, "\n");
  }

  if (storage->geom_columns) {
    fprintf(output, "geom_columns: ");
    list_flush(storage->geom_columns, output);
    fprintf(output, "\n");
  }

  fprintf(output, "srid: %i\n", storage->srid);
  fprintf(output, "is_degree: %i\n", storage->is_degree?1:0);

  if (storage->pkey) {
    fprintf(output, "pkey: ");
    buffer_flush(storage->pkey, output);
    fprintf(output, "\n");
  }

  fprintf(output, "pkey_column_number: %i\n", storage->pkey_column_number);

  if (storage->pkey_sequence) {
    fprintf(output, "pkey_sequence: ");
    buffer_flush(storage->pkey_sequence, output);
    fprintf(output, "\n");
  }

  if (storage->pkey_default) {
    fprintf(output, "pkey_default: ");
    buffer_flush(storage->pkey_default, output);
    fprintf(output, "\n");
  }

  if (storage->attributes) {
    fprintf(output, "attributes: ");
    array_flush(storage->attributes, output);
    fprintf(output, "\n");
  }

  if (storage->not_null_columns) {
    fprintf(output, "not_null_columns: ");
    list_flush(storage->not_null_columns, output);
    fprintf(output, "\n");
  }

}
示例#4
0
static void conn_destructor(void *data)
{
	struct tcp_conn *tc = data;

	list_flush(&tc->helpers);
	list_flush(&tc->sendq);

	if (tc->fdc >= 0) {
		fd_close(tc->fdc);
		(void)close(tc->fdc);
	}
}
示例#5
0
文件: transp.c 项目: Issic47/libre
static void conn_destructor(void *arg)
{
	struct sip_conn *conn = arg;

	tmr_cancel(&conn->tmr_ka);
	tmr_cancel(&conn->tmr);
	list_flush(&conn->kal);
	list_flush(&conn->ql);
	hash_unlink(&conn->he);
	mem_deref(conn->sc);
	mem_deref(conn->tc);
	mem_deref(conn->mb);
}
示例#6
0
static void icem_destructor(void *data)
{
	struct icem *icem = data;

	list_unlink(&icem->le);
	tmr_cancel(&icem->tmr_pace);
	list_flush(&icem->compl);
	list_flush(&icem->validl);
	list_flush(&icem->checkl);
	list_flush(&icem->lcandl);
	list_flush(&icem->rcandl);
	mem_deref(icem->stun);
	mem_deref(icem->rufrag);
	mem_deref(icem->rpwd);
}
示例#7
0
static void destructor(void *arg)
{
	struct http_msg *msg = arg;

	list_flush(&msg->hdrl);
	mem_deref(msg->mb);
}
示例#8
0
文件: pcp.c 项目: GGGO/baresip
static void session_destructor(void *arg)
{
	struct mnat_sess *sess = arg;

	list_unlink(&sess->le);
	list_flush(&sess->medial);
}
示例#9
0
void sip_auth_reset(struct sip_auth *auth)
{
	if (!auth)
		return;

	list_flush(&auth->realml);
}
示例#10
0
文件: ice.c 项目: Issic47/libre
static void ice_destructor(void *arg)
{
	struct ice *ice = arg;

	list_flush(&ice->ml);
	mem_deref(ice->stun);
}
示例#11
0
文件: ausrc.c 项目: alfredh/baresip
static void destructor(void *arg)
{
	struct ausrc *as = arg;

	list_flush(&as->dev_list);
	list_unlink(&as->le);
}
示例#12
0
/*main program*/
int main(int argc, char **argv)	{
	char input_word[256];
	int c;
	int option_index = 0;
	int count = -1;
	pthread _t print_thread;
	static struct option long_option[] = {
		{"count",  required_argument, 0, 'c'},
		{0,         0,                 0,  0 }
        };
	while (1) {
		c = getopt_long(argc, argv, "c:", long_option,&option_index);
		if (c == -1) break;

		switch (c) {
			case'c':
			count = atoi(optarg);
			break;
		}
	}

   	 /* Start new thread for printing */
    	pthread_create(&print_thread, NULL, print_func, NULL);

	fprintf(stderr, "Accepting %i input strings\n", count);

	while (scanf("%256s", input_word) != EOF) {
		add_to_list(input_word);
		if(!--count) break;
	}

	list_flush();

	return 0;
}
示例#13
0
文件: cmd.c 项目: czarkoff/baresip
void cmd_close(struct commands *commands)
{
	if (!commands)
		return;

	list_flush(&commands->cmdl);
}
示例#14
0
文件: message.c 项目: alfredh/baresip
static void destructor(void *data)
{
	struct message *message = data;

	list_flush(&message->lsnrl);
	mem_deref(message->sip_lsnr);
}
static void flow_destructor(void *arg)
{
	struct flow *flow = arg;
	struct call *call = flow->call;

	info("flowmgr(%p): call(%p): flow(%p -- %s) destructor\n",
	     call->fm, call, flow, flow->flowid);

	flow->cp = mem_deref(flow->cp);
	call_remove_conf_part(call, flow);
	delete_flow(flow);

	list_unlink(&flow->le);
	release_mediaflow(flow);

	flow->flowid = mem_deref(flow->flowid);
	flow->remoteid = mem_deref(flow->remoteid);

	if (flow->userflow) {
		userflow_set_flow(flow->userflow, NULL);
		dict_remove(call->users, flow->userflow->userid);
		flow->userflow = mem_deref(flow->userflow);
	}

	list_flush(&flow->pendingl);
}
示例#16
0
文件: mwi.c 项目: qwertos/baresip
static int module_close(void)
{
    tmr_cancel(&tmr);
    list_flush(&mwil);

    return 0;
}
示例#17
0
static void stop_tx(struct autx *tx, struct audio *a)
{
	if (!tx || !a)
		return;

	switch (a->cfg.txmode) {

#ifdef HAVE_PTHREAD
	case AUDIO_MODE_THREAD:
	case AUDIO_MODE_THREAD_REALTIME:
		if (tx->u.thr.run) {
			tx->u.thr.run = false;
			pthread_join(tx->u.thr.tid, NULL);
		}
		break;
#endif
	case AUDIO_MODE_TMR:
		tmr_cancel(&tx->u.tmr);
		break;

	default:
		break;
	}

	/* audio source must be stopped first */
	tx->ausrc = mem_deref(tx->ausrc);
	tx->aubuf = mem_deref(tx->aubuf);

	list_flush(&tx->filtl);
}
示例#18
0
文件: dnssrv.c 项目: GGGO/baresip
static void destructor(void *arg)
{
	struct dns_server *srv = arg;

	list_flush(&srv->rrl);
	mem_deref(srv->us);
}
示例#19
0
static int module_close(void)
{
    cmd_unregister(baresip_commands(), cmdv);
    list_flush(contact_list(baresip_contacts()));

    return 0;
}
示例#20
0
static void udp_destructor(void *data)
{
	struct udp_sock *us = (struct udp_sock *)data;

	list_flush(&us->helpers);

	delete us->cus;
}
示例#21
0
static int module_close(void)
{
	uag_event_unregister(ua_event_handler);
	tmr_cancel(&tmr);
	list_flush(&mwil);

	return 0;
}
示例#22
0
文件: transp.c 项目: Issic47/libre
/**
 * 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);
}
示例#23
0
文件: contact.c 项目: GGGO/baresip
/**
 * @param contacts Contacts container
 *
 * Close the contacts sub-system
 */
void contact_close(struct contacts *contacts)
{
	if (!contacts)
		return;

	hash_clear(contacts->cht);
	contacts->cht = mem_deref(contacts->cht);
	list_flush(&contacts->cl);
}
示例#24
0
static void auth_destructor(void *arg)
{
	struct sip_auth *auth = arg;

	if (auth->ref)
		mem_deref(auth->arg);

	list_flush(&auth->realml);
}
示例#25
0
文件: jbuf.c 项目: soramimi/qSIP
static void jbuf_destructor(void *data)
{
	struct jbuf *jb = data;

	jbuf_flush(jb);

	/* Free all frames in the pool list */
	list_flush(&jb->pooll);
}
示例#26
0
static void session_destructor(void *arg)
{
	struct mnat_sess *sess = arg;

	list_flush(&sess->medial);
	mem_deref(sess->dnsq);
	mem_deref(sess->user);
	mem_deref(sess->pass);
}
示例#27
0
int main(int argc, char **argv)
{
	log_options_t opts = LOG_OPTS_STDERR_ONLY;
	update_block_msg_t msg;
	ListIterator itr = NULL;
	char *block_name = NULL;
	int rc = SLURM_SUCCESS;

	log_init(xbasename(argv[0]), opts, SYSLOG_FACILITY_DAEMON, NULL);
	parse_command_line(argc, argv);

	memset(&msg, 0, sizeof(update_block_msg_t));
	if (!all_blocks && (!block_list || !list_count(block_list))) {
		error("you need at least one block to remove.");
		exit(1);
	}

	if (all_blocks) {
		int i=0;
		block_info_msg_t *block_ptr = NULL;
		_get_new_info_block(&block_ptr);
		if (!block_ptr) {
			error("there was no block_ptr filled in.");
			return 1;
		}
		if (block_list)
			list_flush(block_list);
		else
			block_list = list_create(slurm_destroy_char);

		for (i=0; i<block_ptr->record_count; i++) {
			list_append(block_list,
				    xstrdup(block_ptr->
					    block_array[i].bg_block_id));
		}
	}

	itr = list_iterator_create(block_list);
	while ((block_name = list_next(itr))) {
		if (remove_blocks)
			msg.state = BG_BLOCK_NAV;
		else
			msg.state = BG_BLOCK_FREE;
		msg.bg_block_id = block_name;
		rc = slurm_update_block(&msg);
		if (rc != SLURM_SUCCESS)
			error("Error trying to free block %s: %s",
			      block_name, slurm_strerror(rc));
	}
	list_iterator_destroy(itr);
	if (wait_full)
		_check_status();

	FREE_NULL_LIST(block_list);
	info("done");
	return 0;
}
示例#28
0
void sdp_media_rreset(struct sdp_media *m)
{
    int i;

    if (!m)
        return;

    sa_init(&m->raddr, AF_INET);
    sa_init(&m->raddr_rtcp, AF_INET);

    list_flush(&m->rfmtl);
    list_flush(&m->rattrl);

    m->rdir = SDP_SENDRECV;

    for (i=0; i<SDP_BANDWIDTH_MAX; i++)
        m->rbwv[i] = -1;
}
示例#29
0
static void conn_destructor(void *data)
{
	struct tcp_conn *tc = (struct tcp_conn *)data;

	list_flush(&tc->helpers);

	if (tc->ctc)
		delete tc->ctc;
}
示例#30
0
void allocator_reset(struct allocator *allocator)
{
	if (!allocator)
		return;

	tmr_cancel(&allocator->tmr);
	tmr_cancel(&allocator->tmr_ui);
	tmr_cancel(&allocator->tmr_pace);
	list_flush(&allocator->allocl);
}