library/src/network/httpd/BP-HTTPdRequests.cc
// attempt to lookup a request by it's uuid
attempt to lookup a request by it's uuid
attempt to lookup a request by it ' s uuid
P_BP_HTTPD_REQUEST BP_HTTPdRequestLookupByUUID(P_BP_HTTPD_SESSION httpd, char * uuid)
{
	if(!httpd)
		return NULL;
	if(!httpd->request_hreg)
		return NULL;
	if(!uuid)
		return NULL;
	char * table_path[10] = {0};
	P_BP_HASH_TABLE_KEYED_ENTRY tmp_lookup = NULL;
	BP_HASH_TABLE_ENTER_CRITICAL_SECTION(httpd->request_hreg);
	table_path[0] = "requests";
	table_path[1] = uuid;
	table_path[2] = NULL;
	P_BP_HASH_TABLE_KEYED_ENTRY lookup_entry = BP_HashRegLookupTableEntryByPath(httpd->request_hreg,table_path);
	if(!lookup_entry)
	{
		BP_HASH_TABLE_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(httpd->request_hreg, NULL);
	}
	P_BP_HTTPD_REQUEST request = (P_BP_HTTPD_REQUEST) lookup_entry->data;
	BP_HASH_TABLE_LEAVE_CRITICAL_SECTION(httpd->request_hreg);
	return request;
}
P_BP_HTTPD_REQUEST BP_HTTPdRequestLookupByUUID ( P_BP_HTTPD_SESSION httpd , char * uuid ) { if ( ! httpd ) return NULL ; if ( ! httpd -> request_hreg ) return NULL ; if ( ! uuid ) return NULL ; char * table_path [ 10 ] = { 0 } ; P_BP_HASH_TABLE_KEYED_ENTRY tmp_lookup = NULL ; BP_HASH_TABLE_ENTER_CRITICAL_SECTION ( httpd -> request_hreg ) ; table_path [ 0 ] = " " ; table_path [ 1 ] = uuid ; table_path [ 2 ] = NULL ; P_BP_HASH_TABLE_KEYED_ENTRY lookup_entry = BP_HashRegLookupTableEntryByPath ( httpd -> request_hreg , table_path ) ; if ( ! lookup_entry ) { BP_HASH_TABLE_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( httpd -> request_hreg , NULL ) ; } P_BP_HTTPD_REQUEST request = ( P_BP_HTTPD_REQUEST ) lookup_entry -> data ; BP_HASH_TABLE_LEAVE_CRITICAL_SECTION ( httpd -> request_hreg ) ; return request ; }
attempt to lookup a request by it's uuid
attempt to lookup a request by it ' s uuid
// declare dynamic table path // declare the lookup pointer // enter critical section before making changes to the httpd hash // table registry. // set the table path for lookup // attempt to get entry // ensure we can lookup the new entry // set user // leave critical section // return the looked up request