Ignore:
Timestamp:
Jun 22, 2009 2:06:40 PM (12 years ago)
Author:
nanang
Message:

Ticket #758:

  • fixed transport TCP to call on_connect_complete when connect() returns PJ_SUCCESS.
  • added option to enable transport TCP in symbian_ua.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c

    r2394 r2781  
    806806                                         sizeof(pj_sockaddr_in)); 
    807807    if (status == PJ_SUCCESS) { 
    808         tcp->has_pending_connect = PJ_FALSE; 
     808        on_connect_complete(tcp->asock, PJ_SUCCESS); 
    809809    } else if (status != PJ_EPENDING) { 
    810810        tcp_destroy(&tcp->base, status); 
     
    812812    } 
    813813 
    814     /* Update (again) local address, just in case local address currently 
    815      * set is different now that asynchronous connect() is started. 
    816      */ 
    817     addr_len = sizeof(pj_sockaddr_in); 
    818     if (pj_sock_getsockname(sock, &local_addr, &addr_len)==PJ_SUCCESS) { 
    819         pj_sockaddr_in *tp_addr = (pj_sockaddr_in*)&tcp->base.local_addr; 
    820  
    821         /* Some systems (like old Win32 perhaps) may not set local address 
    822          * properly before socket is fully connected. 
     814    if (tcp->has_pending_connect) { 
     815        /* Update (again) local address, just in case local address currently 
     816         * set is different now that asynchronous connect() is started. 
    823817         */ 
    824         if (tp_addr->sin_addr.s_addr != local_addr.sin_addr.s_addr && 
    825             local_addr.sin_addr.s_addr != 0)  
    826         { 
    827             tp_addr->sin_addr.s_addr = local_addr.sin_addr.s_addr; 
    828             tp_addr->sin_port = local_addr.sin_port; 
    829             sockaddr_to_host_port(tcp->base.pool, &tcp->base.local_name, 
    830                                   &local_addr); 
     818        addr_len = sizeof(pj_sockaddr_in); 
     819        if (pj_sock_getsockname(sock, &local_addr, &addr_len)==PJ_SUCCESS) { 
     820            pj_sockaddr_in *tp_addr = (pj_sockaddr_in*)&tcp->base.local_addr; 
     821 
     822            /* Some systems (like old Win32 perhaps) may not set local address 
     823             * properly before socket is fully connected. 
     824             */ 
     825            if (tp_addr->sin_addr.s_addr != local_addr.sin_addr.s_addr && 
     826                local_addr.sin_addr.s_addr != 0)  
     827            { 
     828                tp_addr->sin_addr.s_addr = local_addr.sin_addr.s_addr; 
     829                tp_addr->sin_port = local_addr.sin_port; 
     830                sockaddr_to_host_port(tcp->base.pool, &tcp->base.local_name, 
     831                                      &local_addr); 
     832            } 
    831833        } 
    832     } 
    833  
    834     if (tcp->has_pending_connect) { 
     834         
    835835        PJ_LOG(4,(tcp->base.obj_name,  
    836836                  "TCP transport %.*s:%d is connecting to %.*s:%d...", 
Note: See TracChangeset for help on using the changeset viewer.