Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
82c06e44
Commit
82c06e44
authored
Mar 23, 2012
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue #325
parent
c861fb4c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
router.cpp
src/router.cpp
+23
-18
No files found.
src/router.cpp
View file @
82c06e44
/*
/*
Copyright (c) 2012 iMatix Corporation
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2011 iMatix Corporation
Copyright (c) 2011 VMware, Inc.
Copyright (c) 2011 VMware, Inc.
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
...
@@ -106,6 +106,7 @@ void zmq::router_t::xterminated (pipe_t *pipe_)
...
@@ -106,6 +106,7 @@ void zmq::router_t::xterminated (pipe_t *pipe_)
return
;
return
;
}
}
}
}
// We should never get here
zmq_assert
(
false
);
zmq_assert
(
false
);
}
}
...
@@ -236,25 +237,29 @@ int zmq::router_t::xrecv (msg_t *msg_, int flags_)
...
@@ -236,25 +237,29 @@ int zmq::router_t::xrecv (msg_t *msg_, int flags_)
zmq_assert
(
!
more_in
);
zmq_assert
(
!
more_in
);
// Empty identity means we can preserve the auto-generated identity.
// Empty identity means we can preserve the auto-generated identity
if
(
msg_
->
size
()
!=
0
)
{
if
(
msg_
->
size
())
{
blob_t
identity
((
unsigned
char
*
)
msg_
->
data
(),
msg_
->
size
());
// Actual change of the identity.
outpipes_t
::
iterator
it
=
outpipes
.
find
(
identity
);
outpipes_t
::
iterator
it
=
outpipes
.
begin
();
if
(
it
==
outpipes
.
end
())
{
while
(
it
!=
outpipes
.
end
())
{
// Find the pipe and change its identity
if
(
it
->
second
.
pipe
==
pipe
)
{
bool
changed
=
false
;
blob_t
identity
((
unsigned
char
*
)
msg_
->
data
(),
it
=
outpipes
.
begin
();
msg_
->
size
());
while
(
it
!=
outpipes
.
end
())
{
pipe
->
set_identity
(
identity
);
if
(
it
->
second
.
pipe
==
pipe
)
{
outpipes
.
erase
(
it
);
pipe
->
set_identity
(
identity
);
outpipe_t
outpipe
=
{
pipe
,
true
};
outpipes
.
erase
(
it
);
outpipes
.
insert
(
outpipes_t
::
value_type
(
identity
,
outpipe_t
outpipe
=
{
pipe
,
true
};
outpipe
));
if
(
!
outpipes
.
insert
(
break
;
outpipes_t
::
value_type
(
identity
,
outpipe
)).
second
)
zmq_assert
(
false
);
changed
=
true
;
break
;
}
++
it
;
}
}
++
it
;
zmq_assert
(
changed
)
;
}
}
zmq_assert
(
it
!=
outpipes
.
end
());
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment