• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ rb_free函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: rb_ssl_tryaccept

static void
rb_ssl_tryaccept(rb_fde_t *F, void *data)
{
	int ret;
	struct acceptdata *ad;

	lrb_assert(F->accept != NULL);

	ret = do_ssl_handshake(F, rb_ssl_tryaccept, NULL);

	/* do_ssl_handshake does the rb_setselect */
	if(ret == 0)
		return;

	ad = F->accept;
	F->accept = NULL;
	rb_settimeout(F, 0, NULL, NULL);
	rb_setselect(F, RB_SELECT_READ | RB_SELECT_WRITE, NULL, NULL);

	if(ret > 0)
		ad->callback(F, RB_OK, (struct sockaddr *)&ad->S, ad->addrlen, ad->data);
	else
		ad->callback(F, RB_ERROR_SSL, NULL, 0, ad->data);

	rb_free(ad);
}
开发者ID:viatsko,项目名称:charybdis,代码行数:26,代码来源:gnutls.c


示例2: free_listener

void
free_listener(struct Listener *listener)
{
	s_assert(NULL != listener);
	if(listener == NULL)
		return;
	/*
	 * remove from listener list
	 */
	if(listener == ListenerPollList)
		ListenerPollList = listener->next;
	else
	{
		struct Listener *prev = ListenerPollList;
		for (; prev; prev = prev->next)
		{
			if(listener == prev->next)
			{
				prev->next = listener->next;
				break;
			}
		}
	}

	/* free */
	rb_free(listener);
}
开发者ID:Nilkanth1999,项目名称:sIRCd,代码行数:27,代码来源:listener.c


示例3: mr_user

/* mr_user()
 *      parv[1] = username (login name, account)
 *      parv[2] = client host name (ignored)
 *      parv[3] = server host name (ignored)
 *      parv[4] = users gecos
 */
static int
mr_user(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	static char buf[BUFSIZE];
	char *p;

	if (strlen(client_p->id) == 3)
	{
		exit_client(client_p, client_p, client_p, "Mixing client and server protocol");
		return 0;
	}

	if(source_p->flags & FLAGS_SENTUSER)
		return 0;

	if((p = strchr(parv[1], '@')))
		*p = '\0';

	rb_snprintf(buf, sizeof(buf), "%s %s", parv[2], parv[3]);
	rb_free(source_p->localClient->fullcaps);
	source_p->localClient->fullcaps = rb_strdup(buf);

	do_local_user(client_p, source_p, parv[1], parv[4]);
	return 0;
}
开发者ID:ChatLounge,项目名称:ChatIRCd,代码行数:31,代码来源:m_user.c


示例4: mr_capab

/*
 * mr_capab - CAPAB message handler
 *      parv[1] = space-separated list of capabilities
 *
 */
static int
mr_capab(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	struct Capability *cap;
	int i;
	char *p;
	char *s;
	/* ummm, this shouldn't happen. Could argue this should be logged etc. */
	if (client_p->localClient == NULL)
		return 0;
	if (client_p->user)
		return 0;
	/* CAP_TS6 is set in PASS, so is valid.. */
	if ((client_p->localClient->caps & ~CAP_TS6) != 0) {
		exit_client(client_p, client_p, client_p, "CAPAB received twice");
		return 0;
	} else
		client_p->localClient->caps |= CAP_CAP;
	rb_free(client_p->localClient->fullcaps);
	client_p->localClient->fullcaps = rb_strdup(parv[1]);
	for (i = 1; i < parc; i++) {
		char *t = LOCAL_COPY(parv[i]);
		for (s = rb_strtok_r(t, " ", &p); s; s = rb_strtok_r(NULL, " ", &p)) {
			for (cap = captab; cap->name; cap++) {
				if (!irccmp(cap->name, s)) {
					client_p->localClient->caps |= cap->cap;
					break;
				}
			}
		}
	}
	return 0;
}
开发者ID:Codyle,项目名称:elemental-ircd,代码行数:38,代码来源:m_capab.c


示例5: me_gcap

static int
me_gcap(struct Client *client_p, struct Client *source_p,
        int parc, const char *parv[])
{
	struct Capability *cap;
	char *t = LOCAL_COPY(parv[1]);
	char *s;
	char *p;
	if (!IsServer(source_p))
		return 0;
	/* already had GCAPAB?! */
	if (!EmptyString(source_p->serv->fullcaps)) {
		source_p->serv->caps = 0;
		rb_free(source_p->serv->fullcaps);
	}
	source_p->serv->fullcaps = rb_strdup(parv[1]);
	for (s = rb_strtok_r(t, " ", &p); s; s = rb_strtok_r(NULL, " ", &p)) {
		for (cap = captab; cap->name; cap++) {
			if (!irccmp(cap->name, s)) {
				source_p->serv->caps |= cap->cap;
				break;
			}
		}
	}
	return 0;
}
开发者ID:Codyle,项目名称:elemental-ircd,代码行数:26,代码来源:m_capab.c


示例6: rb_ssl_accept_setup

void
rb_ssl_accept_setup(rb_fde_t *F, rb_fde_t *new_F, struct sockaddr *st, int addrlen)
{
	new_F->type |= RB_FD_SSL;
	new_F->ssl = rb_malloc(sizeof(gnutls_session_t));
	new_F->accept = rb_malloc(sizeof(struct acceptdata));

	new_F->accept->callback = F->accept->callback;
	new_F->accept->data = F->accept->data;
	rb_settimeout(new_F, 10, rb_ssl_timeout, NULL);
	memcpy(&new_F->accept->S, st, addrlen);
	new_F->accept->addrlen = addrlen;

	gnutls_init((gnutls_session_t *) new_F->ssl, GNUTLS_SERVER);
	gnutls_set_default_priority(SSL_P(new_F));
	gnutls_credentials_set(SSL_P(new_F), GNUTLS_CRD_CERTIFICATE, x509);
	gnutls_dh_set_prime_bits(SSL_P(new_F), 1024);
	gnutls_transport_set_ptr(SSL_P(new_F), (gnutls_transport_ptr_t) (long int)rb_get_fd(new_F));
	gnutls_certificate_server_set_request(SSL_P(new_F), GNUTLS_CERT_REQUEST);
	gnutls_priority_set(SSL_P(F), default_priority);

	if(do_ssl_handshake(F, rb_ssl_tryaccept, NULL))
	{
		struct acceptdata *ad = F->accept;
		F->accept = NULL;
		ad->callback(F, RB_OK, (struct sockaddr *)&ad->S, ad->addrlen, ad->data);
		rb_free(ad);
	}
}
开发者ID:viatsko,项目名称:charybdis,代码行数:29,代码来源:gnutls.c


示例7: rb_ssl_start_accepted

void
rb_ssl_start_accepted(rb_fde_t *new_F, ACCB * cb, void *data, int timeout)
{
	gnutls_session_t *ssl;
	new_F->type |= RB_FD_SSL;
	ssl = new_F->ssl = rb_malloc(sizeof(gnutls_session_t));
	new_F->accept = rb_malloc(sizeof(struct acceptdata));

	new_F->accept->callback = cb;
	new_F->accept->data = data;
	rb_settimeout(new_F, timeout, rb_ssl_timeout, NULL);

	new_F->accept->addrlen = 0;

	gnutls_init(ssl, GNUTLS_SERVER);
	gnutls_set_default_priority(*ssl);
	gnutls_credentials_set(*ssl, GNUTLS_CRD_CERTIFICATE, x509);
	gnutls_dh_set_prime_bits(*ssl, 1024);
	gnutls_transport_set_ptr(*ssl, (gnutls_transport_ptr_t) (long int)new_F->fd);
	gnutls_certificate_server_set_request(*ssl, GNUTLS_CERT_REQUEST);
	gnutls_priority_set(*ssl, default_priority);

	if(do_ssl_handshake(new_F, rb_ssl_tryaccept, NULL))
	{
		struct acceptdata *ad = new_F->accept;
		new_F->accept = NULL;
		ad->callback(new_F, RB_OK, (struct sockaddr *)&ad->S, ad->addrlen, ad->data);
		rb_free(ad);
	}

}
开发者ID:viatsko,项目名称:charybdis,代码行数:31,代码来源:gnutls.c


示例8: operhash_delete

void
operhash_delete(const char *name)
{
	struct operhash_entry *ohash = irc_radixtree_retrieve(operhash_tree, name);

	if (ohash != NULL)
		rb_free(ohash);
}
开发者ID:dwfreed,项目名称:charybdis,代码行数:8,代码来源:operhash.c


示例9: vorbis_decoder_close

void
vorbis_decoder_close(decoder_t * dec) {

	vorbis_pdata_t * pd = (vorbis_pdata_t *)dec->pdata;

	ov_clear(&(pd->vf));
	rb_free(pd->rb);
}
开发者ID:alex1818,项目名称:aqualung,代码行数:8,代码来源:dec_vorbis.c


示例10: rb_ssl_connect_realcb

static void
rb_ssl_connect_realcb(rb_fde_t *F, int status, struct ssl_connect *sconn)
{
	F->connect->callback = sconn->callback;
	F->connect->data = sconn->data;
	rb_free(sconn);
	rb_connect_callback(F, status);
}
开发者ID:Macs,项目名称:NeoIRCd,代码行数:8,代码来源:openssl.c


示例11: do_modload

static void
do_modload(struct Client *source_p, const char *module)
{
	char *m_bn = rb_basename(module);
	int origin;

	if(findmodule_byname(m_bn) != -1)
	{
		sendto_one_notice(source_p, ":Module %s is already loaded", m_bn);
		rb_free(m_bn);
		return;
	}

	origin = strcmp(module, m_bn) == 0 ? MAPI_ORIGIN_CORE : MAPI_ORIGIN_EXTENSION;
	load_one_module(module, origin, false);

	rb_free(m_bn);
}
开发者ID:kleopatra999,项目名称:charybdis,代码行数:18,代码来源:m_modules.c


示例12: rb_sigio_unsched_event

void
rb_sigio_unsched_event(struct ev_entry *event)
{
    if(can_do_event <= 0)
        return;
    timer_delete(*((timer_t *) event->comm_ptr));
    rb_free(event->comm_ptr);
    event->comm_ptr = NULL;
}
开发者ID:TwinUsers,项目名称:ircd-kaffe,代码行数:9,代码来源:sigio.c


示例13: generate_challenge

static int
generate_challenge(char **r_challenge, char **r_response, RSA * rsa)
{
	SHA_CTX ctx;
	unsigned char secret[CHALLENGE_SECRET_LENGTH], *tmp;
	unsigned long length;
	unsigned long e = 0;
	unsigned long cnt = 0;
	int ret;

	if(!rsa)
		return -1;
	if(rb_get_random(secret, CHALLENGE_SECRET_LENGTH))
	{
		SHA1_Init(&ctx);
		SHA1_Update(&ctx, (uint8_t *)secret, CHALLENGE_SECRET_LENGTH);
		*r_response = malloc(SHA_DIGEST_LENGTH);
		SHA1_Final((uint8_t *)*r_response, &ctx);

		length = RSA_size(rsa);
		tmp = rb_malloc(length);
		ret = RSA_public_encrypt(CHALLENGE_SECRET_LENGTH, secret, tmp, rsa, RSA_PKCS1_OAEP_PADDING);

		if(ret >= 0)
		{
			*r_challenge = (char *)rb_base64_encode(tmp, ret);
			rb_free(tmp);
			return 0;
		}

		rb_free(tmp);
		rb_free(*r_response);
		*r_response = NULL;
	}

	ERR_load_crypto_strings();
	while ((cnt < 100) && (e = ERR_get_error()))
	{
		ilog(L_MAIN, "SSL error: %s", ERR_error_string(e, 0));
		cnt++;
	}

	return (-1);
}
开发者ID:AbstractBeliefs,项目名称:charybdis,代码行数:44,代码来源:m_challenge.c


示例14: speex_dec_close

void
speex_dec_close(decoder_t * dec) {

	speex_pdata_t * pd = (speex_pdata_t *)dec->pdata;

	oggz_close(pd->oggz);
	speex_bits_destroy(&(pd->bits));
        speex_decoder_destroy(pd->decoder);
	rb_free(pd->rb);
}
开发者ID:alex1818,项目名称:aqualung,代码行数:10,代码来源:dec_speex.c


示例15: rb_helper_close

void
rb_helper_close(rb_helper *helper)
{
	if(helper == NULL)
		return;
	rb_kill(helper->pid, SIGKILL);
	rb_close(helper->ifd);
	rb_close(helper->ofd);
	rb_free(helper);
}
开发者ID:awilfox,项目名称:charybdis,代码行数:10,代码来源:helper.c


示例16: rb_destroy

/*
 * Destroy all the elements blow us in the tree
 * only useful as part of a complete tree destroy.
 */
static void rb_destroy(struct rbnode *x,void (*free_function)(void *)) {
  if (x!=RBNULL) {
    if (x->left!=RBNULL)
      rb_destroy(x->left,free_function);
    if (x->right!=RBNULL)
      rb_destroy(x->right,free_function);
    if (free_function!=NULL)
      free_function(x->object);
    rb_free(x);
  }
}
开发者ID:fenghaitao,项目名称:Harpoon,代码行数:15,代码来源:redblack.c


示例17: my_cat

void	my_cat(int fd)
{
  char	*str;

  while (str = get_line(fd))
    {
      my_putstr(str);
      my_putchar('\n');
      rb_free(str);
    }
}
开发者ID:StripedTie,项目名称:Rebirth-Project,代码行数:11,代码来源:my_cat.c


示例18: me_certfp

/*
** me_certfp
**      parv[1] = certfp string
*/
static int
me_certfp(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	if (!IsPerson(source_p))
		return 0;

	rb_free(source_p->certfp);
	source_p->certfp = NULL;
	if (!EmptyString(parv[1]))
		source_p->certfp = rb_strdup(parv[1]);
	return 0;
}
开发者ID:jdhore,项目名称:charybdis,代码行数:16,代码来源:m_certfp.c


示例19: safelist_client_release

/*
 * safelist_client_release()
 *
 * inputs       - pointer to Client being listed on
 * outputs      - none
 * side effects - the client is no longer being
 *                listed
 *
 * Please do not ever call this on a non-local client.
 * If you do, you will get SIGSEGV.
 */
static void safelist_client_release(struct Client *client_p)
{
	s_assert(MyClient(client_p));

	rb_dlinkFindDestroy(client_p, &safelisting_clients);

	rb_free(client_p->localClient->safelist_data);

	client_p->localClient->safelist_data = NULL;

	sendto_one(client_p, form_str(RPL_LISTEND), me.name, client_p->name);
}
开发者ID:ShutterQuick,项目名称:charybdis,代码行数:23,代码来源:m_list.c


示例20: rb_ssl_ctx_free

void 
rb_ssl_ctx_free(rb_ssl_ctx *sctx)
{
	if(sctx == NULL)
		return;
	sctx->refcount--;
	if(sctx->refcount == 0)
	{
		SSL_CTX_free(sctx->ssl_ctx);
		rb_free(sctx);
	}
}
开发者ID:thors,项目名称:ircd-ratbox,代码行数:12,代码来源:openssl.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rb_funcall函数代码示例发布时间:2022-05-30
下一篇:
C++ rb_float_new函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap