2
0
Эх сурвалжийг харах

core/dset: Add options field to print_dset()

Will be used later on to optionally enhance the contacts.
Alex Hermann 6 жил өмнө
parent
commit
e5b3474ad4

+ 4 - 4
src/core/dset.c

@@ -472,7 +472,7 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path,
  * end = end of target buffer
  * Returns 0 on success or -1 on error (buffer is too short)
  */
-static int print_contact_str(char **dest, str *uri, qvalue_t q, char *end)
+static int print_contact_str(char **dest, str *uri, qvalue_t q, char *end, int options)
 {
 	char *p = *dest;
 	str buf;
@@ -507,7 +507,7 @@ static int print_contact_str(char **dest, str *uri, qvalue_t q, char *end)
  * Create a Contact header field from the dset
  * array
  */
-char* print_dset(struct sip_msg* msg, int* len)
+char* print_dset(struct sip_msg* msg, int* len, int options)
 {
 	int cnt = 0;
 	qvalue_t q;
@@ -529,7 +529,7 @@ char* print_dset(struct sip_msg* msg, int* len)
 
 	/* current uri */
 	if (msg->new_uri.s) {
-		if (print_contact_str(&p, &msg->new_uri, ruri_q, end) < 0) {
+		if (print_contact_str(&p, &msg->new_uri, ruri_q, end, options) < 0) {
 			goto memfail;
 		}
 		cnt++;
@@ -546,7 +546,7 @@ char* print_dset(struct sip_msg* msg, int* len)
 			p += CONTACT_DELIM_LEN;
 		}
 
-		if (print_contact_str(&p, &uri, q, end) < 0) {
+		if (print_contact_str(&p, &uri, q, end, options) < 0) {
 			goto memfail;
 		}
 

+ 1 - 1
src/core/dset.h

@@ -158,7 +158,7 @@ void clear_branches(void);
  * Create a Contact header field from the
  * list of current branches
  */
-char* print_dset(struct sip_msg* msg, int* len);
+char* print_dset(struct sip_msg* msg, int* len, int options);
 
 
 /*! \brief

+ 1 - 1
src/modules/pv/pv_core.c

@@ -1335,7 +1335,7 @@ int pv_get_dset(struct sip_msg *msg, pv_param_t *param,
 	if(msg==NULL)
 		return -1;
 
-	s.s = print_dset(msg, &s.len);
+	s.s = print_dset(msg, &s.len, 0);
 	if (s.s == NULL)
 		return pv_get_null(msg, param, res);
 	s.len -= CRLF_LEN;

+ 1 - 1
src/modules/sl/sl_funcs.c

@@ -150,7 +150,7 @@ int sl_reply_helper(struct sip_msg *msg, int code, char *reason, str *tag)
 
 	/* if that is a redirection message, dump current message set to it */
 	if (code>=300 && code<400) {
-		dset.s=print_dset(msg, &dset.len);
+		dset.s=print_dset(msg, &dset.len, 0);
 		if (dset.s) {
 			add_lump_rpl(msg, dset.s, dset.len, LUMP_RPL_HDR);
 		}

+ 1 - 1
src/modules/tm/t_reply.c

@@ -640,7 +640,7 @@ static int _reply( struct cell *trans, struct sip_msg* p_msg,
 
 	/* if that is a redirection message, dump current message set to it */
 	if (code>=300 && code<400) {
-		dset=print_dset(p_msg, &dset_len);
+		dset=print_dset(p_msg, &dset_len, 0);
 		if (dset) {
 			add_lump_rpl(p_msg, dset, dset_len, LUMP_RPL_HDR);
 		}

+ 1 - 1
src/modules/xprint/xp_lib.c

@@ -559,7 +559,7 @@ static int xl_get_dset(struct sip_msg *msg, str *res, str *hp, int hi, int hf)
     if(msg==NULL || res==NULL)
 	return -1;
 
-    res->s = print_dset(msg, &res->len);
+    res->s = print_dset(msg, &res->len, 0);
 
     if ((res->s) == NULL) return xl_get_null(msg, res, hp, hi, hf);