Changeset 2340 for pjproject/trunk
- Timestamp:
- Oct 2, 2008 5:54:40 PM (16 years ago)
- Location:
- pjproject/trunk/pjnath/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/turn_session.c
r2234 r2340 1075 1075 1076 1076 PJ_LOG(4,(sess->obj_name, "Trying next server")); 1077 1078 status = pj_turn_session_alloc(sess, NULL);1077 set_state(sess, PJ_TURN_STATE_RESOLVED); 1078 break; 1079 1079 1080 1080 } while (status != PJ_SUCCESS); -
pjproject/trunk/pjnath/src/pjturn-client/client_main.c
r2125 r2340 49 49 pj_bool_t quit; 50 50 51 pj_dns_resolver *resolver; 52 51 53 pj_turn_sock *relay; 52 54 pj_sockaddr relay_addr; … … 65 67 pj_bool_t use_fingerprint; 66 68 char *stun_server; 69 char *nameserver; 67 70 } o; 68 71 … … 244 247 } 245 248 249 /* Create DNS resolver if configured */ 250 if (o.nameserver) { 251 pj_str_t ns = pj_str(o.nameserver); 252 253 status = pj_dns_resolver_create(&g.cp.factory, "resolver", 0, 254 g.stun_config.timer_heap, 255 g.stun_config.ioqueue, &g.resolver); 256 if (status != PJ_SUCCESS) { 257 PJ_LOG(1,(THIS_FILE, "Error creating resolver (err=%d)", status)); 258 return status; 259 } 260 261 status = pj_dns_resolver_set_ns(g.resolver, 1, &ns, NULL); 262 if (status != PJ_SUCCESS) { 263 PJ_LOG(1,(THIS_FILE, "Error configuring nameserver (err=%d)", status)); 264 return status; 265 } 266 } 267 246 268 pj_bzero(&rel_cb, sizeof(rel_cb)); 247 269 rel_cb.on_rx_data = &turn_on_rx_data; … … 268 290 &srv, /* srv addr */ 269 291 (o.srv_port?atoi(o.srv_port):PJ_STUN_PORT),/* def port */ 270 NULL, /* resolver */292 g.resolver, /* resolver */ 271 293 (o.user_name?&cred:NULL), /* credential */ 272 294 NULL) /* alloc param */ … … 503 525 puts(" --password, -p PASSWD Set password of the credential to PASSWD"); 504 526 puts(" --fingerprint, -F Use fingerprint for outgoing requests"); 505 puts(" --stun-srv, -S Use this STUN srv instead of TURN for Binding discovery"); 527 puts(" --stun-srv, -S NAME Use this STUN srv instead of TURN for Binding discovery"); 528 puts(" --nameserver, -N IP Activate DNS SRV, use this DNS server"); 506 529 puts(" --help, -h"); 507 530 } … … 516 539 { "tcp", 0, 0, 'T'}, 517 540 { "help", 0, 0, 'h'}, 518 { "stun-srv", 1, 0, 'S'} 541 { "stun-srv", 1, 0, 'S'}, 542 { "nameserver", 1, 0, 'N'} 519 543 }; 520 544 int c, opt_id; … … 522 546 pj_status_t status; 523 547 524 while((c=pj_getopt_long(argc,argv, "r:u:p:S: hFT", long_options, &opt_id))!=-1) {548 while((c=pj_getopt_long(argc,argv, "r:u:p:S:N:hFT", long_options, &opt_id))!=-1) { 525 549 switch (c) { 526 550 case 'r': … … 544 568 case 'S': 545 569 o.stun_server = pj_optarg; 570 break; 571 case 'N': 572 o.nameserver = pj_optarg; 546 573 break; 547 574 default:
Note: See TracChangeset
for help on using the changeset viewer.