Module: sip-router Branch: master Commit: 9c2f5f658a597bb70a7f4250476c358294513cef URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9c2f5f65...
Author: Jan Janak jan@ryngle.com Committer: Jan Janak jan@ryngle.com Date: Sat Oct 17 19:36:20 2009 +0200
Implements function reset_path_vector.
This function can be used to reset the path_vec variable that stores the path vector for a SIP message. It can be used just like reset_dst_uri.
---
parser/msg_parser.c | 11 +++++++++++ parser/msg_parser.h | 3 +++ 2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/parser/msg_parser.c b/parser/msg_parser.c index c203e7a..0388bd4 100644 --- a/parser/msg_parser.c +++ b/parser/msg_parser.c @@ -783,6 +783,17 @@ int set_path_vector(struct sip_msg* msg, str* path) return 0; }
+ +void reset_path_vector(struct sip_msg* msg) +{ + if(msg->path_vec.s != 0) { + pkg_free(msg->path_vec.s); + } + msg->path_vec.s = 0; + msg->path_vec.len = 0; +} + + struct hdr_field* get_hdr(struct sip_msg *msg, enum _hdr_types_t ht) { struct hdr_field *hdr; diff --git a/parser/msg_parser.h b/parser/msg_parser.h index 22b3167..ce4c81d 100644 --- a/parser/msg_parser.h +++ b/parser/msg_parser.h @@ -464,4 +464,7 @@ struct hdr_field* get_hdr(struct sip_msg *msg, enum _hdr_types_t ht); struct hdr_field* next_sibling_hdr(struct hdr_field *hf);
int set_path_vector(struct sip_msg* msg, str* path); + +void reset_path_vector(struct sip_msg* msg); + #endif