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
9c2740d9
Commit
9c2740d9
authored
Aug 18, 2013
by
Uli Köhler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes to doc ; added zmq_msg_init_data() assert preventing deferred segfault
parent
bcfe863f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
msg.cpp
src/msg.cpp
+4
-2
msg.hpp
src/msg.hpp
+4
-1
zmq.cpp
src/zmq.cpp
+1
-1
No files found.
src/msg.cpp
View file @
9c2740d9
...
...
@@ -58,7 +58,7 @@ int zmq::msg_t::init_size (size_t size_)
u
.
lmsg
.
flags
=
0
;
u
.
lmsg
.
content
=
(
content_t
*
)
malloc
(
sizeof
(
content_t
)
+
size_
);
if
(
!
u
.
lmsg
.
content
)
{
if
(
unlikely
(
!
u
.
lmsg
.
content
)
)
{
errno
=
ENOMEM
;
return
-
1
;
}
...
...
@@ -75,7 +75,9 @@ int zmq::msg_t::init_size (size_t size_)
int
zmq
::
msg_t
::
init_data
(
void
*
data_
,
size_t
size_
,
msg_free_fn
*
ffn_
,
void
*
hint_
)
{
// Initialize constant message if there's no need to deallocate
// If data is NULL and size is not 0, a segfault
// would occur once the data is accessed
assert
(
data_
!=
NULL
||
size_
==
0
);
if
(
ffn_
==
NULL
)
{
u
.
cmsg
.
type
=
type_cmsg
;
u
.
cmsg
.
flags
=
0
;
...
...
src/msg.hpp
View file @
9c2740d9
...
...
@@ -44,7 +44,7 @@ namespace zmq
{
public
:
// Mesage flags.
// Mes
s
age flags.
enum
{
more
=
1
,
...
...
@@ -105,8 +105,11 @@ namespace zmq
enum
type_t
{
type_min
=
101
,
// VSM messages store the content in the message itself
type_vsm
=
101
,
// LMSG messages store the content in malloc-ed memory
type_lmsg
=
102
,
// Delimiter messages are used in envelopes
type_delimiter
=
103
,
// CMSG messages point to constant data
type_cmsg
=
104
,
...
...
src/zmq.cpp
View file @
9c2740d9
...
...
@@ -539,7 +539,7 @@ int zmq_recviov (void *s_, iovec *a_, size_t *count_, int flags_)
a_
[
i
].
iov_len
=
zmq_msg_size
(
&
msg
);
a_
[
i
].
iov_base
=
malloc
(
a_
[
i
].
iov_len
);
if
(
!
a_
[
i
].
iov_base
)
{
if
(
unlikely
(
!
a_
[
i
].
iov_base
)
)
{
errno
=
ENOMEM
;
return
-
1
;
}
...
...
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