Browse Source

tm: coherent indentation and whitespacing for t suspend code

Daniel-Constantin Mierla 9 years ago
parent
commit
d85dd4eab4
2 changed files with 18 additions and 19 deletions
  1. 16 17
      modules/tm/t_suspend.c
  2. 2 2
      modules/tm/t_suspend.h

+ 16 - 17
modules/tm/t_suspend.c

@@ -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
  *
  */
@@ -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);
@@ -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.
@@ -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();
 		 */
@@ -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);
@@ -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
@@ -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:
@@ -414,7 +413,7 @@ done:
 		/* 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");
@@ -495,7 +494,7 @@ kill_trans:
  * 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
@@ -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: " \
@@ -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
@@ -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;
 }
 

+ 2 - 2
modules/tm/t_suspend.h

@@ -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
  *
  */