فهرست منبع

fix^2: ack generation no longer checks reply status

Jiri Kuthan 22 سال پیش
والد
کامیت
be743867aa
2فایلهای تغییر یافته به همراه18 افزوده شده و 1 حذف شده
  1. 12 0
      modules/tm/t_cancel.c
  2. 6 1
      modules/tm/t_msgbuilder.c

+ 12 - 0
modules/tm/t_cancel.c

@@ -24,6 +24,12 @@
  * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * History:
+ * ----------
+ * 2003-04-14  checking if a reply sent before cancel is initiated
+ *             moved here (jiri)
+ *
  */
 
 
@@ -86,6 +92,12 @@ void cancel_branch( struct cell *t, int branch )
 	}
 #	endif
 
+	if (t->uac[branch].last_received<100) {
+		DBG("DEBUG: cancel_branch: no response ever received: "
+			"giving up on cancel\n");
+		return;
+	}
+
 	cancel=build_cancel(t, branch, &len);
 	if (!cancel) {
 		LOG(L_ERR, "ERROR: attempt to build a CANCEL failed\n");

+ 6 - 1
modules/tm/t_msgbuilder.c

@@ -29,9 +29,12 @@
  *
  * History:
  * ----------
- * 2003-02-28 scratchpad compatibility abandoned (jiri)
  * 2003-01-27  next baby-step to removing ZT - PRESERVE_ZT (jiri)
  * 2003-02-13  build_uac_request uses proto (andrei)
+ * 2003-02-28 scratchpad compatibility abandoned (jiri)
+ * 2003-04-14  build_local no longer checks reply status as it
+ *             is now called before reply status is updated to
+ *             avoid late ACK sending (jiri)
  */
 
 #include "defs.h"
@@ -76,12 +79,14 @@ char *build_local(struct cell *Trans,unsigned int branch,
 	int branch_len;
 	str branch_str;
 
+#ifdef _OBSO
 	if ( Trans->uac[branch].last_received<100)
 	{
 		DBG("DEBUG: build_local: no response ever received"
 			" : dropping local request! \n");
 		goto error;
 	}
+#endif
 
 	/* method, separators, version: "CANCEL sip:[email protected] SIP/2.0" */
 	*len=SIP_VERSION_LEN + method_len + 2 /* spaces */ + CRLF_LEN;