Commits

Roger Light  committed b33e0c9

Further fix for bug #1226040: multiple retained messages being delivered for
subscriptions ending in #.

Thanks to Jan-Piet Mens.

  • Participants
  • Parent commits 19c2f13
  • Branches 1.2.3

Comments (0)

Files changed (2)

File ChangeLog.txt

+1.2.3 - 2013xxxx
+================
+
+Broker:
+- Don't always attempt to call read() for SSL clients, irrespective of whether
+  they were ready to read or not. Reduces syscalls significantly.
+- Possible memory leak fixes. 
+- Further fix for bug #1226040: multiple retained messages being delivered for
+  subscriptions ending in #.
+
+Client library:
 - Fix possible memory leak in C/C++ library when communicating with
   a broker that doesn't follow the spec.
-- Don't always attempt to call read() for SSL clients, irrespective of whether
-  they were ready to read or not. Reduces syscalls significantly.
 
 1.2.2 - 20131021
 ================
 			}
 		}else if(strcmp(branch->topic, "+") && (!strcmp(branch->topic, tokens->topic) || !strcmp(tokens->topic, "+"))){
 			if(tokens->next){
-				if(_retain_search(db, branch, tokens->next, context, sub, sub_qos, level+1) == -1){
+				if(_retain_search(db, branch, tokens->next, context, sub, sub_qos, level+1) == -1
+						|| (!branch->next && tokens->next && !strcmp(tokens->next->topic, "#") && level>0)){
+
 					if(branch->retained){
 						_retain_process(db, branch->retained, context, sub, sub_qos);
 					}
 					_retain_process(db, branch->retained, context, sub, sub_qos);
 				}
 			}
-			if(!branch->next && tokens->next && !strcmp(tokens->next->topic, "#") && level>0){
-				if(branch->retained){
-					_retain_process(db, branch->retained, context, sub, sub_qos);
-				}
-			}
 		}
 
 		branch = branch->next;