Exemple #1
0
// Reset auth manager object.
void authmgtReset(struct s_authmgt *mgt) {
	int i;
	int count = idspSize(&mgt->idsp);
	for(i=0; i<count; i++) {
		authReset(&mgt->authstate[i]);
	}
    
	idspReset(&mgt->idsp);
	mgt->fastauth = 0;
	mgt->current_authed_id = -1;
	mgt->current_completed_id = -1;
    
    debug("auth manager RESET completed");
}
Exemple #2
0
static int idspCreate(struct s_idsp *idsp, const int size) {
	int *idfwd_mem = NULL;
	int *idlist_mem = NULL;
	if(size > 0) {
		idfwd_mem = malloc(sizeof(int) * size);
		if(idfwd_mem != NULL) {
			idlist_mem = malloc(sizeof(int) * size);
			if(idlist_mem != NULL) {
				idsp->idfwd = idfwd_mem;
				idsp->idlist = idlist_mem;
				idsp->count = size;
				idspReset(idsp);
				return 1;
			}
			free(idfwd_mem);
		}
	}
	return 0;
}