void ConvertDefaultIPToSocketIP(char const *attr_name,char **expr_string,Stream& s) { char *new_expr_string = NULL; ConvertDefaultIPToSocketIP(attr_name,*expr_string,&new_expr_string,s); if(new_expr_string) { //The expression was updated. Replace the old expression with //the new one. free(*expr_string); *expr_string = new_expr_string; } }
void ConvertDefaultIPToSocketIP(char const *attr_name,std::string &expr_string,Stream& s) { char *new_expr_string = NULL; ConvertDefaultIPToSocketIP(attr_name,expr_string.c_str(),&new_expr_string,s); if(new_expr_string) { //The expression was updated. Replace the old expression with //the new one. expr_string = new_expr_string; free(new_expr_string); } }
bool ClaimStartdMsg::writeMsg( DCMessenger * /*messenger*/, Sock *sock ) { // save startd fqu for hole punching m_startd_fqu = sock->getFullyQualifiedUser(); m_startd_ip_addr = sock->peer_ip_str(); std::string scheduler_addr_to_send = m_scheduler_addr; ConvertDefaultIPToSocketIP(ATTR_SCHEDD_IP_ADDR,scheduler_addr_to_send,*sock); // Insert an attribute in the request ad to inform the // startd that this schedd is capable of understanding // the newer protocol where the claim response may send // over any leftover resources from a partitionable slot. m_job_ad.Assign("_condor_SEND_LEFTOVERS", param_boolean("CLAIM_PARTITIONABLE_LEFTOVERS",true)); // Insert an attribute in the request ad to inform the // startd that this schedd is capable of understanding // the newer protocol where the claim response may send // over the ad and claim id of the partner of a paired slot. m_job_ad.Assign("_condor_SEND_PAIRED_SLOT", param_boolean("CLAIM_PAIRED_SLOT",true)); if( !sock->put_secret( m_claim_id.c_str() ) || !putClassAd( sock, m_job_ad ) || !sock->put( scheduler_addr_to_send.c_str() ) || !sock->put( m_alive_interval ) || !this->putExtraClaims(sock)) { dprintf(failureDebugLevel(), "Couldn't encode request claim to startd %s\n", description() ); sockFailed( sock ); return false; } // end_of_message() is done by caller return true; }