library/src/network/tor/BP-Tor.cc
// Set confiuration control port and data directory
Set confiuration control port and data directory
Set confiuration control port and data directory
BP_ERROR_T BP_TorConfigControlPortAndDataDirectory
(
		P_BP_TOR       tor,
		char         * data_directory,
		unsigned short control_port
)
{
	if(!tor)
		return ERR_FAILURE;
	if(!BP_StringIsReasonableForUnixEXT4Directory(data_directory, bpstrlen(data_directory), BP_TRUE))
		return ERR_FAILURE;
	if(!control_port)
		return ERR_FAILURE;
	tor->data_directory = ht_strdup(tor->system_hreg, data_directory);
	tor->control_port = control_port;
	return ERR_SUCCESS;
}
BP_ERROR_T BP_TorConfigControlPortAndDataDirectory ( P_BP_TOR tor , char * data_directory , unsigned short control_port ) { if ( ! tor ) return ERR_FAILURE ; if ( ! BP_StringIsReasonableForUnixEXT4Directory ( data_directory , bpstrlen ( data_directory ) , BP_TRUE ) ) return ERR_FAILURE ; if ( ! control_port ) return ERR_FAILURE ; tor -> data_directory = ht_strdup ( tor -> system_hreg , data_directory ) ; tor -> control_port = control_port ; return ERR_SUCCESS ; }
Set confiuration control port and data directory
Set confiuration control port and data directory
// ensure we have a tor session // ensure the directory exists and is reasonable // set the data directory // set the control port // return indicating success