Fix the coding indentation

This commit is contained in:
Sukchan Lee 2020-09-09 08:36:57 -04:00
parent 56a866c46e
commit 228dd34e5d
2 changed files with 40 additions and 26 deletions

View File

@ -451,32 +451,39 @@ static ogs_pfcp_node_t *selected_sgwu_node(
ogs_assert(current);
ogs_assert(sess);
int RR=0, selected=0;
int RR = 0, selected = 0;
while(!selected){
// continue search from current position
while (!selected) {
/* continue search from current position */
next = ogs_list_next(current);
for (node = next; node; node = ogs_list_next(node)) {
if (!RR){
if (!RR) {
if (OGS_FSM_CHECK(&node->sm, sgwc_pfcp_state_associated) &&
compare_ue_info(node, sess) == true) return node;
}else{
if (OGS_FSM_CHECK(&node->sm, sgwc_pfcp_state_associated)) return node;
} else {
if (OGS_FSM_CHECK(&node->sm, sgwc_pfcp_state_associated))
return node;
}
}
// cyclic search from top to current position
/* cyclic search from top to current position */
for (node = ogs_list_first(&ogs_pfcp_self()->peer_list);
node != next; node = ogs_list_next(node)) {
if (!RR){
if (!RR) {
if (OGS_FSM_CHECK(&node->sm, sgwc_pfcp_state_associated) &&
compare_ue_info(node, sess) == true) return node;
}else{
if (OGS_FSM_CHECK(&node->sm, sgwc_pfcp_state_associated)) return node;
} else {
if (OGS_FSM_CHECK(&node->sm, sgwc_pfcp_state_associated))
return node;
}
}
// if a round robin search has already been carried out
if(RR) break;
// re-run search in round robin mode, find and use next PFCP associated node
/* if a round robin search has already been carried out */
if (RR) break;
/*
* re-run search in round robin mode,
* find and use next PFCP associated node
*/
RR = 1;
}

View File

@ -635,32 +635,39 @@ static ogs_pfcp_node_t *selected_upf_node(
ogs_assert(current);
ogs_assert(sess);
int RR=0, selected=0;
int RR = 0, selected = 0;
while(!selected){
// continue search from current position
while (!selected) {
/* continue search from current position */
next = ogs_list_next(current);
for (node = next; node; node = ogs_list_next(node)) {
if (!RR){
if (!RR) {
if (OGS_FSM_CHECK(&node->sm, smf_pfcp_state_associated) &&
compare_ue_info(node, sess) == true) return node;
}else{
if (OGS_FSM_CHECK(&node->sm, smf_pfcp_state_associated)) return node;
} else {
if (OGS_FSM_CHECK(&node->sm, smf_pfcp_state_associated))
return node;
}
}
// cyclic search from top to current position
/* cyclic search from top to current position */
for (node = ogs_list_first(&ogs_pfcp_self()->peer_list);
node != next; node = ogs_list_next(node)) {
if (!RR){
if (!RR) {
if (OGS_FSM_CHECK(&node->sm, smf_pfcp_state_associated) &&
compare_ue_info(node, sess) == true) return node;
}else{
if (OGS_FSM_CHECK(&node->sm, smf_pfcp_state_associated)) return node;
} else {
if (OGS_FSM_CHECK(&node->sm, smf_pfcp_state_associated))
return node;
}
}
// if a round robin search has already been carried out
if(RR) break;
// re-run search in round robin mode, find and use next PFCP associated node
/* if a round robin search has already been carried out */
if (RR) break;
/*
* re-run search in round robin mode,
* find and use next PFCP associated node
*/
RR = 1;
}