Bläddra i källkod

very noisy debugging for branch

Jiri Kuthan 24 år sedan
förälder
incheckning
416db8cd51
3 ändrade filer med 6 tillägg och 5 borttagningar
  1. 3 2
      modules/tm/t_funcs.c
  2. 1 1
      msg_parser.h
  3. 2 2
      msg_translator.c

+ 3 - 2
modules/tm/t_funcs.c

@@ -268,6 +268,7 @@ int t_forward( struct sip_msg* p_msg , unsigned int dest_ip_param , unsigned int
       T->outbound_request[branch]->to.sin_family = AF_INET;
 
       if (add_branch_label( T, p_msg , branch )==-1) return -1;
+      DBG("DEBUG: XXX: branch_size after call to add_branch_label: %d\n", p_msg->add_to_branch_len );
       buf = build_req_buf_from_sip_req  ( p_msg, &len);
       if (!buf)
          return -1;
@@ -1017,7 +1018,7 @@ int t_build_and_send_ACK( struct cell *Trans, unsigned int branch)
    p+=n;
 
    if (!check_transaction_quadruple( p_msg )) {
-	LOG(L_ERR, "ERROR: t_build_and_send_ACK: can't generate a HBH ACK if key HFs in INVITE missing\n");
+	LOG(L_ERR, "ERROR: t_build_and_send_ACK: cannot generate a HBH ACK if key HFs in INVITE missing\n");
 	goto error;
    }
 
@@ -1157,7 +1158,7 @@ int add_branch_label( struct cell *trans, struct sip_msg *p_msg, int branch )
 		return -1;
 	} else {
 		p_msg->add_to_branch_len += n;
-		DBG("DEBUG: branch label created now: %*s (%d)\n", p_msg->add_to_branch_len, 
+		DBG("DEBUG: XXX branch label created now: %*s (%d)\n", p_msg->add_to_branch_len, 
 			p_msg->add_to_branch_s );
 		return 0;
 	}

+ 1 - 1
msg_parser.h

@@ -177,7 +177,7 @@ struct sip_msg{
 
 	/* str add_to_branch; */ /* whatever whoever want to append to branch comes here */
 	char add_to_branch_s[MAX_BRANCH_PARAM_LEN];
-	short add_to_branch_len;
+	int add_to_branch_len;
 
 	
 };

+ 2 - 2
msg_translator.c

@@ -156,6 +156,7 @@ char * build_req_buf_from_sip_req(	struct sip_msg* msg,
 	/* jku: if we compute branches using MD5 it will take 32 bytes */
 	branch_len= (loop_checks ? MY_BRANCH_LEN : MY_BRANCH_LEN -1 + MD5_LEN)+
 					msg->add_to_branch_len;
+	DBG("DEBUG: XXX via building entered; ( branch len %d)\n", msg->add_to_branch_len );
 
 	if ((via_len+port_no_str_len+branch_len+CRLF_LEN)<MAX_VIA_LINE_SIZE){
 		memcpy(line_buf, MY_VIA, MY_VIA_LEN);
@@ -195,7 +196,7 @@ char * build_req_buf_from_sip_req(	struct sip_msg* msg,
 			} else DBG("DEBUG: build_req_buf_from_sip_req: required HFs for "
 					"loop checking missing\n");
 		}
-		DBG("DEBUG: will add branch now: %s (%d)\n", msg->add_to_branch_s, msg->add_to_branch_len );
+		DBG("DEBUG: XXX will add branch now: %s (%d)\n", msg->add_to_branch_s, msg->add_to_branch_len );
 		/* someone wants me to add something to branch here ? */
 		memcpy(line_buf+via_len, msg->add_to_branch_s,
 				msg->add_to_branch_len );
@@ -204,7 +205,6 @@ char * build_req_buf_from_sip_req(	struct sip_msg* msg,
 		memcpy(line_buf+via_len, CRLF, CRLF_LEN);
 		via_len+=CRLF_LEN;
 		line_buf[via_len]=0; /* null terminate the string*/
-		DBG("DEBUG: via branch building finished\n");
 	}else{
 		LOG(L_ERR, "build_req_buf_from_sip_req: ERROR: via too long (%d)\n",
 				via_len);