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
fd707fed
Commit
fd707fed
authored
Jul 06, 2010
by
Martin Hurton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue 38 - Assertion failed: fetched (xrep.cpp:196)
parent
805af824
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
xrep.cpp
src/xrep.cpp
+12
-8
xrep.hpp
src/xrep.hpp
+6
-0
No files found.
src/xrep.cpp
View file @
fd707fed
...
...
@@ -26,6 +26,7 @@
zmq
::
xrep_t
::
xrep_t
(
class
app_thread_t
*
parent_
)
:
socket_base_t
(
parent_
),
current_in
(
0
),
prefetched
(
false
),
more_in
(
false
),
current_out
(
NULL
),
more_out
(
false
)
...
...
@@ -189,6 +190,13 @@ int zmq::xrep_t::xrecv (zmq_msg_t *msg_, int flags_)
// Deallocate old content of the message.
zmq_msg_close
(
msg_
);
if
(
prefetched
)
{
zmq_msg_move
(
msg_
,
&
prefetched_msg
);
more_in
=
msg_
->
flags
&
ZMQ_MSG_MORE
;
prefetched
=
false
;
return
0
;
}
// If we are in the middle of reading a message, just grab next part of it.
if
(
more_in
)
{
zmq_assert
(
inpipes
[
current_in
].
active
);
...
...
@@ -207,21 +215,17 @@ int zmq::xrep_t::xrecv (zmq_msg_t *msg_, int flags_)
for
(
int
count
=
inpipes
.
size
();
count
!=
0
;
count
--
)
{
// Try to fetch new message.
bool
fetched
;
if
(
!
inpipes
[
current_in
].
active
)
fetched
=
false
;
else
fetched
=
inpipes
[
current_in
].
reader
->
check_read
();
if
(
inpipes
[
current_in
].
active
)
prefetched
=
inpipes
[
current_in
].
reader
->
read
(
&
prefetched_msg
);
// If we have a message, create a prefix and return it to the caller.
if
(
fetched
)
{
if
(
pre
fetched
)
{
int
rc
=
zmq_msg_init_size
(
msg_
,
inpipes
[
current_in
].
identity
.
size
());
zmq_assert
(
rc
==
0
);
memcpy
(
zmq_msg_data
(
msg_
),
inpipes
[
current_in
].
identity
.
data
(),
zmq_msg_size
(
msg_
));
msg_
->
flags
=
ZMQ_MSG_MORE
;
more_in
=
true
;
return
0
;
}
...
...
@@ -241,7 +245,7 @@ int zmq::xrep_t::xrecv (zmq_msg_t *msg_, int flags_)
bool
zmq
::
xrep_t
::
xhas_in
()
{
// There are subsequent parts of the partly-read message available.
if
(
more_in
)
if
(
prefetched
||
more_in
)
return
true
;
// Note that messing with current doesn't break the fairness of fair
...
...
src/xrep.hpp
View file @
fd707fed
...
...
@@ -67,6 +67,12 @@ namespace zmq
// The pipe we are currently reading from.
inpipes_t
::
size_type
current_in
;
// Have we prefetched a message.
bool
prefetched
;
// Holds the prefetched message.
zmq_msg_t
prefetched_msg
;
// If true, more incoming message parts are expected.
bool
more_in
;
...
...
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