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_session.c

    r3553 r3753  
    17491749         "Sending connectivity check for check %s",  
    17501750         dump_check(ice->tmp.txt, sizeof(ice->tmp.txt), clist, check))); 
     1751    pj_log_push_indent(); 
    17511752 
    17521753    /* Create request */ 
     
    17561757    if (status != PJ_SUCCESS) { 
    17571758        pjnath_perror(ice->obj_name, "Error creating STUN request", status); 
     1759        pj_log_pop_indent(); 
    17581760        return status; 
    17591761    } 
     
    18121814        check->tdata = NULL; 
    18131815        pjnath_perror(ice->obj_name, "Error sending STUN request", status); 
     1816        pj_log_pop_indent(); 
    18141817        return status; 
    18151818    } 
     
    18171820    check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_IN_PROGRESS,  
    18181821                    PJ_SUCCESS); 
     1822    pj_log_pop_indent(); 
    18191823    return PJ_SUCCESS; 
    18201824} 
     
    18461850 
    18471851    LOG5((ice->obj_name, "Starting checklist periodic check")); 
     1852    pj_log_push_indent(); 
    18481853 
    18491854    /* Send STUN Binding request for check with highest priority on 
     
    18571862            if (status != PJ_SUCCESS) { 
    18581863                pj_mutex_unlock(ice->mutex); 
     1864                pj_log_pop_indent(); 
    18591865                return status; 
    18601866            } 
     
    18761882                if (status != PJ_SUCCESS) { 
    18771883                    pj_mutex_unlock(ice->mutex); 
     1884                    pj_log_pop_indent(); 
    18781885                    return status; 
    18791886                } 
     
    18971904 
    18981905    pj_mutex_unlock(ice->mutex); 
     1906    pj_log_pop_indent(); 
    18991907    return PJ_SUCCESS; 
    19001908} 
     
    19091917 
    19101918    LOG4((ice->obj_name, "Starting nominated check..")); 
     1919    pj_log_push_indent(); 
    19111920 
    19121921    pj_assert(ice->is_nominating == PJ_FALSE); 
     
    19591968 
    19601969    ice->is_nominating = PJ_TRUE; 
     1970    pj_log_pop_indent(); 
    19611971} 
    19621972 
     
    20062016 
    20072017    LOG4((ice->obj_name, "Starting ICE check..")); 
     2018    pj_log_push_indent(); 
    20082019 
    20092020    /* If we are using aggressive nomination, set the is_nominating state */ 
     
    20332044        pj_assert(!"Unable to find checklist for component 1"); 
    20342045        pj_mutex_unlock(ice->mutex); 
     2046        pj_log_pop_indent(); 
    20352047        return PJNATH_EICEINCOMPID; 
    20362048    } 
     
    20732085              "Performing delayed triggerred check for component %d", 
    20742086              rcheck->comp_id)); 
     2087        pj_log_push_indent(); 
    20752088        handle_incoming_check(ice, rcheck); 
    20762089        rcheck = rcheck->next; 
     2090        pj_log_pop_indent(); 
    20772091    } 
    20782092    pj_list_init(&ice->early_check); 
     
    20922106 
    20932107    pj_mutex_unlock(ice->mutex); 
     2108    pj_log_pop_indent(); 
    20942109    return status; 
    20952110} 
     
    21942209            /* Resend request */ 
    21952210            LOG4((ice->obj_name, "Resending check because of role conflict")); 
     2211            pj_log_push_indent(); 
    21962212            check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_WAITING, 0); 
    21972213            perform_check(ice, clist, msg_data->data.req.ckid,  
    21982214                          check->nominated || ice->is_nominating); 
     2215            pj_log_pop_indent(); 
    21992216            pj_mutex_unlock(ice->mutex); 
    22002217            return; 
     
    22082225             (check->nominated ? " (nominated)" : " (not nominated)"), 
    22092226             errmsg)); 
    2210  
     2227        pj_log_push_indent(); 
    22112228        check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_FAILED, status); 
    22122229        on_check_complete(ice, check); 
     2230        pj_log_pop_indent(); 
    22132231        pj_mutex_unlock(ice->mutex); 
    22142232        return; 
     
    22312249                        &ice->clist, check), 
    22322250             (check->nominated ? " (nominated)" : " (not nominated)"))); 
     2251        pj_log_push_indent(); 
    22332252        check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_FAILED, status); 
    22342253        on_check_complete(ice, check); 
     2254        pj_log_pop_indent(); 
    22352255        pj_mutex_unlock(ice->mutex); 
    22362256        return; 
     
    27032723 
    27042724            LOG5((ice->obj_name, "Performing triggered check for check %d",i)); 
     2725            pj_log_push_indent(); 
    27052726            perform_check(ice, &ice->clist, i, nominate); 
     2727            pj_log_pop_indent(); 
    27062728 
    27072729        } else if (c->state == PJ_ICE_SESS_CHECK_STATE_IN_PROGRESS) { 
     
    27102732            LOG5((ice->obj_name, "Triggered check for check %d not performed " 
    27112733                  "because it's in progress. Retransmitting", i)); 
     2734            pj_log_push_indent(); 
    27122735            pj_stun_session_retransmit_req(comp->stun_sess, c->tdata); 
     2736            pj_log_pop_indent(); 
    27132737 
    27142738        } else if (c->state == PJ_ICE_SESS_CHECK_STATE_SUCCEEDED) { 
     
    27442768            LOG5((ice->obj_name, "Triggered check for check %d not performed " 
    27452769                                "because it's completed", i)); 
    2746  
     2770            pj_log_push_indent(); 
    27472771            complete = on_check_complete(ice, c); 
     2772            pj_log_pop_indent(); 
    27482773            if (complete) { 
    27492774                return; 
     
    27742799        LOG4((ice->obj_name, "New triggered check added: %d",  
    27752800             ice->clist.count)); 
     2801        pj_log_push_indent(); 
    27762802        perform_check(ice, &ice->clist, ice->clist.count++, nominate); 
     2803        pj_log_pop_indent(); 
    27772804 
    27782805    } else { 
     
    28032830    sd = (struct stun_data*) pj_stun_session_get_user_data(sess); 
    28042831 
     2832    pj_log_push_indent(); 
     2833 
    28052834    if (msg->hdr.type == PJ_STUN_BINDING_INDICATION) { 
    28062835        LOG5((sd->ice->obj_name, "Received Binding Indication keep-alive " 
     
    28112840              sd->comp_id)); 
    28122841    } 
     2842 
     2843    pj_log_pop_indent(); 
    28132844 
    28142845    return PJ_SUCCESS; 
Note: See TracChangeset for help on using the changeset viewer.