diff options
author | Matthew Jordan <mjordan@digium.com> | 2013-07-18 14:50:56 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2013-07-18 14:50:56 +0000 |
commit | 3a2a12ca1ad8097482fe621e8b877db682601905 (patch) | |
tree | 9a9460219a09bbb6859ed62000778ee4fe9db9e9 /main/http.c | |
parent | de68dabb97151b334c1cbb73ee6ac0d0aecd3ed9 (diff) |
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
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/http.c')
-rw-r--r-- | main/http.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/http.c b/main/http.c index d459eb184..971fbe24c 100644 --- a/main/http.c +++ b/main/http.c @@ -676,7 +676,7 @@ struct ast_variable *ast_http_get_post_vars( prev = v; } } - + done: ast_free(buf); return post_vars; @@ -741,9 +741,9 @@ static int handle_uri(struct ast_tcptls_session_instance *ser, char *uri, /* 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 @@ static int handle_uri(struct ast_tcptls_session_instance *ser, char *uri, 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."); } |