Changeset 2531


Ignore:
Timestamp:
Mar 23, 2009 1:02:53 PM (10 years ago)
Author:
bennylp
Message:

Ticket #743: backported from ticket #742

Location:
pjproject/branches/1.0
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.0

  • pjproject/branches/1.0/pjnath/include/pjnath/stun_sock.h

    r2394 r2531  
    7474     */ 
    7575    PJ_STUN_SOCK_KEEP_ALIVE_OP, 
     76 
     77    /** 
     78     * IP address change notification from the keep-alive operation. 
     79     */ 
     80    PJ_STUN_SOCK_MAPPED_ADDR_CHANGE 
     81 
    7682 
    7783} pj_stun_sock_op; 
  • pjproject/branches/1.0/pjnath/src/pjnath-test/stun_sock_test.c

    r2394 r2531  
    628628     * called 
    629629     */ 
     630    /* No longer valid due to this ticket: 
     631     *  http://trac.pjsip.org/repos/ticket/742 
     632 
    630633    if (client->on_status_cnt != 0) { 
    631634        PJ_LOG(3, (THIS_FILE, "    error: on_status() must not be called on successful" 
     
    634637        goto on_return; 
    635638    } 
     639    */ 
    636640    /* Check that client doesn't receive anything */ 
    637641    if (client->on_rx_data_cnt != 0) { 
     
    687691    } 
    688692    /* Check that callback was called with correct operation */ 
    689     if (client->last_op != PJ_STUN_SOCK_KEEP_ALIVE_OP) { 
     693    if (client->last_op != PJ_STUN_SOCK_MAPPED_ADDR_CHANGE) { 
    690694        PJ_LOG(3,(THIS_FILE, "    error: expecting keep-alive operation status")); 
    691695        ret = -470; 
  • pjproject/branches/1.0/pjnath/src/pjnath/ice_strans.c

    r2394 r2531  
    12661266        break; 
    12671267    case PJ_STUN_SOCK_BINDING_OP: 
     1268    case PJ_STUN_SOCK_MAPPED_ADDR_CHANGE: 
    12681269        if (status == PJ_SUCCESS) { 
    12691270            pj_stun_sock_info info; 
     
    12721273            if (status == PJ_SUCCESS) { 
    12731274                char ipaddr[PJ_INET6_ADDRSTRLEN+10]; 
     1275                const char *op_name = (op==PJ_STUN_SOCK_BINDING_OP) ? 
     1276                                    "Binding discovery complete" : 
     1277                                    "srflx address changed"; 
    12741278                pj_bool_t dup = PJ_FALSE; 
    12751279 
     
    13091313 
    13101314                PJ_LOG(4,(comp->ice_st->obj_name,  
    1311                           "Comp %d: Binding discovery complete, " 
     1315                          "Comp %d: %s, " 
    13121316                          "srflx address is %s", 
    1313                           comp->comp_id,  
     1317                          comp->comp_id, op_name,  
    13141318                          pj_sockaddr_print(&info.mapped_addr, ipaddr,  
    13151319                                             sizeof(ipaddr), 3))); 
  • pjproject/branches/1.0/pjnath/src/pjnath/stun_sock.c

    r2394 r2531  
    670670        pj_sockaddr_cp(&stun_sock->mapped_addr, &mapped_attr->sockaddr); 
    671671 
    672         resched = (*stun_sock->cb.on_status)(stun_sock, op, PJ_SUCCESS); 
    673  
    674         goto on_return; 
    675     } 
     672        if (op==PJ_STUN_SOCK_KEEP_ALIVE_OP) 
     673            op = PJ_STUN_SOCK_MAPPED_ADDR_CHANGE; 
     674    } 
     675 
     676    /* Notify user */ 
     677    resched = (*stun_sock->cb.on_status)(stun_sock, op, PJ_SUCCESS); 
    676678 
    677679on_return: 
Note: See TracChangeset for help on using the changeset viewer.