Changeset 416:2db037c7ce5f in verona
- Timestamp:
- Jan 17, 2012 3:55:07 PM (16 months ago)
- Branch:
- default
- rebase_source:
- 6126c71f04a05bf0798d5cfae88e3467840eed65
- Files:
-
- 4 edited
-
libeXosip2/src/eXconf.c (modified) (4 diffs)
-
libeXosip2/src/eXtl_socks.c (modified) (6 diffs)
-
libeXosip2/src/jcallback.c (modified) (1 diff)
-
phapi/phapi.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libeXosip2/src/eXconf.c
r389 r416 636 636 int i; 637 637 struct eXtl_protocol* proto; 638 int port; 638 639 639 640 for(i = 0; proto = socks_proto_tab[i]; i++) … … 650 651 651 652 eXosip.eXtl = proto; 653 port = atoi(tport); 652 654 proto->tl_init(); 653 proto->tl_masquerade_contact(tserver, atoi(tport));655 proto->tl_masquerade_contact(tserver, port); 654 656 snprintf(eXosip.transport, sizeof(eXosip.transport), "%s", 655 657 proto->proto_num == IPPROTO_UDP ? "UDP" : "TCP"); … … 666 668 } 667 669 #endif 668 669 670 return 0; 670 671 } … … 770 771 eXosip.keep_alive = 17000; 771 772 772 eXtl_udp.tl_init(); 773 eXtl_tcp.tl_init(); 773 if (!eXosip.eXtl) { 774 eXtl_udp.tl_init(); 775 eXtl_tcp.tl_init(); 774 776 #ifdef HAVE_OPENSSL_SSL_H 775 777 #if !(OPENSSL_VERSION_NUMBER < 0x00908000L) 776 778 eXtl_dtls.tl_init(); 777 779 #endif 778 eXtl_tls.tl_init(); 780 eXtl_tls.tl_init(); 781 } 779 782 #endif 780 783 return OSIP_SUCCESS; -
libeXosip2/src/eXtl_socks.c
r390 r416 284 284 return -1; 285 285 286 if (resp.atp != 0)286 if (resp.atp != 1) 287 287 return -1; 288 288 … … 293 293 ina.s_addr = resp.destip; 294 294 osip_strncpy(sk->public_ip, inet_ntoa(ina), sizeof(sk->public_ip)-1); 295 sk->public_port = ntoh l(resp.dport);295 sk->public_port = ntohs(resp.dport); 296 296 297 297 return 0; … … 334 334 curinfo->ai_protocol); 335 335 336 337 if (sock < 0) { 338 OSIP_TRACE(osip_trace 339 (__FILE__, __LINE__, OSIP_ERROR, NULL, 340 "Cannot create socket %s!\n", strerror(ex_errno))); 341 continue; 342 } 336 if (sock) 337 break; 338 339 OSIP_TRACE(osip_trace 340 (__FILE__, __LINE__, OSIP_ERROR, NULL, 341 "Cannot create socket %s!\n", strerror(ex_errno))); 343 342 344 343 } … … 348 347 sk->socket = sock; 349 348 sk->remote_port = port; 350 osip_strncpy(sk->remote_ip, addr, sizeof(sk->remote_ip) );349 osip_strncpy(sk->remote_ip, addr, sizeof(sk->remote_ip)-1); 351 350 if (!socks_negotiate(sk)) { 352 351 eXosip_freeaddrinfo(addrinfo); … … 375 374 if (mode & SOCKST_UDPMASK) { 376 375 sk->pbuf = osip_malloc(SIP_MESSAGE_MAX_LENGTH); 377 if ( sk->pbuf) {376 if (!sk->pbuf) { 378 377 closesocket(sk->socket); 379 378 return 0; … … 852 851 return -1; 853 852 memcpy(pfx+1, message, length); 853 pfx->len = htonl(length); 854 854 length += sizeof(*pfx); 855 855 osip_free(message); -
libeXosip2/src/jcallback.c
r268 r416 193 193 194 194 i = -1; 195 if (osip_strcasecmp(via->protocol, "udp") == 0) { 195 if (eXosip.eXtl) { 196 i = eXosip.eXtl->tl_send_message(tr, sip, host, port, out_socket); 197 } 198 else if (osip_strcasecmp(via->protocol, "udp") == 0) { 196 199 i = eXtl_udp.tl_send_message(tr, sip, host, port, out_socket); 197 200 } else if (osip_strcasecmp(via->protocol, "tcp") == 0) { -
phapi/phapi.c
r415 r416 290 290 eos++; 291 291 292 while(*uri && !isspace(*uri))292 while(*uri && isspace(*uri)) 293 293 uri++; 294 294 295 295 296 copyfield(tun->tunnel_proto, uri, addr -1, sizeof(tun->tunnel_proto)-1);296 copyfield(tun->tunnel_proto, uri, addr, sizeof(tun->tunnel_proto)-1); 297 297 copyfield(tun->tunnel_server, addr+3, port, sizeof(tun->tunnel_server)-1); 298 298 copyfield(tun->tunnel_port, port+1, eos, sizeof(tun->tunnel_port)-1); … … 320 320 } 321 321 322 return tun - tinfo;322 return i; 323 323 } 324 324 … … 4262 4262 } 4263 4263 4264 if (phcfg.use_tunnel & PH_TUNNEL_USE) { 4265 tun = ph_select_tunnel(sip_tunnel_set, TUNNEL_MAX); 4266 if (tun) 4267 eXosip_set_tunnel(tun->tunnel_proto, tun->tunnel_server, tun->tunnel_port);; 4268 } 4264 return 0; 4269 4265 #endif 4270 4266 … … 4728 4724 if (i) 4729 4725 return -1; 4726 4727 if (phcfg.use_tunnel & PH_TUNNEL_USE) { 4728 struct tunnel_info *tun; 4729 4730 tun = ph_select_tunnel(sip_tunnel_set, sip_tunnel_count); 4731 if (tun) 4732 eXosip_set_tunnel(tun->tunnel_proto, tun->tunnel_server, tun->tunnel_port);; 4733 } 4734 4730 4735 4731 4736 ph_nat_init(); … … 4739 4744 } 4740 4745 4741 i = phListenAddr(atoi(phcfg.sipport)); 4742 if(i) 4743 return -1; 4746 if (!(phcfg.use_tunnel & PH_TUNNEL_USE)) { 4747 i = phListenAddr(atoi(phcfg.sipport)); 4748 if(i) 4749 return -1; 4750 } 4744 4751 4745 4752 {
Note: See TracChangeset
for help on using the changeset viewer.
