Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Problems subscribing to $ and #

Hi Dave,

This occurs with topics that begin with a $, but that aren't $SYS. It
can be fixed with the patch I've pasted below. This will be in the
next release, thanks again for the report.

Cheers,

Roger

diff -r dc6614f8ee96 src/subs.c
--- a/src/subs.c        Mon May 05 20:30:52 2014 +0100
+++ b/src/subs.c        Mon May 05 22:17:03 2014 +0100
@@ -397,7 +397,6 @@
                        _mosquitto_log_printf(NULL, MOSQ_LOG_ERR,
"Error: Out of memory.");
                        return MOSQ_ERR_NOMEM;
                }
-               child->next = NULL;
                child->topic = _mosquitto_strdup(tokens->topic);
                if(!child->topic){
                        _mosquitto_log_printf(NULL, MOSQ_LOG_ERR,
"Error: Out of memory.");
@@ -406,6 +405,11 @@
                child->subs = NULL;
                child->children = NULL;
                child->retained = NULL;
+               if(db->subs.children){
+                       child->next = db->subs.children;
+               }else{
+                       child->next = NULL;
+               }
                db->subs.children = child;

                rc = _sub_add(db, context, qos, child, tokens);

On Wed, Apr 30, 2014 at 10:26 AM, Roger Light <roger@xxxxxxxxxx> wrote:
> Hi Dave,
>
> Thanks for the email, I'll have to take a proper look.
>
> Cheers,
>
> Roger
>
>
>
> On Wed, Apr 30, 2014 at 12:42 AM, David Woodard
> <david.woodard@xxxxxxxxxxxx> wrote:
>> Hi All,
>>
>> I am seeing strange behavior when testing against the newest Mosquitto
>> broker (v1.3.1). When I subscribe to the below topics, in this exact order:
>>
>> $TEST/#
>> #
>>
>> Messages published to any topic space (ex: test/it/now) are received as
>> expected. However, messages published to $TEST/test are not received. If I
>> reverse the order in which I subscribe:
>>
>> #
>> $TEST/#
>>
>> Messages published to $TEST/test are received, but I don't receive any other
>> messages (ex: test/it/now). I have seen this behavior on my local build as
>> well as on m2m.eclipse.org. I have tried the mosquitto_sub/pub clients as
>> well as Paho. Let me know if I can provide more information to assist in
>> debug.
>>
>> Thanks,
>>
>> --Dave
>>
>>
>> _______________________________________________
>> mosquitto-dev mailing list
>> mosquitto-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/mosquitto-dev
>>


Back to the top