Changeset 5983 for pjproject


Ignore:
Timestamp:
May 9, 2019 7:47:39 AM (5 years ago)
Author:
nanang
Message:

Re #1298: Updated PJNATH to use PJ_ERROR consistently.

Location:
pjproject/trunk/pjnath/src/pjnath
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/errno.c

    r5535 r5983  
    194194                           pj_status_t status) 
    195195{ 
    196     char errmsg[PJ_ERR_MSG_SIZE]; 
    197  
    198     pj_strerror(status, errmsg, sizeof(errmsg)); 
    199  
    200196#if PJNATH_ERROR_LEVEL==1 
    201     PJ_LOG(1,(sender, "%s: %s", title, errmsg)); 
     197    PJ_PERROR(1,(sender, status, title)); 
    202198#elif PJNATH_ERROR_LEVEL==2 
    203     PJ_LOG(2,(sender, "%s: %s", title, errmsg)); 
     199    PJ_PERROR(2,(sender, status, title)); 
    204200#elif PJNATH_ERROR_LEVEL==3 
    205     PJ_LOG(3,(sender, "%s: %s", title, errmsg)); 
     201    PJ_PERROR(3,(sender, status, title)); 
    206202#elif PJNATH_ERROR_LEVEL==4 
    207     PJ_LOG(4,(sender, "%s: %s", title, errmsg)); 
     203    PJ_PERROR(4,(sender, status, title)); 
    208204#elif PJNATH_ERROR_LEVEL==5 
    209     PJ_LOG(5,(sender, "%s: %s", title, errmsg)); 
     205    PJ_PERROR(5,(sender, status, title)); 
    210206#else 
    211207# error Invalid PJNATH_ERROR_LEVEL value 
  • pjproject/trunk/pjnath/src/pjnath/ice_strans.c

    r5861 r5983  
    959959                      const char *title, pj_status_t status) 
    960960{ 
    961     char errmsg[PJ_ERR_MSG_SIZE]; 
    962  
    963     pj_strerror(status, errmsg, sizeof(errmsg)); 
    964     PJ_LOG(4,(ice_st->obj_name, "%s: %s", title, errmsg)); 
     961    PJ_PERROR(4,(ice_st->obj_name, status, title)); 
     962 
    965963    pj_log_push_indent(); 
    966964 
     
    15881586    if (cb.on_ice_complete) { 
    15891587        if (status != PJ_SUCCESS) { 
    1590             char errmsg[PJ_ERR_MSG_SIZE]; 
    1591             pj_strerror(status, errmsg, sizeof(errmsg)); 
    1592             PJ_LOG(4,(ice_st->obj_name, 
    1593                       "ICE negotiation failed after %ds:%03d: %s", 
    1594                       msec/1000, msec%1000, errmsg)); 
     1588            PJ_PERROR(4,(ice_st->obj_name, status, 
     1589                         "ICE negotiation failed after %ds:%03d", 
     1590                         msec/1000, msec%1000)); 
    15951591        } else { 
    15961592            unsigned i; 
  • pjproject/trunk/pjnath/src/pjnath/nat_detect.c

    r5833 r5983  
    582582    } 
    583583 
    584     PJ_LOG(5,(sess->pool->obj_name, "Completed %s, status=%d", 
    585               test_names[test_id], status)); 
     584    PJ_PERROR(5,(sess->pool->obj_name, status, "Completed %s", 
     585                 test_names[test_id])); 
    586586 
    587587    sess->result[test_id].complete = PJ_TRUE; 
  • pjproject/trunk/pjnath/src/pjnath/stun_session.c

    r5233 r5983  
    12211221                                          &response); 
    12221222    if (status != PJ_SUCCESS && response != NULL) { 
    1223         PJ_LOG(5,(SNAME(sess), "Message authentication failed")); 
     1223        PJ_PERROR(5,(SNAME(sess), status, "Message authentication failed")); 
    12241224        send_response(sess, token, tmp_pool, response, &rdata->info,  
    12251225                      PJ_FALSE, src_addr, src_addr_len); 
     
    12631263                                               &tdata->auth_info.auth_key); 
    12641264        if (status != PJ_SUCCESS) { 
    1265             PJ_LOG(5,(SNAME(sess),  
    1266                       "Response authentication failed")); 
     1265            PJ_PERROR(5,(SNAME(sess), status, 
     1266                        "Response authentication failed")); 
    12671267            return status; 
    12681268        } 
  • pjproject/trunk/pjnath/src/pjnath/stun_sock.c

    r5861 r5983  
    244244                                          PJ_TRUE, &sobuf_size); 
    245245        if (status != PJ_SUCCESS) { 
    246             pj_perror(3, stun_sock->obj_name, status, 
    247                       "Failed setting SO_RCVBUF"); 
     246            PJ_PERROR(3, (stun_sock->obj_name, status, 
     247                          "Failed setting SO_RCVBUF")); 
    248248        } else { 
    249249            if (sobuf_size < cfg->so_rcvbuf_size) { 
     
    263263                                          PJ_TRUE, &sobuf_size); 
    264264        if (status != PJ_SUCCESS) { 
    265             pj_perror(3, stun_sock->obj_name, status, 
    266                       "Failed setting SO_SNDBUF"); 
     265            PJ_PERROR(3, (stun_sock->obj_name, status, 
     266                          "Failed setting SO_SNDBUF")); 
    267267        } else { 
    268268            if (sobuf_size < cfg->so_sndbuf_size) { 
  • pjproject/trunk/pjnath/src/pjnath/turn_session.c

    r5636 r5983  
    19331933                                        PJ_STUN_MAGIC, NULL, &tdata); 
    19341934                    if (status != PJ_SUCCESS) { 
    1935                         PJ_LOG(1,(sess->obj_name,  
    1936                                  "Error creating CreatePermission request: %d", 
    1937                                  status)); 
     1935                        PJ_PERROR(1,(sess->obj_name, status, 
     1936                                  "Error creating CreatePermission request")); 
    19381937                        return 0; 
    19391938                    } 
     
    19781977                                          tdata); 
    19791978        if (status != PJ_SUCCESS) { 
    1980             PJ_LOG(1,(sess->obj_name,  
    1981                       "Error sending CreatePermission request: %d", 
    1982                       status)); 
     1979            PJ_PERROR(1,(sess->obj_name, status, 
     1980                      "Error sending CreatePermission request")); 
    19831981            count = 0; 
    19841982        } 
  • pjproject/trunk/pjnath/src/pjnath/turn_sock.c

    r5596 r5983  
    835835                                              PJ_TRUE, &sobuf_size); 
    836836            if (status != PJ_SUCCESS) { 
    837                 pj_perror(3, turn_sock->obj_name, status, 
    838                           "Failed setting SO_RCVBUF"); 
     837                PJ_PERROR(3, (turn_sock->obj_name, status, 
     838                              "Failed setting SO_RCVBUF")); 
    839839            } else { 
    840840                if (sobuf_size < turn_sock->setting.so_rcvbuf_size) { 
     
    854854                                              PJ_TRUE, &sobuf_size); 
    855855            if (status != PJ_SUCCESS) { 
    856                 pj_perror(3, turn_sock->obj_name, status, 
    857                           "Failed setting SO_SNDBUF"); 
     856                PJ_PERROR(3, (turn_sock->obj_name, status, 
     857                              "Failed setting SO_SNDBUF")); 
    858858            } else { 
    859859                if (sobuf_size < turn_sock->setting.so_sndbuf_size) { 
     
    905905            on_connect_complete(turn_sock->active_sock, PJ_SUCCESS); 
    906906        } else if (status != PJ_EPENDING) { 
    907             pj_perror(3, turn_sock->pool->obj_name, status, 
    908                       "Failed to connect to %s", 
    909                       pj_sockaddr_print(&info.server, addrtxt, 
    910                                         sizeof(addrtxt), 3)); 
     907            PJ_PERROR(3, (turn_sock->pool->obj_name, status, 
     908                          "Failed to connect to %s", 
     909                          pj_sockaddr_print(&info.server, addrtxt, 
     910                                            sizeof(addrtxt), 3))); 
    911911            pj_turn_sock_destroy(turn_sock); 
    912912            return; 
Note: See TracChangeset for help on using the changeset viewer.