Ignore:
Timestamp:
Sep 18, 2011 2:59:56 PM (13 years ago)
Author:
bennylp
Message:

Modified the libraries to use the new log indentation feature re #1372

File:
1 edited

Legend:

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

    r3553 r3753  
    406406                      comp_id)); 
    407407 
     408            pj_log_push_indent(); 
     409 
    408410            /* Start Binding resolution */ 
    409411            status = pj_stun_sock_start(comp->stun_sock,  
     
    413415            if (status != PJ_SUCCESS) { 
    414416                ///sess_dec_ref(ice_st); 
     417                pj_log_pop_indent(); 
    415418                return status; 
    416419            } 
     
    420423            if (status != PJ_SUCCESS) { 
    421424                ///sess_dec_ref(ice_st); 
     425                pj_log_pop_indent(); 
    422426                return status; 
    423427            } 
     
    438442            comp->default_cand = cand - comp->cand_list; 
    439443 
     444            pj_log_pop_indent(); 
    440445        } 
    441446 
     
    537542              "Creating ICE stream transport with %d component(s)", 
    538543              comp_cnt)); 
     544    pj_log_push_indent(); 
    539545 
    540546    pj_ice_strans_cfg_copy(pool, &ice_st->cfg, cfg); 
     
    551557    if (status != PJ_SUCCESS) { 
    552558        destroy_ice_st(ice_st); 
     559        pj_log_pop_indent(); 
    553560        return status; 
    554561    } 
     
    571578            pj_lock_release(ice_st->init_lock); 
    572579            destroy_ice_st(ice_st); 
     580            pj_log_pop_indent(); 
    573581            return status; 
    574582        } 
     
    584592 
    585593    *p_ice_st = ice_st; 
     594    pj_log_pop_indent(); 
     595 
    586596    return PJ_SUCCESS; 
    587597} 
     
    591601{ 
    592602    unsigned i; 
     603 
     604    PJ_LOG(5,(ice_st->obj_name, "ICE stream transport destroying..")); 
     605    pj_log_push_indent(); 
    593606 
    594607    /* Destroy ICE if we have ICE */ 
     
    630643    } 
    631644 
     645    PJ_LOG(4,(ice_st->obj_name, "ICE stream transport destroyed")); 
     646 
    632647    /* Done */ 
    633648    pj_pool_release(ice_st->pool); 
     649    pj_log_pop_indent(); 
    634650} 
    635651 
     
    665681    pj_strerror(status, errmsg, sizeof(errmsg)); 
    666682    PJ_LOG(4,(ice_st->obj_name, "%s: %s", title, errmsg)); 
    667  
    668     if (op==PJ_ICE_STRANS_OP_INIT && ice_st->cb_called) 
     683    pj_log_push_indent(); 
     684 
     685    if (op==PJ_ICE_STRANS_OP_INIT && ice_st->cb_called) { 
     686        pj_log_pop_indent(); 
    669687        return; 
     688    } 
    670689 
    671690    ice_st->cb_called = PJ_TRUE; 
     
    673692    if (ice_st->cb.on_ice_complete) 
    674693        (*ice_st->cb.on_ice_complete)(ice_st, op, status); 
     694 
     695    pj_log_pop_indent(); 
    675696} 
    676697 
     
    710731PJ_DEF(pj_status_t) pj_ice_strans_destroy(pj_ice_strans *ice_st) 
    711732{ 
    712     char obj_name[PJ_MAX_OBJ_NAME]; 
    713  
    714733    PJ_ASSERT_RETURN(ice_st, PJ_EINVAL); 
    715734 
     
    721740    } 
    722741     
    723     pj_memcpy(obj_name, ice_st->obj_name, PJ_MAX_OBJ_NAME); 
    724742    destroy_ice_st(ice_st); 
    725  
    726     PJ_LOG(4,(obj_name, "ICE stream transport destroyed")); 
    727743    return PJ_SUCCESS; 
    728744} 
     
    12951311                                               PJ_ICE_STRANS_STATE_FAILED; 
    12961312 
     1313        pj_log_push_indent(); 
    12971314        (*ice_st->cb.on_ice_complete)(ice_st, PJ_ICE_STRANS_OP_NEGOTIATION,  
    12981315                                      status); 
    1299  
     1316        pj_log_pop_indent(); 
    13001317         
    13011318    } 
     
    16161633    PJ_LOG(5,(comp->ice_st->obj_name, "TURN client state changed %s --> %s", 
    16171634              pj_turn_state_name(old_state), pj_turn_state_name(new_state))); 
     1635    pj_log_push_indent(); 
    16181636 
    16191637    sess_add_ref(comp->ice_st); 
     
    16911709 
    16921710    sess_dec_ref(comp->ice_st); 
    1693 } 
    1694  
     1711 
     1712    pj_log_pop_indent(); 
     1713} 
     1714 
Note: See TracChangeset for help on using the changeset viewer.