Bladeren bron

bug_fix: ambiguous use of TOTAG* defines fixed (report courtesy of Bogdan)

Jiri Kuthan 23 jaren geleden
bovenliggende
commit
2c60a4c3d0
5 gewijzigde bestanden met toevoegingen van 9 en 9 verwijderingen
  1. 2 2
      config.h
  2. 1 1
      modules/tm/h_table.c
  3. 1 1
      modules/tm/h_table.h
  4. 3 3
      modules/tm/t_reply.c
  5. 2 2
      msg_translator.c

+ 2 - 2
config.h

@@ -82,8 +82,8 @@
 #define RECEIVED   ";received="
 #define RECEIVED_LEN 10
 
-#define TOTAG ";tag="
-#define TOTAG_LEN (sizeof(TOTAG)-1)
+#define TOTAG_TOKEN ";tag="
+#define TOTAG_TOKEN_LEN (sizeof(TOTAG_TOKEN)-1)
 
 #define SRV_PREFIX "_sip._udp."
 #define SRV_PREFIX_LEN 10

+ 1 - 1
modules/tm/h_table.c

@@ -90,7 +90,7 @@ void free_cell( struct cell* dead_cell )
 		sip_msg_free_unsafe( dead_cell->uas.request );
 	if ( dead_cell->uas.response.buffer )
 		shm_free_unsafe( dead_cell->uas.response.buffer );
-#ifdef TOTAG
+#ifdef _TOTAG
 	if (dead_cell->uas.to_tag.s)
 		shm_free_unsafe(dead_cell->uas.to_tag.s);
 #endif

+ 1 - 1
modules/tm/h_table.h

@@ -105,7 +105,7 @@ typedef struct ua_server
 	struct sip_msg   *request;
 	struct retr_buf  response;
 	unsigned int     status;
-#ifdef TOTAG
+#ifdef _TOTAG
 	str              to_tag;
 #endif
 	unsigned int     isACKed;

+ 3 - 3
modules/tm/t_reply.c

@@ -508,7 +508,7 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
 	unsigned int res_len;
 	int relayed_code;
 	struct sip_msg *relayed_msg;
-#ifdef TOTAG
+#ifdef _TOTAG
 	str	to_tag;
 #endif
 	enum rps reply_status;
@@ -606,7 +606,7 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
 		}
 		uas_rb->buffer_len = res_len;
 		memcpy( uas_rb->buffer, buf, res_len );
-#ifdef TOTAG
+#ifdef _TOTAG
 		/* to tag now */
 		if (relayed_code>=300 && t->is_invite) {
 			if (relayed_msg!=FAKED_REPLY) {
@@ -646,7 +646,7 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
 	/* success */
 	return reply_status;
 
-#ifdef TOTAG
+#ifdef _TOTAG
 error04:
 	shm_free( uas_rb->buffer );
 	uas_rb->buffer=0;

+ 2 - 2
msg_translator.c

@@ -636,7 +636,7 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text,
 				if (to_tag.s )
 					len+=new_tag_len-to_tag.len;
 				else
-					len+=new_tag_len+TOTAG_LEN/*";tag="*/;
+					len+=new_tag_len+TOTAG_TOKEN_LEN/*";tag="*/;
 			}
 		} else if (hdr->type==HDR_VIA) {
 				if (hdr==msg->h_via1) len += received_len;
@@ -711,7 +711,7 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text,
 						append_str_trans( p, hdr->name.s ,
 							((hdr->body.s+hdr->body.len )-hdr->name.s ),
 							msg);
-						append_str( p, TOTAG,TOTAG_LEN,msg);
+						append_str( p, TOTAG_TOKEN,TOTAG_TOKEN_LEN,msg);
 						append_str( p, new_tag,new_tag_len,msg);
 						append_str( p, CRLF,CRLF_LEN,msg);
 					}