From 9ce967a6432bc9e2701d94595d4dd64be1d73a99 Mon Sep 17 00:00:00 2001 From: Allanceng Date: Mon, 1 Dec 2014 11:44:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=85=E5=8A=A9=E6=9F=A5=E6=89=BE=E5=85=B3?= =?UTF-8?q?=E4=BA=8E=E8=A2=ABretain=E6=A0=87=E8=AE=B0=E7=9A=84=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E4=B8=BA=E4=BB=80=E4=B9=88=E5=8F=AA=E8=83=BD=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E6=9C=80=E5=90=8E=E4=B8=80=E6=9D=A1=E7=9A=84=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/subs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/subs.c b/src/subs.c index 240717d..949cdbc 100755 --- a/src/subs.c +++ b/src/subs.c @@ -96,13 +96,16 @@ static int _subs_process(struct mosquitto_db *db, struct _mosquitto_subhier *hie hier->retained->ref_count--; /* FIXME - it would be nice to be able to remove the message from the store at this point if ref_count == 0 */ db->retained_count--; + // printf("hier->retained is not null,hier->retained->ref_count:%d,db->retained_count:%d\n", hier->retained->ref_count, db->retained_count); } if(stored->msg.payloadlen){ hier->retained = stored; hier->retained->ref_count++; db->retained_count++; + // printf("stored->msg.payloadlen is not null,topic:%shier->retained->ref_count:%d,db->retained_count:%d\n",stored->msg.topic, hier->retained->ref_count, db->retained_count); }else{ hier->retained = NULL; + // printf("stored->msg.payloadlen is null\n"); } } while(source_id && leaf){