Ignore:
Timestamp:
Dec 11, 2015 4:59:56 AM (5 years ago)
Author:
ming
Message:

Fixed #1901: crash when async_cnt is set to a value greater than one for SIP TLS transport

File:
1 edited

Legend:

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

    r5212 r5214  
    315315    pj_uint32_t sip_ssl_proto; 
    316316    struct tls_listener *listener; 
    317     pj_ssl_sock_param ssock_param; 
     317    pj_ssl_sock_param ssock_param, newsock_param; 
    318318    pj_sockaddr *listener_addr; 
    319319    pj_bool_t has_listener; 
     
    472472    has_listener = PJ_FALSE; 
    473473 
    474     status = pj_ssl_sock_start_accept(listener->ssock, pool,  
     474    pj_memcpy(&newsock_param, &ssock_param, sizeof(newsock_param)); 
     475    newsock_param.async_cnt = 1; 
     476    newsock_param.cb.on_data_read = &on_data_read; 
     477    newsock_param.cb.on_data_sent = &on_data_sent; 
     478    status = pj_ssl_sock_start_accept2(listener->ssock, pool,  
    475479                          (pj_sockaddr_t*)listener_addr,  
    476                           pj_sockaddr_get_len((pj_sockaddr_t*)listener_addr)); 
     480                          pj_sockaddr_get_len((pj_sockaddr_t*)listener_addr), 
     481                          &newsock_param); 
    477482    if (status == PJ_SUCCESS || status == PJ_EPENDING) { 
    478483        pj_ssl_sock_info info; 
Note: See TracChangeset for help on using the changeset viewer.