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
3e432587
Commit
3e432587
authored
Sep 06, 2015
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1570 from djelenc/deque_bug
Problem: Tests in Travis are failing randomly
parents
39a0d339
64ffda90
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
xpub.cpp
src/xpub.cpp
+9
-4
test_xpub_manual.cpp
tests/test_xpub_manual.cpp
+1
-1
No files found.
src/xpub.cpp
View file @
3e432587
...
...
@@ -245,8 +245,10 @@ int zmq::xpub_t::xrecv (msg_t *msg_)
}
// User is reading a message, set last_pipe and remove it from the deque
last_pipe
=
pending_pipes
.
front
();
pending_pipes
.
pop_front
();
if
(
manual
&&
!
pending_pipes
.
empty
())
{
last_pipe
=
pending_pipes
.
front
();
pending_pipes
.
pop_front
();
}
int
rc
=
msg_
->
close
();
errno_assert
(
rc
==
0
);
...
...
@@ -285,10 +287,13 @@ void zmq::xpub_t::send_unsubscription (unsigned char *data_, size_t size_,
unsub
[
0
]
=
0
;
if
(
size_
>
0
)
memcpy
(
&
unsub
[
1
],
data_
,
size_
);
self
->
last_pipe
=
NULL
;
self
->
pending_pipes
.
push_back
(
NULL
);
self
->
pending_data
.
push_back
(
unsub
);
self
->
pending_metadata
.
push_back
(
NULL
);
self
->
pending_flags
.
push_back
(
0
);
if
(
self
->
manual
)
{
self
->
last_pipe
=
NULL
;
self
->
pending_pipes
.
push_back
(
NULL
);
}
}
}
tests/test_xpub_manual.cpp
View file @
3e432587
...
...
@@ -199,7 +199,7 @@ int test_xpub_proxy_unsubscribe_on_disconnect()
assert
(
zmq_send
(
xsub_proxy
,
sub_buff
,
2
,
0
)
==
2
);
// should receive another unsubscribe msg
assert
(
zmq_recv
(
xpub_proxy
,
sub_buff
,
2
,
ZMQ_DONTWAIT
)
==
2
assert
(
zmq_recv
(
xpub_proxy
,
sub_buff
,
2
,
0
)
==
2
&&
"Should receive the second unsubscribe message."
);
assert
(
sub_buff
[
0
]
==
0
);
assert
(
sub_buff
[
1
]
==
*
topic
);
...
...
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