Changeset 5200 for pjproject


Ignore:
Timestamp:
Nov 16, 2015 4:42:42 AM (9 years ago)
Author:
nanang
Message:

Fix #1898: If transport is being shutdown/destroyed and connected event comes, proceed as error/cancelled connect.

Location:
pjproject/trunk/pjsip/src/pjsip
Files:
2 edited

Legend:

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

    r5170 r5200  
    14711471    tcp->has_pending_connect = PJ_FALSE; 
    14721472 
    1473     if (tcp->base.is_shutdown || tcp->base.is_destroying)  
    1474         return PJ_FALSE; 
     1473    /* If transport is being shutdown/destroyed, proceed as error connect. 
     1474     * Note that it is important to notify application via on_data_sent() 
     1475     * as otherwise the transport reference counter may never reach zero 
     1476     * (see #1898). 
     1477     */ 
     1478    if ((tcp->base.is_shutdown || tcp->base.is_destroying) && 
     1479        status == PJ_SUCCESS) 
     1480    { 
     1481        status = PJ_ECANCELLED; 
     1482    } 
    14751483 
    14761484    /* Check connect() status */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c

    r5152 r5200  
    15671567    tls = (struct tls_transport*) pj_ssl_sock_get_user_data(ssock); 
    15681568 
    1569     if (tls->base.is_shutdown || tls->base.is_destroying)  
    1570         return PJ_FALSE; 
     1569    /* If transport is being shutdown/destroyed, proceed as error connect. 
     1570     * Note that it is important to notify application via on_data_sent() 
     1571     * as otherwise the transport reference counter may never reach zero 
     1572     * (see #1898). 
     1573     */ 
     1574    if ((tls->base.is_shutdown || tls->base.is_destroying) && 
     1575        status == PJ_SUCCESS) 
     1576    { 
     1577        status = PJ_ECANCELLED; 
     1578    } 
    15711579 
    15721580    /* Check connect() status */ 
Note: See TracChangeset for help on using the changeset viewer.