Browse Source

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 16 years ago
parent
commit
524b467734
4 changed files with 11 additions and 11 deletions
  1. 2 2
      parser/contact/contact.c
  2. 1 1
      parser/contact/contact.h
  3. 6 6
      parser/parse_param.c
  4. 2 2
      parser/parse_param.h

+ 2 - 2
parser/contact/contact.c

@@ -246,7 +246,7 @@ int parse_contacts(str* _s, contact_t** _c)
 			c->q = hooks.contact.q;
 			c->expires = hooks.contact.expires;
 			c->received = hooks.contact.received;
-			c->method = hooks.contact.method;
+			c->methods = hooks.contact.methods;
 			c->instance = hooks.contact.instance;
 
 			if (_s->len == 0) goto ok;
@@ -315,7 +315,7 @@ void print_contacts(FILE* _o, contact_t* _c)
 		fprintf(_o, "q       : %p\n", ptr->q);
 		fprintf(_o, "expires : %p\n", ptr->expires);
 		fprintf(_o, "received: %p\n", ptr->received);
-		fprintf(_o, "method  : %p\n", ptr->method);
+		fprintf(_o, "methods  : %p\n", ptr->methods);
 		fprintf(_o, "instance: %p\n", ptr->instance);
 		fprintf(_o, "len     : %d\n", ptr->len);
 		if (ptr->params) {

+ 1 - 1
parser/contact/contact.h

@@ -48,7 +48,7 @@ typedef struct contact {
 	str uri;                /* contact uri */
 	param_t* q;             /* q parameter hook */
 	param_t* expires;       /* expires parameter hook */
-	param_t* method;        /* method parameter hook */
+	param_t* methods;       /* methods parameter hook */
 	param_t* received;      /* received parameter hook */
 	param_t* instance;      /* sip.instance parameter hook */
 	param_t* params;        /* List of all parameters */

+ 6 - 6
parser/parse_param.c

@@ -45,7 +45,7 @@
 
 /*
  * Try to find out parameter name, recognized parameters
- * are q, expires and method
+ * are q, expires and methods
  */
 static inline void parse_contact_class(param_hooks_t* _h, param_t* _p)
 {
@@ -78,10 +78,10 @@ static inline void parse_contact_class(param_hooks_t* _h, param_t* _p)
 		
 	case 'm':
 	case 'M':
-		if ((_p->name.len == 6) &&
-		    (!strncasecmp(_p->name.s + 1, "ethod", 5))) {
-			_p->type = P_METHOD;
-			_h->contact.method = _p;
+		if ((_p->name.len == 7) &&
+		    (!strncasecmp(_p->name.s + 1, "ethods", 6))) {
+			_p->type = P_METHODS;
+			_h->contact.methods = _p;
 		}
 		break;
 		
@@ -534,7 +534,7 @@ static inline void print_param(FILE* _o, param_t* _p)
 	case P_OTHER:     type = "P_OTHER";     break;
 	case P_Q:         type = "P_Q";         break;
 	case P_EXPIRES:   type = "P_EXPIRES";   break;
-	case P_METHOD:    type = "P_METHOD";    break;
+	case P_METHODS:   type = "P_METHODS";   break;
 	case P_TRANSPORT: type = "P_TRANSPORT"; break;
 	case P_LR:        type = "P_LR";        break;
 	case P_R2:        type = "P_R2";        break;

+ 2 - 2
parser/parse_param.h

@@ -46,7 +46,7 @@ typedef enum ptype {
 	P_OTHER = 0, /* Unknown parameter */
 	P_Q,         /* Contact: q parameter */
 	P_EXPIRES,   /* Contact: expires parameter */
-	P_METHOD,    /* Contact: method parameter */
+	P_METHODS,   /* Contact: methods parameter */
 	P_RECEIVED,  /* Contact: received parameter */
 	P_TRANSPORT, /* URI: transport parameter */
 	P_LR,        /* URI: lr parameter */
@@ -88,7 +88,7 @@ typedef struct param {
 struct contact_hooks {
 	struct param* expires;  /* expires parameter */
 	struct param* q;        /* q parameter */
-	struct param* method;   /* method parameter */
+	struct param* methods;  /* methods parameter */
 	struct param* received; /* received parameter */
 	struct param* instance; /* sip.instance parameter */
 };