当前位置: 首页>>代码示例>>C++>>正文


C++ pqueue_free函数代码示例

本文整理汇总了C++中pqueue_free函数的典型用法代码示例。如果您正苦于以下问题:C++ pqueue_free函数的具体用法?C++ pqueue_free怎么用?C++ pqueue_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pqueue_free函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: dtls1_new

int dtls1_new(SSL *s) {
  DTLS1_STATE *d1;

  if (!ssl3_new(s)) {
    return 0;
  }
  d1 = OPENSSL_malloc(sizeof *d1);
  if (d1 == NULL) {
    ssl3_free(s);
    return 0;
  }
  memset(d1, 0, sizeof *d1);

  d1->buffered_messages = pqueue_new();
  d1->sent_messages = pqueue_new();

  if (!d1->buffered_messages || !d1->sent_messages) {
    pqueue_free(d1->buffered_messages);
    pqueue_free(d1->sent_messages);
    OPENSSL_free(d1);
    ssl3_free(s);
    return 0;
  }

  s->d1 = d1;

  /* Set the version to the highest version for DTLS. This controls the initial
   * state of |s->enc_method| and what the API reports as the version prior to
   * negotiation.
   *
   * TODO(davidben): This is fragile and confusing. */
  s->version = DTLS1_2_VERSION;
  return 1;
}
开发者ID:gotomypc,项目名称:tiny-webrtc-gw,代码行数:34,代码来源:d1_lib.c

示例2: DTLS_RECORD_LAYER_new

int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl)
{
    DTLS_RECORD_LAYER *d;

    if ((d = OPENSSL_malloc(sizeof(*d))) == NULL) {
        SSLerr(SSL_F_DTLS_RECORD_LAYER_NEW, ERR_R_MALLOC_FAILURE);
        return 0;
    }

    rl->d = d;

    d->unprocessed_rcds.q = pqueue_new();
    d->processed_rcds.q = pqueue_new();
    d->buffered_app_data.q = pqueue_new();

    if (d->unprocessed_rcds.q == NULL || d->processed_rcds.q == NULL
        || d->buffered_app_data.q == NULL) {
        pqueue_free(d->unprocessed_rcds.q);
        pqueue_free(d->processed_rcds.q);
        pqueue_free(d->buffered_app_data.q);
        OPENSSL_free(d);
        rl->d = NULL;
        return 0;
    }

    return 1;
}
开发者ID:Ana06,项目名称:openssl,代码行数:27,代码来源:rec_layer_d1.c

示例3: dtls1_new

int dtls1_new(SSL *ssl) {
  DTLS1_STATE *d1;

  if (!ssl3_new(ssl)) {
    return 0;
  }
  d1 = OPENSSL_malloc(sizeof *d1);
  if (d1 == NULL) {
    ssl3_free(ssl);
    return 0;
  }
  memset(d1, 0, sizeof *d1);

  d1->buffered_messages = pqueue_new();
  d1->sent_messages = pqueue_new();

  if (!d1->buffered_messages || !d1->sent_messages) {
    pqueue_free(d1->buffered_messages);
    pqueue_free(d1->sent_messages);
    OPENSSL_free(d1);
    ssl3_free(ssl);
    return 0;
  }

  ssl->d1 = d1;

  /* Set the version to the highest supported version.
   *
   * TODO(davidben): Move this field into |s3|, have it store the normalized
   * protocol version, and implement this pre-negotiation quirk in |SSL_version|
   * at the API boundary rather than in internal state. */
  ssl->version = DTLS1_2_VERSION;
  return 1;
}
开发者ID:jianglei12138,项目名称:boringssl,代码行数:34,代码来源:d1_lib.c

示例4: DTLS_RECORD_LAYER_new

int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl)
{
    DTLS_RECORD_LAYER *d;

    if ((d = OPENSSL_malloc(sizeof(*d))) == NULL)
        return (0);

    rl->d = d;

    d->unprocessed_rcds.q = pqueue_new();
    d->processed_rcds.q = pqueue_new();
    d->buffered_app_data.q = pqueue_new();

    if (d->unprocessed_rcds.q == NULL || d->processed_rcds.q == NULL
        || d->buffered_app_data.q == NULL) {
        pqueue_free(d->unprocessed_rcds.q);
        pqueue_free(d->processed_rcds.q);
        pqueue_free(d->buffered_app_data.q);
        OPENSSL_free(d);
        rl->d = NULL;
        return (0);
    }

    return 1;
}
开发者ID:hydnoracoin,项目名称:Open-Source-Cryptocurrency-Exchange,代码行数:25,代码来源:rec_layer_d1.c

示例5: DTLS_RECORD_LAYER_free

void DTLS_RECORD_LAYER_free(RECORD_LAYER *rl)
{
    DTLS_RECORD_LAYER_clear(rl);
    pqueue_free(rl->d->unprocessed_rcds.q);
    pqueue_free(rl->d->processed_rcds.q);
    pqueue_free(rl->d->buffered_app_data.q);
    OPENSSL_free(rl->d);
    rl->d = NULL;
}
开发者ID:Ana06,项目名称:openssl,代码行数:9,代码来源:rec_layer_d1.c

示例6: dtls1_new

int dtls1_new(SSL *s)
{
    DTLS1_STATE *d1;

    if (!ssl3_new(s))
        return (0);
    if ((d1 = OPENSSL_malloc(sizeof *d1)) == NULL)
        return (0);
    memset(d1, 0, sizeof *d1);

    /* d1->handshake_epoch=0; */
#if defined(OPENSSL_SYS_VMS) || defined(VMS_TEST)
    d1->bitmap.length = 64;
#else
    d1->bitmap.length = sizeof(d1->bitmap.map) * 8;
#endif
    pq_64bit_init(&(d1->bitmap.map));
    pq_64bit_init(&(d1->bitmap.max_seq_num));

    d1->next_bitmap.length = d1->bitmap.length;
    pq_64bit_init(&(d1->next_bitmap.map));
    pq_64bit_init(&(d1->next_bitmap.max_seq_num));

    d1->unprocessed_rcds.q = pqueue_new();
    d1->processed_rcds.q = pqueue_new();
    d1->buffered_messages = pqueue_new();
    d1->sent_messages = pqueue_new();
    d1->buffered_app_data.q = pqueue_new();

    if (s->server) {
        d1->cookie_len = sizeof(s->d1->cookie);
    }

    if (!d1->unprocessed_rcds.q || !d1->processed_rcds.q
        || !d1->buffered_messages || !d1->sent_messages
        || !d1->buffered_app_data.q) {
        if (d1->unprocessed_rcds.q)
            pqueue_free(d1->unprocessed_rcds.q);
        if (d1->processed_rcds.q)
            pqueue_free(d1->processed_rcds.q);
        if (d1->buffered_messages)
            pqueue_free(d1->buffered_messages);
        if (d1->sent_messages)
            pqueue_free(d1->sent_messages);
        if (d1->buffered_app_data.q)
            pqueue_free(d1->buffered_app_data.q);
        OPENSSL_free(d1);
        return (0);
    }

    s->d1 = d1;
    s->method->ssl_clear(s);
    return (1);
}
开发者ID:alhazred,项目名称:illumos-extra,代码行数:54,代码来源:d1_lib.c

示例7: tiz_pqueue_destroy

void tiz_pqueue_destroy (tiz_pqueue_t *p_q)
{
  if (p_q)
    {
      assert (p_q->p_first == p_q->p_last);
      assert (p_q->p_first == NULL);
      assert (p_q->length == 0);

      pqueue_free (p_q->p_soa, p_q->pp_store);
      pqueue_free (p_q->p_soa, p_q);
    }
}
开发者ID:allenk,项目名称:tizonia-openmax-il,代码行数:12,代码来源:tizpqueue.c

示例8: dtls1_free

void dtls1_free(SSL *s)
	{
	ssl3_free(s);

	dtls1_clear_queues(s);

    pqueue_free(s->d1->unprocessed_rcds.q);
    pqueue_free(s->d1->processed_rcds.q);
    pqueue_free(s->d1->buffered_messages);
	pqueue_free(s->d1->sent_messages);
	pqueue_free(s->d1->buffered_app_data.q);

	OPENSSL_free(s->d1);
	}
开发者ID:735579768,项目名称:droidVncServer,代码行数:14,代码来源:d1_lib.c

示例9: dtls1_free

void dtls1_free(SSL *s)
{
    DTLS_RECORD_LAYER_free(&s->rlayer);

    ssl3_free(s);

    dtls1_clear_queues(s);

    pqueue_free(s->d1->buffered_messages);
    pqueue_free(s->d1->sent_messages);

    OPENSSL_free(s->d1);
    s->d1 = NULL;
}
开发者ID:nicholasmsanford,项目名称:openssl,代码行数:14,代码来源:d1_lib.c

示例10: dtls1_free

void dtls1_free(SSL *s)
	{
    pitem *item = NULL;
    hm_fragment *frag = NULL;

	ssl3_free(s);

    while( (item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL)
        {
        OPENSSL_free(item->data);
        pitem_free(item);
        }
    pqueue_free(s->d1->unprocessed_rcds.q);

    while( (item = pqueue_pop(s->d1->processed_rcds.q)) != NULL)
        {
        OPENSSL_free(item->data);
        pitem_free(item);
        }
    pqueue_free(s->d1->processed_rcds.q);

    while( (item = pqueue_pop(s->d1->buffered_messages)) != NULL)
        {
        frag = (hm_fragment *)item->data;
        OPENSSL_free(frag->fragment);
        OPENSSL_free(frag);
        pitem_free(item);
        }
    pqueue_free(s->d1->buffered_messages);

    while ( (item = pqueue_pop(s->d1->sent_messages)) != NULL)
        {
        frag = (hm_fragment *)item->data;
        OPENSSL_free(frag->fragment);
        OPENSSL_free(frag);
        pitem_free(item);
        }
	pqueue_free(s->d1->sent_messages);

	while ( (item = pqueue_pop(s->d1->buffered_app_data.q)) != NULL)
		{
		frag = (hm_fragment *)item->data;
		OPENSSL_free(frag->fragment);
		OPENSSL_free(frag);
		pitem_free(item);
		}
	pqueue_free(s->d1->buffered_app_data.q);

	OPENSSL_free(s->d1);
	}
开发者ID:dienbk7x,项目名称:NetmfSTM32,代码行数:50,代码来源:d1_lib.cpp

示例11: dtls1_free

void dtls1_free(SSL *s) {
  ssl3_free(s);

  if (s == NULL || s->d1 == NULL) {
    return;
  }

  dtls1_clear_queues(s);

  pqueue_free(s->d1->buffered_messages);
  pqueue_free(s->d1->sent_messages);

  OPENSSL_free(s->d1);
  s->d1 = NULL;
}
开发者ID:friends110110,项目名称:boringssl,代码行数:15,代码来源:d1_lib.c

示例12: main

int
main(void)
	{
	pitem *item;
	pqueue pq;

	pq = pqueue_new();

	item = pitem_new(3, NULL);
	pqueue_insert(pq, item);

	item = pitem_new(1, NULL);
	pqueue_insert(pq, item);

	item = pitem_new(2, NULL);
	pqueue_insert(pq, item);

	item = pqueue_find(pq, 1);
	fprintf(stderr, "found %ld\n", item->priority);

	item = pqueue_find(pq, 2);
	fprintf(stderr, "found %ld\n", item->priority);

	item = pqueue_find(pq, 3);
	fprintf(stderr, "found %ld\n", item ? item->priority: 0);

	pqueue_print(pq);

	for(item = pqueue_pop(pq); item != NULL; item = pqueue_pop(pq))
		pitem_free(item);

	pqueue_free(pq);
	return 0;
	}
开发者ID:0b10011,项目名称:node,代码行数:34,代码来源:pq_test.c

示例13: dtls1_free

void dtls1_free(SSL *s)
	{
    pitem *item = NULL;
    hm_fragment *frag = NULL;

	ssl3_free(s);

    while( (item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL)
        {
        OPENSSL_free(item->data);
        pitem_free(item);
        }
    pqueue_free(s->d1->unprocessed_rcds.q);

    while( (item = pqueue_pop(s->d1->processed_rcds.q)) != NULL)
        {
        OPENSSL_free(item->data);
        pitem_free(item);
        }
    pqueue_free(s->d1->processed_rcds.q);

    while( (item = pqueue_pop(s->d1->buffered_messages)) != NULL)
        {
        frag = (hm_fragment *)item->data;
        OPENSSL_free(frag->fragment);
        OPENSSL_free(frag);
        pitem_free(item);
        }
    pqueue_free(s->d1->buffered_messages);

    while ( (item = pqueue_pop(s->d1->sent_messages)) != NULL)
        {
        frag = (hm_fragment *)item->data;
        OPENSSL_free(frag->fragment);
        OPENSSL_free(frag);
        pitem_free(item);
        }
	pqueue_free(s->d1->sent_messages);

	pq_64bit_free(&(s->d1->bitmap.map));
	pq_64bit_free(&(s->d1->bitmap.max_seq_num));

	pq_64bit_free(&(s->d1->next_bitmap.map));
	pq_64bit_free(&(s->d1->next_bitmap.max_seq_num));

	OPENSSL_free(s->d1);
	}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:47,代码来源:d1_lib.c

示例14: dtls1_new

int dtls1_new (SSL * s)
{
    DTLS1_STATE *d1;

    if (!ssl3_new (s))
        return (0);
    if ((d1 = OPENSSL_malloc (sizeof *d1)) == NULL)
        return (0);
    memset (d1, 0, sizeof *d1);

    /* d1->handshake_epoch=0; */

    d1->unprocessed_rcds.q = pqueue_new ();
    d1->processed_rcds.q = pqueue_new ();
    d1->buffered_messages = pqueue_new ();
    d1->sent_messages = pqueue_new ();
    d1->buffered_app_data.q = pqueue_new ();

    if (s->server)
    {
        d1->cookie_len = sizeof (s->d1->cookie);
    }

    d1->link_mtu = 0;
    d1->mtu = 0;

    if (!d1->unprocessed_rcds.q || !d1->processed_rcds.q
        || !d1->buffered_messages || !d1->sent_messages || !d1->buffered_app_data.q)
    {
        if (d1->unprocessed_rcds.q)
            pqueue_free (d1->unprocessed_rcds.q);
        if (d1->processed_rcds.q)
            pqueue_free (d1->processed_rcds.q);
        if (d1->buffered_messages)
            pqueue_free (d1->buffered_messages);
        if (d1->sent_messages)
            pqueue_free (d1->sent_messages);
        if (d1->buffered_app_data.q)
            pqueue_free (d1->buffered_app_data.q);
        OPENSSL_free (d1);
        return (0);
    }

    s->d1 = d1;
    s->method->ssl_clear (s);
    return (1);
}
开发者ID:274914765,项目名称:C,代码行数:47,代码来源:d1_lib.c

示例15: dtls1_new

int
dtls1_new(SSL *s)
{
	DTLS1_STATE *d1;

	if (!ssl3_new(s))
		return (0);
	if ((d1 = calloc(1, sizeof *d1)) == NULL) {
		ssl3_free(s);
		return (0);
	}

	/* d1->handshake_epoch=0; */

	d1->unprocessed_rcds.q = pqueue_new();
	d1->processed_rcds.q = pqueue_new();
	d1->buffered_messages = pqueue_new();
	d1->sent_messages = pqueue_new();
	d1->buffered_app_data.q = pqueue_new();

	if (s->server) {
		d1->cookie_len = sizeof(s->d1->cookie);
	}

	if (!d1->unprocessed_rcds.q || !d1->processed_rcds.q ||
	    !d1->buffered_messages || !d1->sent_messages ||
	    !d1->buffered_app_data.q) {
		if (d1->unprocessed_rcds.q)
			pqueue_free(d1->unprocessed_rcds.q);
		if (d1->processed_rcds.q)
			pqueue_free(d1->processed_rcds.q);
		if (d1->buffered_messages)
			pqueue_free(d1->buffered_messages);
		if (d1->sent_messages)
			pqueue_free(d1->sent_messages);
		if (d1->buffered_app_data.q)
			pqueue_free(d1->buffered_app_data.q);
		free(d1);
		ssl3_free(s);
		return (0);
	}

	s->d1 = d1;
	s->method->ssl_clear(s);
	return (1);
}
开发者ID:Heratom,项目名称:Firefly-project,代码行数:46,代码来源:d1_lib.c


注:本文中的pqueue_free函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。