library/src/network/httpd/BP-HTTPdSessions.cc
// Retrieves a valid user if a valid session id is matched.
Retrieves a valid user if a valid session id is matched.
Retrieves a valid user if a valid session id is matched .
P_BP_HTTPD_USER_SESSION BP_HTTPdSessionAuthUserFromSessionId
(
		P_BP_HTTPD_SESSION httpd,
		char * session_id
)
{
	if(!httpd)
		return NULL;
	if(!httpd->system_hreg)
		return NULL;
	BP_HTTPD_ENTER_CRITICAL_SECTION;
	P_BP_HTTPD_USER_SESSION session_lookup = BP_HTTPdSessionLookup
	(
			httpd,
			session_id
	);
	printf("\n After Session Lookup: %p - %s", session_lookup, session_id);
	printf("\n");
	printf("\n");
	if(BP_HTTPdSessionExpired((P_BP_HTTPD_USER_SESSION) session_lookup) != BP_TRUE)
	{
		BP_HTTPD_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC((P_BP_HTTPD_USER_SESSION) session_lookup);
	}
	BP_HTTPdSessionDestroy(httpd, (P_BP_HTTPD_USER_SESSION) session_lookup);
	session_lookup = NULL;
	BP_HTTPD_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(session_lookup);
}
P_BP_HTTPD_USER_SESSION BP_HTTPdSessionAuthUserFromSessionId ( P_BP_HTTPD_SESSION httpd , char * session_id ) { if ( ! httpd ) return NULL ; if ( ! httpd -> system_hreg ) return NULL ; BP_HTTPD_ENTER_CRITICAL_SECTION ; P_BP_HTTPD_USER_SESSION session_lookup = BP_HTTPdSessionLookup ( httpd , session_id ) ; printf ( " \n " , session_lookup , session_id ) ; printf ( " \n " ) ; printf ( " \n " ) ; if ( BP_HTTPdSessionExpired ( ( P_BP_HTTPD_USER_SESSION ) session_lookup ) != BP_TRUE ) { BP_HTTPD_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( ( P_BP_HTTPD_USER_SESSION ) session_lookup ) ; } BP_HTTPdSessionDestroy ( httpd , ( P_BP_HTTPD_USER_SESSION ) session_lookup ) ; session_lookup = NULL ; BP_HTTPD_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( session_lookup ) ; }
Retrieves a valid user if a valid session id is matched.
Retrieves a valid user if a valid session id is matched .
// enter critical section // attempt to lookup the session // __asm("int3"); // check if the session is expired // if the session isn't expired, return it // destroy the user session // set session ptr to null // return null if the session was expired