Browse Source

- extra BUG checks (just to be sure we catch early kr related bugs)

Andrei Pelinescu-Onciul 18 years ago
parent
commit
b539318ad4
1 changed files with 6 additions and 2 deletions
  1. 6 2
      modules/tm/t_lookup.c

+ 6 - 2
modules/tm/t_lookup.c

@@ -1337,9 +1337,9 @@ int t_unref( struct sip_msg* p_msg  )
 			DBG("t_unref: delayed error reply generation(%d)\n", tm_error);
 			if (unlikely(rmode==MODE_ONFAILURE)){
 				BUG("tm: t_unref: called w/ kr=REQ_ERR_DELAYED in failure"
-						" route\n");
+						" route for %p\n", T);
 			}else if (unlikely( kill_transaction(T, tm_error)<=0 )){
-				DBG("ERROR: t_unref: generation of a delayed stateful reply"
+				ERR("ERROR: t_unref: generation of a delayed stateful reply"
 						" failed\n");
 				t_release_transaction(T);
 			}
@@ -1347,6 +1347,10 @@ int t_unref( struct sip_msg* p_msg  )
 								!(kr & REQ_RLSD)))) {
 			LOG(L_WARN, "WARNING: script writer didn't release transaction\n");
 			t_release_transaction(T);
+		}else if (unlikely((kr & REQ_ERR_DELAYED))){
+			BUG("tm: t_unref: REQ_ERR DELAYED should have been caught much"
+					" earlier for %p: %d (hex %x)\n",T, kr, kr);
+			t_release_transaction(T);
 		}
 		tm_error=0; /* clear it */
 	}