Procházet zdrojové kódy

*** empty log message ***

Bogdan-Andrei Iancu před 23 roky
rodič
revize
88865af490
2 změnil soubory, kde provedl 14 přidání a 26 odebrání
  1. 14 10
      modules/tm/t_funcs.c
  2. 0 16
      test/th-uri.cfg

+ 14 - 10
modules/tm/t_funcs.c

@@ -1195,24 +1195,24 @@ int t_build_and_send_CANCEL(struct cell *Trans,unsigned int branch)
 	/* changhing method name*/
 	memcpy(cancel_buf,"CANCEL",6);
 	append_mem_block(p,CRLF,CRLF_LEN);
-	
-
 	/* insert our via */
-	memcpy( p , via , via_len );
-	p += via_len;
+	append_mem_block(p,via,via_len);
 
 	/*other headers*/
 	for ( hdr=p_msg->headers ; hdr ; hdr=hdr->next )
 	{
-		if ( hdr->type==HDR_FROM || hdr->type==HDR_CALLID ||
-			hdr->type==HDR_TO || hdr->type==HDR_CSEQ )
+		if(hdr->type==HDR_FROM||hdr->type==HDR_CALLID||hdr->type==HDR_TO)
 		{
 			append_mem_block(p,hdr->name.s,
 				((hdr->body.s+hdr->body.len)-hdr->name.s) );
 			append_mem_block(p, CRLF, CRLF_LEN );
-			p+=CRLF_LEN;
+		}else if ( hdr->type==HDR_CSEQ )
+		{
+			append_mem_block(p,hdr->name.s,
+				((((struct cseq_body*)hdr->parsed)->method.s)-hdr->name.s));
+			append_mem_block(p,"CANCEL" CRLF, 6+CRLF_LEN );
 		}
-	}
+}
 
 	/* User Agent header */
 	append_mem_block(p,USER_AGENT,USER_AGENT_LEN);
@@ -1222,6 +1222,10 @@ int t_build_and_send_CANCEL(struct cell *Trans,unsigned int branch)
 	append_mem_block(p,CRLF,CRLF_LEN);
 	/* end of message */
 	append_mem_block(p,CRLF,CRLF_LEN);
+	*p=0;
+	
+
+	DBG("LOCAL CANCEL = \n%s\n",cancel_buf);
 
 	pkg_free(via);
 	return 1;
@@ -1432,12 +1436,12 @@ void final_response_handler( void *attr)
 		DBG("DEBUG: final_response_handler:stop retransmission and"
 			" send 408 (t=%p)\n", r_buf->my_T);
 		reset_timer( hash_table, &(r_buf->retr_timer) );
+		t_build_and_send_CANCEL( r_buf->my_T ,0);
 		/* dirty hack:t_send_reply would increase ref_count which would indeed
 		result in refcount++ which would not -- until timer processe's
 		T changes again; currently only on next call to t_send_reply from
 		FR timer; thus I fake the values now to avoid recalculating T
-		and refcount++
-		jku */
+		and refcount++ JKU */
 		T=r_buf->my_T;
 		global_msg_id=T->inbound_request->id;
 

+ 0 - 16
test/th-uri.cfg

@@ -40,22 +40,6 @@ route{
                      sl_send_reply("483","To Many Hops");
                      drop();
              };
-             /*
-             if ( mf_is_maxfwd_present() )
-             {
-                   if ( !mf_decrement_maxfwd() )
-                   {
-                     log("SER : unable to decrement MAX_FORWARD!\n");
-                   };
-                   if ( mf_is_maxfwd_zero() )
-                   {
-                     log("SER: MAX FORWARD header is zero\n");
-                     drop();
-                   };
-             }else{
-                   mf_add_maxfwd_header( "10" );
-             }; */
-
 
              /*
              if (method=="INVITE")