Browse code

- case insensitive for GMT (although rfc3261 explicitely specifies that the date is canse sensitive in practice there are some UAs that use lower case GMT, e.g.: "MSSGW(B)" )

Andrei Pelinescu-Onciul authored on 10/09/2007 19:55:39
Showing 1 changed files
... ...
@@ -134,7 +134,8 @@ static int rfc1123totm (char *stime, struct tm *ttm ) {
134 134
 	ptime+=2;
135 135
 
136 136
 	/* " GMT" */
137
-	if (memcmp(ptime," GMT", strlen(" GMT"))) return -15;
137
+	uval = READ(ptime);
138
+	if ((uval | 0x20202020) != 0x746d6720) return -15;
138 139
 
139 140
 	return 0;
140 141
 }
... ...
@@ -173,7 +174,8 @@ char* parse_date(char *buffer, char *end, struct date_body *db)
173 174
 	}
174 175
 	LOG(L_ERR, "ERROR: Date EoL expected\n");
175 176
 error:
176
-	LOG(L_ERR,"ERROR: parse_date: parse error\n");
177
+	LOG(L_ERR,"ERROR: parse_date: parse error: \"%.*s\" (%d)\n",
178
+				i1, buffer, i1);
177 179
 	return p;
178 180
 }
179 181