Pārlūkot izejas kodu

tm: reset local lock reply status after functions that do unlock

Daniel-Constantin Mierla 11 gadi atpakaļ
vecāks
revīzija
5943a8005b
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      modules/tm/t_reply.c

+ 4 - 1
modules/tm/t_reply.c

@@ -2480,6 +2480,7 @@ int reply_received( struct sip_msg  *p_msg )
 	}
 	}
 	if ( is_local(t) ) {
 	if ( is_local(t) ) {
 		reply_status=local_reply( t, p_msg, branch, msg_status, &cancel_data );
 		reply_status=local_reply( t, p_msg, branch, msg_status, &cancel_data );
+		replies_locked=0;
 		if (reply_status == RPS_COMPLETED) {
 		if (reply_status == RPS_COMPLETED) {
 			     /* no more UAC FR/RETR (if I received a 2xx, there may
 			     /* no more UAC FR/RETR (if I received a 2xx, there may
 			      * be still pending branches ...
 			      * be still pending branches ...
@@ -2497,6 +2498,7 @@ int reply_received( struct sip_msg  *p_msg )
 	} else {
 	} else {
 		reply_status=relay_reply( t, p_msg, branch, msg_status,
 		reply_status=relay_reply( t, p_msg, branch, msg_status,
 									&cancel_data, 1 );
 									&cancel_data, 1 );
+		replies_locked=0;
 		if (reply_status == RPS_COMPLETED) {
 		if (reply_status == RPS_COMPLETED) {
 			     /* no more UAC FR/RETR (if I received a 2xx, there may
 			     /* no more UAC FR/RETR (if I received a 2xx, there may
 				be still pending branches ...
 				be still pending branches ...
@@ -2534,7 +2536,8 @@ int reply_received( struct sip_msg  *p_msg )
 skip_send_reply:
 skip_send_reply:
 
 
 	if (likely(replies_locked)){
 	if (likely(replies_locked)){
-		UNLOCK_REPLIES(t); /* unlock replies  - this would be unlocked by send function*/
+		/* unlock replies if still locked coming via goto skip_send_reply */
+		UNLOCK_REPLIES(t);
 		replies_locked=0;
 		replies_locked=0;
 	}
 	}