mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-09 23:36:04 +00:00
Bug in matching algorithm fixed
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
parent
25cc25e9ad
commit
d726120e60
@ -210,13 +210,17 @@ void zmq::mtrie_t::match (unsigned char *data_, size_t size_,
|
|||||||
void (*func_) (pipe_t *pipe_, void *arg_), void *arg_)
|
void (*func_) (pipe_t *pipe_, void *arg_), void *arg_)
|
||||||
{
|
{
|
||||||
mtrie_t *current = this;
|
mtrie_t *current = this;
|
||||||
while (size_) {
|
while (true) {
|
||||||
|
|
||||||
// Signal the pipes attached to this node.
|
// Signal the pipes attached to this node.
|
||||||
for (pipes_t::iterator it = current->pipes.begin ();
|
for (pipes_t::iterator it = current->pipes.begin ();
|
||||||
it != current->pipes.end (); ++it)
|
it != current->pipes.end (); ++it)
|
||||||
func_ (*it, arg_);
|
func_ (*it, arg_);
|
||||||
|
|
||||||
|
// If we are at the end of the message, there's nothing more to match.
|
||||||
|
if (!size_)
|
||||||
|
break;
|
||||||
|
|
||||||
// If there are no subnodes in the trie, return.
|
// If there are no subnodes in the trie, return.
|
||||||
if (current->count == 0)
|
if (current->count == 0)
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user