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
da1920d9
Commit
da1920d9
authored
Feb 17, 2012
by
Mikko Koppanen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert NULL checks in the API
parent
c9898d24
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
15 additions
and
69 deletions
+15
-69
zmq_msg_size.txt
doc/zmq_msg_size.txt
+2
-10
zmq.h
include/zmq.h
+1
-1
inproc_lat.cpp
perf/inproc_lat.cpp
+1
-1
inproc_thr.cpp
perf/inproc_thr.cpp
+1
-1
local_lat.cpp
perf/local_lat.cpp
+1
-1
local_thr.cpp
perf/local_thr.cpp
+1
-1
remote_lat.cpp
perf/remote_lat.cpp
+1
-1
msg.cpp
src/msg.cpp
+1
-1
msg.hpp
src/msg.hpp
+2
-2
zmq.cpp
src/zmq.cpp
+4
-50
No files found.
doc/zmq_msg_size.txt
View file @
da1920d9
...
...
@@ -9,7 +9,7 @@ zmq_msg_size - retrieve message content size in bytes
SYNOPSIS
--------
*s
s
ize_t zmq_msg_size (zmq_msg_t '*msg');*
*size_t zmq_msg_size (zmq_msg_t '*msg');*
DESCRIPTION
...
...
@@ -29,15 +29,7 @@ message content in bytes.
ERRORS
------
The _zmq_msg_size()_ function shall return a positive integer (0 or higher)
if successful. Otherwise it shall return `-1` and set 'errno' to one of the
values defined below.
ERRORS
------
*EFAULT*::
The provided 'msg' was NULL.
No errors are defined.
SEE ALSO
...
...
include/zmq.h
View file @
da1920d9
...
...
@@ -168,7 +168,7 @@ ZMQ_EXPORT int zmq_msg_close (zmq_msg_t *msg);
ZMQ_EXPORT
int
zmq_msg_move
(
zmq_msg_t
*
dest
,
zmq_msg_t
*
src
);
ZMQ_EXPORT
int
zmq_msg_copy
(
zmq_msg_t
*
dest
,
zmq_msg_t
*
src
);
ZMQ_EXPORT
void
*
zmq_msg_data
(
zmq_msg_t
*
msg
);
ZMQ_EXPORT
s
s
ize_t
zmq_msg_size
(
zmq_msg_t
*
msg
);
ZMQ_EXPORT
size_t
zmq_msg_size
(
zmq_msg_t
*
msg
);
ZMQ_EXPORT
int
zmq_msg_more
(
zmq_msg_t
*
msg
);
ZMQ_EXPORT
int
zmq_msg_get
(
zmq_msg_t
*
msg
,
int
option
,
void
*
optval
,
size_t
*
optvallen
);
...
...
perf/inproc_lat.cpp
View file @
da1920d9
...
...
@@ -35,7 +35,7 @@
#include <pthread.h>
#endif
static
s
s
ize_t
message_size
;
static
size_t
message_size
;
static
int
roundtrip_count
;
#if defined ZMQ_HAVE_WINDOWS
...
...
perf/inproc_thr.cpp
View file @
da1920d9
...
...
@@ -36,7 +36,7 @@
#endif
static
int
message_count
;
static
s
s
ize_t
message_size
;
static
size_t
message_size
;
#if defined ZMQ_HAVE_WINDOWS
static
unsigned
int
__stdcall
worker
(
void
*
ctx_
)
...
...
perf/local_lat.cpp
View file @
da1920d9
...
...
@@ -28,7 +28,7 @@ int main (int argc, char *argv [])
{
const
char
*
bind_to
;
int
roundtrip_count
;
s
s
ize_t
message_size
;
size_t
message_size
;
void
*
ctx
;
void
*
s
;
int
rc
;
...
...
perf/local_thr.cpp
View file @
da1920d9
...
...
@@ -28,7 +28,7 @@ int main (int argc, char *argv [])
{
const
char
*
bind_to
;
int
message_count
;
s
s
ize_t
message_size
;
size_t
message_size
;
void
*
ctx
;
void
*
s
;
int
rc
;
...
...
perf/remote_lat.cpp
View file @
da1920d9
...
...
@@ -29,7 +29,7 @@ int main (int argc, char *argv [])
{
const
char
*
connect_to
;
int
roundtrip_count
;
s
s
ize_t
message_size
;
size_t
message_size
;
void
*
ctx
;
void
*
s
;
int
rc
;
...
...
src/msg.cpp
View file @
da1920d9
...
...
@@ -202,7 +202,7 @@ void *zmq::msg_t::data ()
}
}
s
s
ize_t
zmq
::
msg_t
::
size
()
size_t
zmq
::
msg_t
::
size
()
{
// Check the validity of the message.
zmq_assert
(
check
());
...
...
src/msg.hpp
View file @
da1920d9
...
...
@@ -65,7 +65,7 @@ namespace zmq
int
move
(
msg_t
&
src_
);
int
copy
(
msg_t
&
src_
);
void
*
data
();
s
s
ize_t
size
();
size_t
size
();
unsigned
char
flags
();
void
set_flags
(
unsigned
char
flags_
);
void
reset_flags
(
unsigned
char
flags_
);
...
...
@@ -96,7 +96,7 @@ namespace zmq
struct
content_t
{
void
*
data
;
s
s
ize_t
size
;
size_t
size
;
msg_free_fn
*
ffn
;
void
*
hint
;
zmq
::
atomic_counter_t
refcnt
;
...
...
src/zmq.cpp
View file @
da1920d9
...
...
@@ -34,7 +34,7 @@
defined ZMQ_HAVE_NETBSD
#define ZMQ_POLL_BASED_ON_POLL
#elif defined ZMQ_HAVE_WINDOWS || defined ZMQ_HAVE_OPENVMS ||\
defined ZMQ_HAVE_CYGWIN
defined ZMQ_HAVE_CYGWIN
#define ZMQ_POLL_BASED_ON_SELECT
#endif
...
...
@@ -430,7 +430,7 @@ int zmq_recv (void *s_, void *buf_, size_t len_, int flags_)
rc
=
zmq_msg_close
(
&
msg
);
errno_assert
(
rc
==
0
);
return
nbytes
;
return
nbytes
;
}
// Receive a multi-part message
...
...
@@ -495,36 +495,24 @@ int zmq_recviov (void *s_, iovec *a_, size_t *count_, int flags_)
}
if
(
s
->
thread_safe
())
s
->
unlock
();
return
nread
;
return
nread
;
}
// Message manipulators.
int
zmq_msg_init
(
zmq_msg_t
*
msg_
)
{
if
(
!
msg_
)
{
errno
=
EFAULT
;
return
-
1
;
}
return
((
zmq
::
msg_t
*
)
msg_
)
->
init
();
}
int
zmq_msg_init_size
(
zmq_msg_t
*
msg_
,
size_t
size_
)
{
if
(
!
msg_
)
{
errno
=
EFAULT
;
return
-
1
;
}
return
((
zmq
::
msg_t
*
)
msg_
)
->
init_size
(
size_
);
}
int
zmq_msg_init_data
(
zmq_msg_t
*
msg_
,
void
*
data_
,
size_t
size_
,
zmq_free_fn
*
ffn_
,
void
*
hint_
)
{
if
(
!
msg_
)
{
errno
=
EFAULT
;
return
-
1
;
}
return
((
zmq
::
msg_t
*
)
msg_
)
->
init_data
(
data_
,
size_
,
ffn_
,
hint_
);
}
...
...
@@ -560,46 +548,26 @@ int zmq_msg_recv (zmq_msg_t *msg_, void *s_, int flags_)
int
zmq_msg_close
(
zmq_msg_t
*
msg_
)
{
if
(
!
msg_
)
{
errno
=
EFAULT
;
return
-
1
;
}
return
((
zmq
::
msg_t
*
)
msg_
)
->
close
();
}
int
zmq_msg_move
(
zmq_msg_t
*
dest_
,
zmq_msg_t
*
src_
)
{
if
(
!
dest_
||
!
src_
)
{
errno
=
EFAULT
;
return
-
1
;
}
return
((
zmq
::
msg_t
*
)
dest_
)
->
move
(
*
(
zmq
::
msg_t
*
)
src_
);
}
int
zmq_msg_copy
(
zmq_msg_t
*
dest_
,
zmq_msg_t
*
src_
)
{
if
(
!
dest_
||
!
src_
)
{
errno
=
EFAULT
;
return
-
1
;
}
return
((
zmq
::
msg_t
*
)
dest_
)
->
copy
(
*
(
zmq
::
msg_t
*
)
src_
);
}
void
*
zmq_msg_data
(
zmq_msg_t
*
msg_
)
{
if
(
!
msg_
)
{
errno
=
EFAULT
;
return
NULL
;
}
return
((
zmq
::
msg_t
*
)
msg_
)
->
data
();
}
s
s
ize_t
zmq_msg_size
(
zmq_msg_t
*
msg_
)
size_t
zmq_msg_size
(
zmq_msg_t
*
msg_
)
{
if
(
!
msg_
)
{
errno
=
EFAULT
;
return
-
1
;
}
return
((
zmq
::
msg_t
*
)
msg_
)
->
size
();
}
...
...
@@ -615,10 +583,6 @@ int zmq_msg_more (zmq_msg_t *msg_)
int
zmq_msg_get
(
zmq_msg_t
*
msg_
,
int
option_
,
void
*
optval_
,
size_t
*
optvallen_
)
{
if
(
!
msg_
)
{
errno
=
EFAULT
;
return
-
1
;
}
switch
(
option_
)
{
case
ZMQ_MORE
:
if
(
*
optvallen_
<
sizeof
(
int
))
{
...
...
@@ -638,10 +602,6 @@ int zmq_msg_get (zmq_msg_t *msg_, int option_, void *optval_,
int
zmq_msg_set
(
zmq_msg_t
*
msg_
,
int
option_
,
const
void
*
optval_
,
size_t
*
optvallen_
)
{
if
(
!
msg_
)
{
errno
=
EFAULT
;
return
-
1
;
}
// No options supported at present
errno
=
EINVAL
;
return
-
1
;
...
...
@@ -820,12 +780,6 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
return
usleep
(
timeout_
*
1000
);
#endif
}
if
(
!
items_
)
{
errno
=
EFAULT
;
return
-
1
;
}
zmq
::
clock_t
clock
;
uint64_t
now
=
0
;
uint64_t
end
=
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