[asterisk-commits] mmichelson: branch mmichelson/pub_sub r385685 - /team/mmichelson/pub_sub/res/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Apr 15 09:47:04 CDT 2013
Author: mmichelson
Date: Mon Apr 15 09:47:01 2013
New Revision: 385685
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385685
Log:
I had a row-column mistake in a two-dimensional array. Dang.
I also added some debug that helped me to track down what was going wrong.
Modified:
team/mmichelson/pub_sub/res/res_sip_pubsub.c
Modified: team/mmichelson/pub_sub/res/res_sip_pubsub.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pub_sub/res/res_sip_pubsub.c?view=diff&rev=385685&r1=385684&r2=385685
==============================================================================
--- team/mmichelson/pub_sub/res/res_sip_pubsub.c (original)
+++ team/mmichelson/pub_sub/res/res_sip_pubsub.c Mon Apr 15 09:47:01 2013
@@ -335,7 +335,7 @@
AST_RWLIST_TRAVERSE_SAFE_END;
}
-static struct ast_sip_subscription_handler *find_handler(const char *event, char accept[][AST_SIP_MAX_ACCEPT], size_t num_accept)
+static struct ast_sip_subscription_handler *find_handler(const char *event, char accept[AST_SIP_MAX_ACCEPT][64], size_t num_accept)
{
struct ast_sip_subscription_handler *iter;
int match = 0;
@@ -344,17 +344,22 @@
int i;
int j;
if (strcmp(event, iter->event_name)) {
+ ast_debug(3, "Event %s does not match %s\n", event, iter->event_name);
continue;
}
+ ast_debug(3, "Event name match: %s = %s\n", event, iter->event_name);
for (i = 0; i < num_accept; ++i) {
for (j = 0; j < num_accept; ++j) {
if (ast_strlen_zero(iter->accept[i])) {
+ ast_debug(3, "Breaking because subscription handler has run out of 'accept' types\n");
break;
}
if (!strcmp(accept[j], iter->accept[i])) {
+ ast_debug(3, "Accept headers match: %s = %s\n", accept[j], iter->accept[i]);
match = 1;
break;
}
+ ast_debug(3, "Accept %s does not match %s\n", accept[j], iter->accept[i]);
}
if (match) {
break;
@@ -372,7 +377,7 @@
{
static const pj_str_t event_name = { "Event", 5 };
char event[32];
- char accept[64][AST_SIP_MAX_ACCEPT];
+ char accept[AST_SIP_MAX_ACCEPT][64];
pjsip_accept_hdr *accept_header;
pjsip_event_hdr *event_header;
struct ast_sip_subscription_handler *handler;
More information about the asterisk-commits
mailing list