[asterisk-commits] mjordan: trunk r394701 - /trunk/main/http.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 18 09:50:58 CDT 2013


Author: mjordan
Date: Thu Jul 18 09:50:56 2013
New Revision: 394701

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=394701
Log:
Tweak debug statements

This patch does two things:
1. It moves the debug statement that shows the HTTP sub-protocols being
   compared after the string length calculation such that it shows the correct
   string length in the output
2. It adds some additional debug that displays when it matches on a
   sub-protocol and when it fails


Modified:
    trunk/main/http.c

Modified: trunk/main/http.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/http.c?view=diff&rev=394701&r1=394700&r2=394701
==============================================================================
--- trunk/main/http.c (original)
+++ trunk/main/http.c Thu Jul 18 09:50:56 2013
@@ -676,7 +676,7 @@
 			prev = v;
 		}
 	}
-	
+
 done:
 	ast_free(buf);
 	return post_vars;
@@ -741,9 +741,9 @@
 		/* 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);
 			l = strlen(urih->uri);
 			c = uri + l;	/* candidate */
+			ast_debug(2, "match request [%s] with handler [%s] len %d\n", uri, urih->uri, l);
 			if (strncasecmp(urih->uri, uri, l) /* no match */
 			    || (*c && *c != '/')) { /* substring */
 				continue;
@@ -759,11 +759,13 @@
 		AST_RWLIST_UNLOCK(&uris);
 	}
 	if (urih) {
+		ast_debug(1, "Match made with [%s]\n", urih->uri);
 		if (!urih->no_decode_uri) {
 			ast_uri_decode(uri, ast_uri_http_legacy);
 		}
 		res = urih->callback(ser, urih, uri, method, get_vars, headers);
 	} else {
+		ast_debug(1, "Requested URI [%s] has no handler\n", uri);
 		ast_http_error(ser, 404, "Not Found", "The requested URL was not found on this server.");
 	}
 




More information about the asterisk-commits mailing list