Ignore:
Timestamp:
Feb 25, 2010 11:58:19 AM (15 years ago)
Author:
nanang
Message:

More ticket #1032:

  • Updated transport state notification callback to return void.
  • Updated transport state enum to only contain connected and disconnected, no more bitmask value.
  • Added direction field to SIP transport.
  • Removed remote hostname hash from transport key.
  • Updated cert info dump to return -1 when buffer is insufficient.
  • Added new error code PJSIP_TLS_ECERTVERIF.
  • Updated get_cert_name() in ssl_sock_symbian.c to use heap buffer instead of stack.
  • Minors, e.g: added prefix PJ in cipher types, docs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r3106 r3110  
    27912791 * Transport status notification 
    27922792 */ 
    2793 static pj_bool_t on_transport_state(pjsip_transport *tp, pj_uint32_t state, 
    2794                                     const pjsip_transport_state_info *info) 
     2793static void on_transport_state(pjsip_transport *tp,  
     2794                               pjsip_transport_state state, 
     2795                               const pjsip_transport_state_info *info) 
    27952796{ 
    27962797    char host_port[128]; 
     
    28012802                     tp->remote_name.port); 
    28022803 
    2803     if (state & PJSIP_TP_STATE_CONNECTED) { 
    2804         PJ_LOG(3,(THIS_FILE, "SIP transport %s is connected to %s",  
    2805                  tp->type_name, host_port)); 
    2806     }  
    2807     else if (state & PJSIP_TP_STATE_ACCEPTED) { 
    2808         PJ_LOG(3,(THIS_FILE, "SIP transport %s accepted %s", 
    2809                  tp->type_name, host_port)); 
    2810     }  
    2811     else if (state & PJSIP_TP_STATE_DISCONNECTED) { 
    2812         char buf[100]; 
    2813  
    2814         snprintf(buf, sizeof(buf), "SIP transport %s is disconnected from %s", 
    2815                  tp->type_name, host_port); 
    2816         pjsua_perror(THIS_FILE, buf, info->status); 
    2817     } 
    2818     else if (state & PJSIP_TP_STATE_REJECTED) { 
    2819         char buf[100]; 
    2820  
    2821         snprintf(buf, sizeof(buf), "SIP transport %s rejected %s", 
    2822                  tp->type_name, host_port); 
    2823         pjsua_perror(THIS_FILE, buf, info->status); 
     2804    switch (state) { 
     2805    case PJSIP_TP_STATE_CONNECTED: 
     2806        { 
     2807            PJ_LOG(3,(THIS_FILE, "SIP transport %s is connected to %s",  
     2808                     tp->type_name, host_port)); 
     2809        } 
     2810        break; 
     2811 
     2812    case PJSIP_TP_STATE_DISCONNECTED: 
     2813        { 
     2814            char buf[100]; 
     2815 
     2816            snprintf(buf, sizeof(buf), "SIP transport %s is disconnected from %s", 
     2817                     tp->type_name, host_port); 
     2818            pjsua_perror(THIS_FILE, buf, info->status); 
     2819        } 
     2820        break; 
     2821 
     2822    default: 
     2823        break; 
    28242824    } 
    28252825 
     
    28282828    if (!pj_ansi_stricmp(tp->type_name, "tls") && info->ext_info && 
    28292829        (state == PJSIP_TP_STATE_CONNECTED ||  
    2830          (state & PJSIP_TP_STATE_TLS_VERIF_ERROR))) 
     2830         ((pjsip_tls_state_info*)info->ext_info)-> 
     2831                                 ssl_sock_info->verify_status != PJ_SUCCESS)) 
    28312832    { 
    28322833        pjsip_tls_state_info *tls_info = (pjsip_tls_state_info*)info->ext_info; 
    2833         pj_ssl_sock_info *ssl_sock_info = (pj_ssl_sock_info*) 
    2834                                           tls_info->ssl_sock_info; 
     2834        pj_ssl_sock_info *ssl_sock_info = tls_info->ssl_sock_info; 
    28352835        char buf[2048]; 
    28362836        const char *verif_msgs[32]; 
     
    28442844        /* Dump server TLS certificate verification result */ 
    28452845        verif_msg_cnt = PJ_ARRAY_SIZE(verif_msgs); 
    2846         pj_ssl_cert_verify_error_st(ssl_sock_info->verify_status, 
    2847                                     verif_msgs, &verif_msg_cnt); 
     2846        pj_ssl_cert_get_verify_status_strings(ssl_sock_info->verify_status, 
     2847                                              verif_msgs, &verif_msg_cnt); 
    28482848        PJ_LOG(3,(THIS_FILE, "TLS cert verification result of %s : %s", 
    28492849                             host_port, 
     
    28552855        } 
    28562856 
    2857         if (state & PJSIP_TP_STATE_TLS_VERIF_ERROR &&  
     2857        if (ssl_sock_info->verify_status && 
    28582858            !app_config.udp_cfg.tls_setting.verify_server)  
    28592859        { 
     
    28642864 
    28652865#endif 
    2866     return PJ_TRUE; 
     2866 
    28672867} 
    28682868 
Note: See TracChangeset for help on using the changeset viewer.