library/src/blockclass/BP-BlockClass.cc
// Updates all the proxy db entries set in the class.
Updates all the proxy db entries set in the class.
Updates all the proxy db entries set in the class .
BP_ERROR_T Block::updateProxyDBEntriesInDB(bool only_update_runtime_validated)
{
	if(!this->mysqlSession)
		return ERR_FAILURE;
	BP_BLOCK_MARIADB_ENTER_CRITICAL_SECTION;
	if(!this->db_populated_proxy_n || !this->db_populated_proxy_sets)
	{
		this->AddErrorToStack("The proxy db entries in this class are unset/NULL/zero.  Ensure you have a proxy set before calling this routine in the future.");
		BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(ERR_FAILURE);
	}
	size_t n = 0;
	for(; n < this->db_populated_proxy_n; n++)
	{
		if(only_update_runtime_validated)
		if(!this->db_populated_proxy_sets[n].proxy_has_been_validated_at_runtime)
		{
			continue;
		}
		if(!this->db_populated_proxy_sets[n].id)
			continue;
		printf("\n Attempting to update proxy id %u", this->db_populated_proxy_sets[n].id);
		this->updateProxyDBEntryInDB((P_BP_PROXY_DB_ENTRY) &this->db_populated_proxy_sets[n]);
	}
	BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC(ERR_SUCCESS);
}
BP_ERROR_T Block :: updateProxyDBEntriesInDB ( bool only_update_runtime_validated ) { if ( ! this -> mysqlSession ) return ERR_FAILURE ; BP_BLOCK_MARIADB_ENTER_CRITICAL_SECTION ; if ( ! this -> db_populated_proxy_n || ! this -> db_populated_proxy_sets ) { this -> AddErrorToStack ( " " ) ; BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( ERR_FAILURE ) ; } size_t n = 0 ; for ( ; n < this -> db_populated_proxy_n ; n ++ ) { if ( only_update_runtime_validated ) if ( ! this -> db_populated_proxy_sets [ n ] . proxy_has_been_validated_at_runtime ) { continue ; } if ( ! this -> db_populated_proxy_sets [ n ] . id ) continue ; printf ( " \n " , this -> db_populated_proxy_sets [ n ] . id ) ; this -> updateProxyDBEntryInDB ( ( P_BP_PROXY_DB_ENTRY ) & this -> db_populated_proxy_sets [ n ] ) ; } BP_BLOCK_MARIADB_LEAVE_CRITICAL_SECTION_AND_RETURN_FROM_FUNC ( ERR_SUCCESS ) ; }
Updates all the proxy db entries set in the class.
Updates all the proxy db entries set in the class .
// exit if the mysqli object is unset // enter critical section // simple pointer/count check // loop through the test sets and record elements // continue the loop if the developer has specified to only update runtime validated proxies // only update proxies with non-zero ids // update the proxy id // attempt to update proxy // return indicating success