Bug 1246363: add logging to detect if relay only option is set. r=mjf
--- a/media/mtransport/third_party/nICEr/src/ice/ice_component.c
+++ b/media/mtransport/third_party/nICEr/src/ice/ice_component.c
@@ -247,18 +247,25 @@ static int nr_ice_component_initialize_u
isock,sock,SERVER_REFLEXIVE,0,
&ctx->stun_servers[j],component->component_id,&cand))
ABORT(r);
TAILQ_INSERT_TAIL(&component->candidates,cand,entry_comp);
component->candidate_ct++;
cand=0;
}
}
+ else{
+ r_log(LOG_ICE,LOG_WARNING,"ICE(%s): relay only option results in no host candidate for %s",ctx->label,addrs[i].addr.as_string);
+ }
#ifdef USE_TURN
+ if ((ctx->flags & NR_ICE_CTX_FLAGS_RELAY_ONLY) &&
+ (ctx->turn_server_ct == 0)) {
+ r_log(LOG_ICE,LOG_ERR,"ICE(%s): relay only option is set without any TURN server configured",ctx->label);
+ }
/* And both a srvrflx and relayed candidate for each TURN server (unless
we're in relay-only mode, in which case just the relayed one) */
for(j=0;j<ctx->turn_server_ct;j++){
nr_socket *turn_sock;
nr_ice_candidate *srvflx_cand=0;
/* Skip non-UDP */
if (ctx->turn_servers[j].turn_server.transport != IPPROTO_UDP)
@@ -413,16 +420,17 @@ static int nr_ice_component_initialize_t
ABORT(r);
}
if ((r=NR_reg_get_char(NR_ICE_REG_ICE_TCP_DISABLE, &ice_tcp_disabled))) {
if (r != R_NOT_FOUND)
ABORT(r);
}
if (ctx->flags & NR_ICE_CTX_FLAGS_RELAY_ONLY) {
+ r_log(LOG_ICE,LOG_WARNING,"ICE(%s): relay only option results in ICE TCP being disabled",ctx->label);
ice_tcp_disabled = 1;
}
for(i=0;i<addr_ct;i++){
char suppress;
nr_ice_socket *isock_psv=0;
nr_ice_socket *isock_so=0;