library/src/network/httpd/BP-HTTPdRequests.cc
// Destroy a request var members and close file descriptors if necessary.
Destroy a request var members and close file descriptors if necessary.
Destroy a request var members and close file descriptors if necessary .
BP_ERROR_T BP_HTTPdRequestVarDestroyMembers(P_BP_HTTPD_REQUEST_VAR request_var)
{
	if(!request_var)
		return ERR_FAILURE;
	if(request_var->data)
	{
		bpfree(request_var->data);
		request_var->data = NULL;
	}
	if(request_var->data_file)
	{
		bpfree(request_var->data_file);
		request_var->data_file = NULL;
	}
	if(request_var->file_descriptor != -1)
	{
		BP_FDClose(request_var->file_descriptor);
		request_var->file_descriptor = -1;
	}
	if(request_var->name)
	{
		bpfree(request_var->name);
		request_var->name = NULL;
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_HTTPdRequestVarDestroyMembers ( P_BP_HTTPD_REQUEST_VAR request_var ) { if ( ! request_var ) return ERR_FAILURE ; if ( request_var -> data ) { bpfree ( request_var -> data ) ; request_var -> data = NULL ; } if ( request_var -> data_file ) { bpfree ( request_var -> data_file ) ; request_var -> data_file = NULL ; } if ( request_var -> file_descriptor != -1 ) { BP_FDClose ( request_var -> file_descriptor ) ; request_var -> file_descriptor = -1 ; } if ( request_var -> name ) { bpfree ( request_var -> name ) ; request_var -> name = NULL ; } return ERR_SUCCESS ; }
Destroy a request var members and close file descriptors if necessary.
Destroy a request var members and close file descriptors if necessary .
// ensure we have request // destroy data if set // destroy data file if set // destroy file descriptor if set // close the file descriptor if one is set // destroy name if set // return indicating success