Пример #1
0
/* Generate a string (32 chars) used for sessid and pubid */
void gen_sessid_new(char *input, acetables *g_ape)
{
	unsigned int i;
	
	do {
		for (i = 0; i < 32; i++) {
			input[i] = basic_chars[rand()%16];
		}
		input[32] = '\0';
	} while(seek_user_id(input, g_ape) != NULL || seek_user_simple(input, g_ape) != NULL); // Colision verification
}
Пример #2
0
// return user with a channel pubid
USERS *seek_user(const char *pubid, const char *linkid, acetables *g_ape)
{
	USERS *suser;
	CHANLIST *clist;

	if ((suser = seek_user_simple(pubid, g_ape)) == NULL) {
		return NULL;
	}
	
	clist = suser->chan_foot;
	
	while (clist != NULL) {
		if (strcasecmp(clist->chaninfo->pipe->pubid, linkid) == 0) {
			return suser;
		}
		clist = clist->next;
	}
	
	return NULL;
}