Bug 1246363: add logging to detect if relay only option is set. r=mjf draft
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Fri, 05 Feb 2016 22:56:14 -0800
changeset 329354 b5c62327575846c894ce8e8b252bb7397ea913ac
parent 329353 4295f9951e9331a2f2bd0a8ea8c4ad73af141a7b
child 513946 531d94c20f661614f5ec76015a9bd02637d4d7ce
push id10511
push userdrno@ohlmeier.org
push dateSat, 06 Feb 2016 06:56:33 +0000
reviewersmjf
bugs1246363
milestone47.0a1
Bug 1246363: add logging to detect if relay only option is set. r=mjf
media/mtransport/third_party/nICEr/src/ice/ice_component.c
--- 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;