Skip to content

Commit

Permalink
tm: coherent indentation and whitespacing for t suspend code
Browse files Browse the repository at this point in the history
(cherry picked from commit d85dd4e)
  • Loading branch information
miconda committed Jun 27, 2016
1 parent c67edea commit 4cc3693
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
33 changes: 16 additions & 17 deletions modules/tm/t_suspend.c
Expand Up @@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
Expand Down Expand Up @@ -120,7 +120,7 @@ int t_suspend(struct sip_msg *msg,
if (t_check( msg , &branch )==-1){
LOG(L_ERR, "ERROR: t_suspend_reply: " \
"failed find UAC branch\n");
return -1;
return -1;
}
LM_DBG("found a a match with branch id [%d] - "
"cloning reply message to t->uac[branch].reply\n", branch);
Expand Down Expand Up @@ -222,11 +222,11 @@ int t_continue(unsigned int hash_index, unsigned int label,
}

if(t->async_backup.backup_route != TM_ONREPLY_ROUTE){
branch = t->async_backup.blind_uac; /* get the branch of the blind UAC setup
branch = t->async_backup.blind_uac; /* get the branch of the blind UAC setup
* during suspend */
if (branch >= 0) {
stop_rb_timers(&t->uac[branch].request);

if (t->uac[branch].last_received != 0) {
/* Either t_continue() has already been
* called or the branch has already timed out.
Expand Down Expand Up @@ -254,7 +254,7 @@ int t_continue(unsigned int hash_index, unsigned int label,

/* We should not reset kr here to 0 as it's quite possible before continuing the dev. has correctly set the
* kr by, for example, sending a transactional reply in code - resetting here will cause a dirty log message
* "WARNING: script writer didn't release transaction" to appear in log files. TODO: maybe we need to add
* "WARNING: script writer didn't release transaction" to appear in log files. TODO: maybe we need to add
* a special kr for async?
* reset_kr();
*/
Expand Down Expand Up @@ -312,12 +312,11 @@ int t_continue(unsigned int hash_index, unsigned int label,
" - resetting the suspend branch flag\n");

if (t->uac[branch].reply) {
t->uac[branch].reply->msg_flags &= ~FL_RPL_SUSPENDED;
} else {
t->uac[branch].reply->msg_flags &= ~FL_RPL_SUSPENDED;
} else {
LM_WARN("no reply in t_continue for branch. not much we can do\n");
return 0;
}

if (t->uas.request) t->uas.request->msg_flags&= ~FL_RPL_SUSPENDED;

faked_env( t, t->uac[branch].reply, 1);
Expand Down Expand Up @@ -372,7 +371,7 @@ int t_continue(unsigned int hash_index, unsigned int label,
cleanup_uac_timers( t );
/* 2xx is a special case: we can have a COMPLETED request
* with branches still open => we have to cancel them */
if (is_invite(t) && cancel_data.cancel_bitmap)
if (is_invite(t) && cancel_data.cancel_bitmap)
cancel_uacs( t, &cancel_data, F_CANCEL_B_KILL);
/* FR for negative INVITES, WAIT anything else */
/* Call to set_final_timer is embedded in relay_reply to avoid
Expand Down Expand Up @@ -404,7 +403,7 @@ int t_continue(unsigned int hash_index, unsigned int label,
restart_rb_fr(& t->uac[branch].request, t->fr_inv_timeout);
t->uac[branch].request.flags|=F_RB_FR_INV; /* mark fr_inv */
}

}

done:
Expand All @@ -414,7 +413,7 @@ int t_continue(unsigned int hash_index, unsigned int label,
/* unref the transaction */
t_unref(t->uas.request);
} else {
tm_ctx_set_branch_index(T_BR_UNDEFINED);
tm_ctx_set_branch_index(T_BR_UNDEFINED);
/* unref the transaction */
t_unref(t->uac[branch].reply);
LOG(L_DBG,"DEBUG: t_continue_reply: Freeing earlier cloned reply\n");
Expand Down Expand Up @@ -495,7 +494,7 @@ int t_continue(unsigned int hash_index, unsigned int label,
* after t_suspend() has already been executed in the same
* process, and it turns out that the transaction should
* not have been suspended.
*
*
* Return value:
* 0 - success
* <0 - failure
Expand All @@ -504,7 +503,7 @@ int t_cancel_suspend(unsigned int hash_index, unsigned int label)
{
struct cell *t;
int branch;

t = get_t();
if (!t || t == T_UNDEFINED) {
LOG(L_ERR, "ERROR: t_revoke_suspend: " \
Expand All @@ -519,7 +518,7 @@ int t_cancel_suspend(unsigned int hash_index, unsigned int label)
"transaction id mismatch\n");
return -1;
}

if(t->async_backup.backup_route != TM_ONREPLY_ROUTE){
/* The transaction does not need to be locked because this
* function is either executed from the original route block
Expand Down Expand Up @@ -556,8 +555,8 @@ int t_cancel_suspend(unsigned int hash_index, unsigned int label)

t->uac[branch].reply->msg_flags &= ~FL_RPL_SUSPENDED;
if (t->uas.request) t->uas.request->msg_flags&= ~FL_RPL_SUSPENDED;
}
}

return 0;
}

4 changes: 2 additions & 2 deletions modules/tm/t_suspend.h
Expand Up @@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
Expand Down

0 comments on commit 4cc3693

Please sign in to comment.