Browse code

len field added (total length of one Route field).

Jan Janak authored on 04/04/2003 14:04:00
Showing 2 changed files
... ...
@@ -68,7 +68,6 @@ int parse_rr(struct hdr_field* _h)
68 68
 			LOG(L_ERR, "parse_rr(): No memory left\n");
69 69
 			goto error;
70 70
 		}
71
-
72 71
 		memset(r, 0, sizeof(rr_t));
73 72
 		
74 73
 		     /* Parse name-addr part of the header */
... ...
@@ -76,7 +75,8 @@ int parse_rr(struct hdr_field* _h)
76 76
 			LOG(L_ERR, "parse_rr(): Error while parsing name-addr\n");
77 77
 			goto error;
78 78
 		}
79
-		
79
+		r->len = r->nameaddr.len;
80
+
80 81
 		     /* Shift just behind the closing > */
81 82
 		s.s = r->nameaddr.name.s + r->nameaddr.len;  /* Point just behind > */
82 83
 		s.len -= r->nameaddr.len;
... ...
@@ -99,6 +99,7 @@ int parse_rr(struct hdr_field* _h)
99 99
 				LOG(L_ERR, "parse_rr(): Error while parsing params\n");
100 100
 				goto error;
101 101
 			}
102
+			r->len = r->params->name.s + r->params->len - r->nameaddr.name.s;
102 103
 
103 104
 			     /* Copy hooks */
104 105
 			r->r2 = hooks.rr.r2;
... ...
@@ -44,6 +44,7 @@ typedef struct rr {
44 44
 	name_addr_t nameaddr; /* Name-addr part */
45 45
 	param_t* r2;          /* Hook to r2 parameter */
46 46
 	param_t* params;      /* Linked list of other parameters */
47
+	int len;              /* Length of the whole route field */
47 48
         struct rr* next;      /* Next RR in the list */
48 49
 } rr_t;
49 50