Skip to content

Commit

Permalink
辅助查找关于被retain标记的消息为什么只能保留最后一条的原因
Browse files Browse the repository at this point in the history
  • Loading branch information
Allanceng committed Dec 1, 2014
1 parent 666158c commit 9ce967a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/subs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down

0 comments on commit 9ce967a

Please sign in to comment.