فهرست منبع

kr requests only

Jiri Kuthan 22 سال پیش
والد
کامیت
acee289780
3فایلهای تغییر یافته به همراه18 افزوده شده و 15 حذف شده
  1. 1 4
      modules/tm/h_table.c
  2. 8 5
      modules/tm/t_lookup.c
  3. 9 6
      modules/tm/tm.c

+ 1 - 4
modules/tm/h_table.c

@@ -26,6 +26,7 @@
  *
  * History
  * -------
+ * 2003-03-30  set_kr for requests only (jiri)
  * 2003-03-16  removed _TOTAG (jiri)
  * 2003-03-06  200/INV to-tag list deallocation added;
  *             setting "kill_reason" moved in here -- it is moved
@@ -60,10 +61,6 @@ static struct s_table*  tm_table;
 
 void set_kr( enum kill_reason _kr )
 {
-	if (kr!=0 && _kr!=0) {
-			DBG("DEBUG: set_kr: kill reason reset: "
-					"old=%d update=%d\n", kr, _kr );
-	}
 	kr|=_kr;
 }
 enum kill_reason get_kr() {

+ 8 - 5
modules/tm/t_lookup.c

@@ -51,6 +51,7 @@
  *
  * History:
  * ----------
+ * 2003-03-30  set_kr for requests only (jiri)
  * 2003-03-29  optimization: e2e ACK matching only if callback installed
  *             (jiri)
  * 2003-03-06  dialog matching introduced for ACKs -- that's important for 
@@ -1086,11 +1087,13 @@ int t_unref( struct sip_msg* p_msg  )
 
 	if (T==T_UNDEFINED || T==T_NULL_CELL)
 		return -1;
-	kr=get_kr();
-	if (kr==0 
-		||(p_msg->REQ_METHOD==METHOD_ACK && !(kr & REQ_RLSD))) {
-		LOG(L_WARN, "WARNING: script writer didn't release transaction\n");
-		t_release_transaction(T);
+	if (p_msg->first_line.type==SIP_REQUEST){
+		kr=get_kr();
+		if (kr==0 
+				||(p_msg->REQ_METHOD==METHOD_ACK && !(kr & REQ_RLSD))) {
+			LOG(L_WARN, "WARNING: script writer didn't release transaction\n");
+			t_release_transaction(T);
+		}
 	}
 	UNREF( T );
 	set_t(T_UNDEFINED);

+ 9 - 6
modules/tm/tm.c

@@ -61,6 +61,7 @@
  *  2003-03-10  module export interface updated to the new format (andrei)
  *  2003-03-16  flags export parameter added (janakj)
  *  2003-03-19  replaced all mallocs/frees w/ pkg_malloc/pkg_free (andrei)
+ *  2003-03-30  set_kr for requests only (jiri)
  */
 
 
@@ -228,13 +229,15 @@ static int script_init( struct sip_msg *foo, void *bar)
 	   not be used again
     */
 
-	/* make sure the new message will not inherit previous
-	   message's t_on_negative value
-	*/
-	t_on_negative( 0 );
+	if (foo->first_line.type==SIP_REQUEST){
+		/* make sure the new message will not inherit previous
+	   		message's t_on_negative value
+		*/
+		t_on_negative( 0 );
 
-	/* reset the kr status */
-	set_kr(0);
+		/* reset the kr status */
+		set_kr(0);
+	}
 
 	return 1;
 }