Define variables at the beginning of a block and do not call tunnel stuff is tunnel compilation is not enabled.

This commit is contained in:
Ghislain MARY 2013-04-19 09:19:58 +02:00
parent 82c498a711
commit bd6d249f26
2 changed files with 10 additions and 2 deletions

View file

@ -516,19 +516,26 @@ void sal_set_keepalive_period(Sal *ctx,unsigned int value){
return ;
}
int sal_enable_tunnel(Sal *ctx, void *tunnelclient) {
#ifdef TUNNEL_ENABLED
belle_sip_listening_point_t *lp;
int result;
sal_unlisten_ports(ctx);
belle_sip_listening_point_t* lp = belle_sip_tunnel_listening_point_new(ctx->stack, tunnelclient);
lp = belle_sip_tunnel_listening_point_new(ctx->stack, tunnelclient);
if (lp == NULL) return -1;
belle_sip_listening_point_set_keep_alive(lp, ctx->keep_alive);
result = belle_sip_provider_add_listening_point(ctx->prov, lp);
set_tls_properties(ctx);
return result;
#else
return 0;
#endif
}
void sal_disable_tunnel(Sal *ctx) {
#ifdef TUNNEL_ENABLED
sal_unlisten_ports(ctx);
#endif
}
/**
* returns keepalive period in ms

View file

@ -431,8 +431,9 @@ int sdp_to_media_description ( belle_sdp_session_description_t *session_desc, S
/* Get ICE candidate attributes if any */
for (attribute_it = belle_sdp_media_description_get_attributes(media_desc); attribute_it != NULL; attribute_it=attribute_it->next) {
const char *att_name;
attribute=(belle_sdp_attribute_t*)attribute_it->data;
const char *att_name=belle_sdp_attribute_get_name(attribute);
att_name=belle_sdp_attribute_get_name(attribute);
value=belle_sdp_attribute_get_value(attribute);
if ((keywordcmp("candidate", att_name) == 0) && (value != NULL)) {
SalIceCandidate *candidate = &stream->ice_candidates[nb_ice_candidates];