Browse code

Add parsed_uri structure to the to_body structure.

This is a compatiblity change inspired by kamailio changes. It makes
it possible to store already parsed to and from URIs in the sip
message structure and there is no need to reparse such URIs later.
To and From headers are often parsed repeatedly in modules.

As a side effect I had to avoid a nasty cyclic dependency in parser
headers. I removed parse_to from msg_parser.h, the header does not have
to be included there because nothing in msg_parser.h uses stuff from
parse_to. In addition to that many files that previously included only
msg_parser.h, and assumed that the header would pull parse_to.h as well,
needed to be modified to include parse_to.h explicitly.

Jan Janak authored on 05/03/2009 22:47:02
Showing 5 changed files
... ...
@@ -139,6 +139,7 @@
139 139
 #include "ut.h"
140 140
 #include "pt.h"
141 141
 #include "cfg/cfg.h"
142
+#include "parser/parse_to.h"
142 143
 #include "forward.h"
143 144
 
144 145
 
... ...
@@ -58,6 +58,7 @@
58 58
 #include "parse_hname2.h"
59 59
 #include "parse_uri.h"
60 60
 #include "parse_content.h"
61
+#include "parse_to.h"
61 62
 #include "../compiler_opt.h"
62 63
 
63 64
 #ifdef DEBUG_DMALLOC
... ...
@@ -59,7 +59,6 @@
59 59
 #include "../config.h"
60 60
 #include "parse_def.h"
61 61
 #include "parse_cseq.h"
62
-#include "parse_to.h"
63 62
 #include "parse_via.h"
64 63
 #include "parse_fline.h"
65 64
 #include "parse_retry_after.h"
... ...
@@ -29,6 +29,7 @@
29 29
 #ifndef _PARSE_FROM_H
30 30
 #define _PARSE_FROM_H
31 31
 
32
+#include "parse_to.h"
32 33
 #include "msg_parser.h"
33 34
 
34 35
 
... ...
@@ -30,6 +30,7 @@
30 30
 #define PARSE_TO
31 31
 
32 32
 #include "../str.h"
33
+#include "msg_parser.h"
33 34
 
34 35
 enum {
35 36
 	TAG_PARAM = 400, GENERAL_PARAM
... ...
@@ -49,6 +50,7 @@ struct to_body{
49 49
 	str uri;                      /* URI */
50 50
 	str display;				  /* Display Name */
51 51
 	str tag_value;                /* Value of tag */
52
+	struct sip_uri parsed_uri;
52 53
 	struct to_param *param_lst;   /* Linked list of parameters */
53 54
 	struct to_param *last_param;  /* Last parameter in the list */
54 55
 };