[470246] Change sys tree print output on USR2.

Thanks to Yun Wu.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=470246
This commit is contained in:
Roger A. Light 2015-06-29 21:24:16 +01:00
parent b2496f7bdc
commit a4dad02064
2 changed files with 19 additions and 15 deletions

View File

@ -20,6 +20,8 @@ Broker:
- Add systemd startup notification and services. Closes #471053.
- Reduce unnecessary malloc and memcpy when receiving a message and storing
it. Closes #470258.
- Change sys tree printing output. This format shouldn't be relied upon and
may change at any time. Closes #470246.
Client library:
- Outgoing messages with QoS>1 are no longer retried after a timeout period.

View File

@ -599,23 +599,25 @@ void sub__tree_print(struct mosquitto__subhier *root, int level)
struct mosquitto__subhier *branch;
struct mosquitto__subleaf *leaf;
for(i=0; i<level*2; i++){
printf(" ");
}
printf("%s", UHPA_ACCESS_TOPIC(root));
leaf = root->subs;
while(leaf){
if(leaf->context){
printf(" (%s, %d)", leaf->context->id, leaf->qos);
}else{
printf(" (%s, %d)", "", leaf->qos);
if(level > 1){
for(i=0; i<(level-2)*2; i++){
printf(" ");
}
leaf = leaf->next;
printf("%s", UHPA_ACCESS_TOPIC(root));
leaf = root->subs;
while(leaf){
if(leaf->context){
printf(" (%s, %d)", leaf->context->id, leaf->qos);
}else{
printf(" (%s, %d)", "", leaf->qos);
}
leaf = leaf->next;
}
if(root->retained){
printf(" (r)");
}
printf("\n");
}
if(root->retained){
printf(" (r)");
}
printf("\n");
branch = root->children;
while(branch){