[svn-commits] rizzo: trunk r117266 - /trunk/main/http.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue May 20 11:39:39 CDT 2008


Author: rizzo
Date: Tue May 20 11:39:39 2008
New Revision: 117266

URL: http://svn.digium.com/view/asterisk?view=rev&rev=117266
Log:
Reverse the check for Cookie: and remove leftover code implementing
the same thing.
Add an ast_debug() call to help debugging the url matching.


Modified:
    trunk/main/http.c

Modified: trunk/main/http.c
URL: http://svn.digium.com/view/asterisk/trunk/main/http.c?view=diff&rev=117266&r1=117265&r2=117266
==============================================================================
--- trunk/main/http.c (original)
+++ trunk/main/http.c Tue May 20 11:39:39 2008
@@ -451,6 +451,7 @@
 		/* scan registered uris to see if we match one. */
 		AST_RWLIST_RDLOCK(&uris);
 		AST_RWLIST_TRAVERSE(&uris, urih, entry) {
+			ast_debug(2, "match request [%s] with handler [%s] len %d\n", uri, urih->uri, l);
 			if (!saw_method) {
 				switch (method) {
 				case AST_HTTP_GET:
@@ -632,33 +633,9 @@
 		if (ast_strlen_zero(cookie)) {
 			break;
 		}
-		if (strncasecmp(cookie, "Cookie: ", 8)) {
-			char *name, *value;
-			struct ast_variable *var;
-
-			value = ast_strdupa(cookie);
-			name = strsep(&value, ":");
-			if (!value) {
-				continue;
-			}
-			value = ast_skip_blanks(value);
-			if (ast_strlen_zero(value)) {
-				continue;
-			}
-			var = ast_variable_new(name, value, "");
-			if (!var) { 
-				continue;
-			}
-			var->next = headers;
-			headers = var;
-
-			continue;
-		}
-
-		if (vars) {
-			ast_variables_destroy(vars);
-		}
-		vars = parse_cookies(cookie);
+		if (!strncasecmp(cookie, "Cookie: ", 8)) {
+			vars = parse_cookies(cookie);
+		}
 	}
 
 	if (!*uri) {




More information about the svn-commits mailing list