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
fadb2a38
Commit
fadb2a38
authored
Aug 13, 2014
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1161 from hurtonm/master
Reset metadata for outbound messages
parents
25de6a03
a54d8d7b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
msg.cpp
src/msg.cpp
+9
-0
msg.hpp
src/msg.hpp
+1
-0
socket_base.cpp
src/socket_base.cpp
+2
-0
No files found.
src/msg.cpp
View file @
fadb2a38
...
...
@@ -288,6 +288,15 @@ void zmq::msg_t::set_metadata (zmq::metadata_t *metadata_)
u
.
base
.
metadata
=
metadata_
;
}
void
zmq
::
msg_t
::
reset_metadata
()
{
if
(
u
.
base
.
metadata
)
{
if
(
u
.
base
.
metadata
->
drop_ref
())
delete
u
.
base
.
metadata
;
u
.
base
.
metadata
=
NULL
;
}
}
bool
zmq
::
msg_t
::
is_identity
()
const
{
return
(
u
.
base
.
flags
&
identity
)
==
identity
;
...
...
src/msg.hpp
View file @
fadb2a38
...
...
@@ -73,6 +73,7 @@ namespace zmq
void
set_fd
(
int64_t
fd_
);
metadata_t
*
metadata
()
const
;
void
set_metadata
(
metadata_t
*
metadata_
);
void
reset_metadata
();
bool
is_identity
()
const
;
bool
is_credential
()
const
;
bool
is_delimiter
()
const
;
...
...
src/socket_base.cpp
View file @
fadb2a38
...
...
@@ -799,6 +799,8 @@ int zmq::socket_base_t::send (msg_t *msg_, int flags_)
if
(
flags_
&
ZMQ_SNDMORE
)
msg_
->
set_flags
(
msg_t
::
more
);
msg_
->
reset_metadata
();
// Try to send the message.
rc
=
xsend
(
msg_
);
if
(
rc
==
0
)
...
...
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