Browse code

Rename Contact parameter 'method' to 'methods'

According RFC3840 the correct name of the parameter is 'methods',
not 'method'.

Reported by Daniel-Constantin Mierla

Jan Janak authored on 19/03/2009 15:15:04
Showing 4 changed files
... ...
@@ -246,7 +246,7 @@ int parse_contacts(str* _s, contact_t** _c)
246 246
 			c->q = hooks.contact.q;
247 247
 			c->expires = hooks.contact.expires;
248 248
 			c->received = hooks.contact.received;
249
-			c->method = hooks.contact.method;
249
+			c->methods = hooks.contact.methods;
250 250
 			c->instance = hooks.contact.instance;
251 251
 
252 252
 			if (_s->len == 0) goto ok;
... ...
@@ -315,7 +315,7 @@ void print_contacts(FILE* _o, contact_t* _c)
315 315
 		fprintf(_o, "q       : %p\n", ptr->q);
316 316
 		fprintf(_o, "expires : %p\n", ptr->expires);
317 317
 		fprintf(_o, "received: %p\n", ptr->received);
318
-		fprintf(_o, "method  : %p\n", ptr->method);
318
+		fprintf(_o, "methods  : %p\n", ptr->methods);
319 319
 		fprintf(_o, "instance: %p\n", ptr->instance);
320 320
 		fprintf(_o, "len     : %d\n", ptr->len);
321 321
 		if (ptr->params) {
... ...
@@ -48,7 +48,7 @@ typedef struct contact {
48 48
 	str uri;                /* contact uri */
49 49
 	param_t* q;             /* q parameter hook */
50 50
 	param_t* expires;       /* expires parameter hook */
51
-	param_t* method;        /* method parameter hook */
51
+	param_t* methods;       /* methods parameter hook */
52 52
 	param_t* received;      /* received parameter hook */
53 53
 	param_t* instance;      /* sip.instance parameter hook */
54 54
 	param_t* params;        /* List of all parameters */
... ...
@@ -45,7 +45,7 @@
45 45
 
46 46
 /*
47 47
  * Try to find out parameter name, recognized parameters
48
- * are q, expires and method
48
+ * are q, expires and methods
49 49
  */
50 50
 static inline void parse_contact_class(param_hooks_t* _h, param_t* _p)
51 51
 {
... ...
@@ -78,10 +78,10 @@ static inline void parse_contact_class(param_hooks_t* _h, param_t* _p)
78 78
 		
79 79
 	case 'm':
80 80
 	case 'M':
81
-		if ((_p->name.len == 6) &&
82
-		    (!strncasecmp(_p->name.s + 1, "ethod", 5))) {
83
-			_p->type = P_METHOD;
84
-			_h->contact.method = _p;
81
+		if ((_p->name.len == 7) &&
82
+		    (!strncasecmp(_p->name.s + 1, "ethods", 6))) {
83
+			_p->type = P_METHODS;
84
+			_h->contact.methods = _p;
85 85
 		}
86 86
 		break;
87 87
 		
... ...
@@ -534,7 +534,7 @@ static inline void print_param(FILE* _o, param_t* _p)
534 534
 	case P_OTHER:     type = "P_OTHER";     break;
535 535
 	case P_Q:         type = "P_Q";         break;
536 536
 	case P_EXPIRES:   type = "P_EXPIRES";   break;
537
-	case P_METHOD:    type = "P_METHOD";    break;
537
+	case P_METHODS:   type = "P_METHODS";   break;
538 538
 	case P_TRANSPORT: type = "P_TRANSPORT"; break;
539 539
 	case P_LR:        type = "P_LR";        break;
540 540
 	case P_R2:        type = "P_R2";        break;
... ...
@@ -46,7 +46,7 @@ typedef enum ptype {
46 46
 	P_OTHER = 0, /* Unknown parameter */
47 47
 	P_Q,         /* Contact: q parameter */
48 48
 	P_EXPIRES,   /* Contact: expires parameter */
49
-	P_METHOD,    /* Contact: method parameter */
49
+	P_METHODS,   /* Contact: methods parameter */
50 50
 	P_RECEIVED,  /* Contact: received parameter */
51 51
 	P_TRANSPORT, /* URI: transport parameter */
52 52
 	P_LR,        /* URI: lr parameter */
... ...
@@ -88,7 +88,7 @@ typedef struct param {
88 88
 struct contact_hooks {
89 89
 	struct param* expires;  /* expires parameter */
90 90
 	struct param* q;        /* q parameter */
91
-	struct param* method;   /* method parameter */
91
+	struct param* methods;  /* methods parameter */
92 92
 	struct param* received; /* received parameter */
93 93
 	struct param* instance; /* sip.instance parameter */
94 94
 };