Ignore:
Timestamp:
Feb 27, 2013 2:31:05 PM (12 years ago)
Author:
riza
Message:

Re #1610: backported to 1.x

Location:
pjproject/branches/1.x
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x

  • pjproject/branches/1.x/pjnath/src/pjnath/stun_sock.c

    r3944 r4400  
    387387    } 
    388388 
     389    if (stun_sock->stun_sess) { 
     390        pj_stun_session_set_user_data(stun_sock->stun_sess, NULL); 
     391    } 
     392     
    389393    /* Destroy the active socket first just in case we'll get 
    390394     * stray callback. 
    391395     */ 
    392396    if (stun_sock->active_sock != NULL) { 
    393         pj_activesock_close(stun_sock->active_sock); 
     397        pj_activesock_t *asock = stun_sock->active_sock; 
    394398        stun_sock->active_sock = NULL; 
    395399        stun_sock->sock_fd = PJ_INVALID_SOCKET; 
     400        pj_activesock_set_user_data(asock, NULL); 
     401        pj_activesock_close(asock); 
    396402    } else if (stun_sock->sock_fd != PJ_INVALID_SOCKET) { 
    397403        pj_sock_close(stun_sock->sock_fd); 
     
    616622 
    617623    stun_sock = (pj_stun_sock *) pj_stun_session_get_user_data(sess); 
     624    if (!stun_sock || !stun_sock->active_sock) 
     625        return PJ_EINVALIDOP; 
    618626 
    619627    pj_assert(token==INTERNAL_MSG_TOKEN); 
     
    644652 
    645653    stun_sock = (pj_stun_sock *) pj_stun_session_get_user_data(sess); 
     654    if (!stun_sock) 
     655        return; 
    646656 
    647657    PJ_UNUSED_ARG(tdata); 
     
    766776 
    767777    stun_sock = (pj_stun_sock*) pj_activesock_get_user_data(asock); 
     778    if (!stun_sock) 
     779        return PJ_FALSE; 
    768780 
    769781    /* Log socket error */ 
     
    830842 
    831843    stun_sock = (pj_stun_sock*) pj_activesock_get_user_data(asock); 
     844    if (!stun_sock) 
     845        return PJ_FALSE; 
    832846 
    833847    /* Don't report to callback if this is internal message */ 
Note: See TracChangeset for help on using the changeset viewer.