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
495fb00b
Commit
495fb00b
authored
Feb 04, 2020
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: pointee types are unnecessarily non-const
Solution: add const where possible
parent
db8f4fba
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
67 additions
and
58 deletions
+67
-58
dbuffer.hpp
src/dbuffer.hpp
+1
-3
epoll.cpp
src/epoll.cpp
+2
-2
ip.cpp
src/ip.cpp
+1
-1
ip_resolver.cpp
src/ip_resolver.cpp
+1
-1
ipc_listener.cpp
src/ipc_listener.cpp
+2
-2
radio.cpp
src/radio.cpp
+1
-1
router.cpp
src/router.cpp
+2
-1
socket_base.cpp
src/socket_base.cpp
+3
-2
tipc_listener.cpp
src/tipc_listener.cpp
+2
-1
trie.cpp
src/trie.cpp
+2
-2
trie.hpp
src/trie.hpp
+1
-1
zmq.cpp
src/zmq.cpp
+4
-3
zmtp_engine.cpp
src/zmtp_engine.cpp
+2
-1
test_app_meta.cpp
tests/test_app_meta.cpp
+2
-2
test_base85.cpp
tests/test_base85.cpp
+5
-4
test_ctx_destroy.cpp
tests/test_ctx_destroy.cpp
+2
-2
test_disconnect_inproc.cpp
tests/test_disconnect_inproc.cpp
+2
-1
test_many_sockets.cpp
tests/test_many_sockets.cpp
+2
-4
test_proxy.cpp
tests/test_proxy.cpp
+1
-1
test_proxy_hwm.cpp
tests/test_proxy_hwm.cpp
+8
-6
test_radio_dish.cpp
tests/test_radio_dish.cpp
+2
-2
test_security_gssapi.cpp
tests/test_security_gssapi.cpp
+3
-2
test_shutdown_stress.cpp
tests/test_shutdown_stress.cpp
+1
-1
test_socket_null.cpp
tests/test_socket_null.cpp
+1
-2
test_stream_timeout.cpp
tests/test_stream_timeout.cpp
+3
-2
testutil_monitoring.cpp
tests/testutil_monitoring.cpp
+9
-6
testutil_security.cpp
tests/testutil_security.cpp
+2
-2
No files found.
src/dbuffer.hpp
View file @
495fb00b
...
...
@@ -72,9 +72,7 @@ template <> class dbuffer_t<msg_t>
void
write
(
const
msg_t
&
value_
)
{
msg_t
&
xvalue
=
const_cast
<
msg_t
&>
(
value_
);
zmq_assert
(
xvalue
.
check
());
zmq_assert
(
value_
.
check
());
*
_back
=
value_
;
zmq_assert
(
_back
->
check
());
...
...
src/epoll.cpp
View file @
495fb00b
...
...
@@ -189,8 +189,8 @@ void zmq::epoll_t::loop ()
}
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
poll_entry_t
*
pe
=
(
static_cast
<
poll_entry_t
*>
(
ev_buf
[
i
].
data
.
ptr
)
);
const
poll_entry_t
*
const
pe
=
static_cast
<
const
poll_entry_t
*>
(
ev_buf
[
i
].
data
.
ptr
);
if
(
pe
->
fd
==
retired_fd
)
continue
;
...
...
src/ip.cpp
View file @
495fb00b
...
...
@@ -859,7 +859,7 @@ int zmq::create_ipc_wildcard_address (std::string &path_, std::string &file_)
// the socket directory there.
const
char
**
tmp_env
=
tmp_env_vars
;
while
(
tmp_path
.
empty
()
&&
*
tmp_env
!=
0
)
{
c
har
*
tmpdir
=
getenv
(
*
tmp_env
);
c
onst
char
*
const
tmpdir
=
getenv
(
*
tmp_env
);
struct
stat
statbuf
;
// Confirm it is actually a directory before trying to use
...
...
src/ip_resolver.cpp
View file @
495fb00b
...
...
@@ -540,7 +540,7 @@ int zmq::ip_resolver_t::resolve_nic_name (ip_addr_t *ip_addr_, const char *nic_)
// Find the corresponding network interface.
bool
found
=
false
;
for
(
ifaddrs
*
ifp
=
ifa
;
ifp
!=
NULL
;
ifp
=
ifp
->
ifa_next
)
{
for
(
const
ifaddrs
*
ifp
=
ifa
;
ifp
!=
NULL
;
ifp
=
ifp
->
ifa_next
)
{
if
(
ifp
->
ifa_addr
==
NULL
)
continue
;
...
...
src/ipc_listener.cpp
View file @
495fb00b
...
...
@@ -248,8 +248,8 @@ bool zmq::ipc_listener_t::filter (fd_t sock_)
!=
options
.
ipc_pid_accept_filters
.
end
())
return
true
;
struct
passwd
*
pw
;
struct
group
*
gr
;
const
struct
passwd
*
pw
;
const
struct
group
*
gr
;
if
(
!
(
pw
=
getpwuid
(
cred
.
uid
)))
return
false
;
...
...
src/radio.cpp
View file @
495fb00b
...
...
@@ -218,7 +218,7 @@ int zmq::radio_session_t::push_msg (msg_t *msg_)
const
size_t
data_size
=
msg_
->
size
();
int
group_length
;
char
*
group
;
c
onst
c
har
*
group
;
msg_t
join_leave_msg
;
int
rc
;
...
...
src/router.cpp
View file @
495fb00b
...
...
@@ -487,7 +487,8 @@ bool zmq::router_t::identify_peer (pipe_t *pipe_, bool locally_initiated_)
// Try to remove an existing routing id entry to allow the new
// connection to take the routing id.
out_pipe_t
*
existing_outpipe
=
lookup_out_pipe
(
routing_id
);
const
out_pipe_t
*
const
existing_outpipe
=
lookup_out_pipe
(
routing_id
);
if
(
existing_outpipe
)
{
if
(
!
_handover
)
...
...
src/socket_base.cpp
View file @
495fb00b
...
...
@@ -981,8 +981,9 @@ int zmq::socket_base_t::connect (const char *endpoint_uri_)
LIBZMQ_DELETE
(
paddr
);
return
-
1
;
}
sockaddr_tipc
*
saddr
=
(
sockaddr_tipc
*
)
paddr
->
resolved
.
tipc_addr
->
addr
();
const
sockaddr_tipc
*
const
saddr
=
reinterpret_cast
<
const
sockaddr_tipc
*>
(
paddr
->
resolved
.
tipc_addr
->
addr
());
// Cannot connect to random Port Identity
if
(
saddr
->
addrtype
==
TIPC_ADDR_ID
&&
paddr
->
resolved
.
tipc_addr
->
is_random
())
{
...
...
src/tipc_listener.cpp
View file @
495fb00b
...
...
@@ -93,7 +93,8 @@ int zmq::tipc_listener_t::set_local_address (const char *addr_)
return
-
1
;
// Cannot bind non-random Port Identity
struct
sockaddr_tipc
*
a
=
(
sockaddr_tipc
*
)
_address
.
addr
();
const
sockaddr_tipc
*
const
a
=
reinterpret_cast
<
const
sockaddr_tipc
*>
(
_address
.
addr
());
if
(
!
_address
.
is_random
()
&&
a
->
addrtype
==
TIPC_ADDR_ID
)
{
errno
=
EINVAL
;
return
-
1
;
...
...
src/trie.cpp
View file @
495fb00b
...
...
@@ -236,11 +236,11 @@ bool zmq::trie_t::rm (unsigned char *prefix_, size_t size_)
return
ret
;
}
bool
zmq
::
trie_t
::
check
(
const
unsigned
char
*
data_
,
size_t
size_
)
bool
zmq
::
trie_t
::
check
(
const
unsigned
char
*
data_
,
size_t
size_
)
const
{
// This function is on critical path. It deliberately doesn't use
// recursion to get a bit better performance.
trie_t
*
current
=
this
;
const
trie_t
*
current
=
this
;
while
(
true
)
{
// We've found a corresponding subscription!
if
(
current
->
_refcnt
)
...
...
src/trie.hpp
View file @
495fb00b
...
...
@@ -52,7 +52,7 @@ class trie_t
bool
rm
(
unsigned
char
*
prefix_
,
size_t
size_
);
// Check whether particular key is in the trie.
bool
check
(
const
unsigned
char
*
data_
,
size_t
size_
);
bool
check
(
const
unsigned
char
*
data_
,
size_t
size_
)
const
;
// Apply the function supplied to each subscription in the trie.
void
apply
(
void
(
*
func_
)
(
unsigned
char
*
data_
,
size_t
size_
,
void
*
arg_
),
...
...
src/zmq.cpp
View file @
495fb00b
...
...
@@ -1135,8 +1135,8 @@ void *zmq_poller_new (void)
int
zmq_poller_destroy
(
void
**
poller_p_
)
{
if
(
poller_p_
)
{
zmq
::
socket_poller_t
*
const
poller
=
static_cast
<
zmq
::
socket_poller_t
*>
(
*
poller_p_
);
const
zmq
::
socket_poller_t
*
const
poller
=
static_cast
<
const
zmq
::
socket_poller_t
*>
(
*
poller_p_
);
if
(
poller
&&
poller
->
check_tag
())
{
delete
poller
;
*
poller_p_
=
NULL
;
...
...
@@ -1227,7 +1227,8 @@ int zmq_poller_modify (void *poller_, void *s_, short events_)
||
-
1
==
check_events
(
events_
))
return
-
1
;
zmq
::
socket_base_t
*
socket
=
static_cast
<
zmq
::
socket_base_t
*>
(
s_
);
const
zmq
::
socket_base_t
*
const
socket
=
static_cast
<
const
zmq
::
socket_base_t
*>
(
s_
);
return
(
static_cast
<
zmq
::
socket_poller_t
*>
(
poller_
))
->
modify
(
socket
,
events_
);
...
...
src/zmtp_engine.cpp
View file @
495fb00b
...
...
@@ -545,7 +545,8 @@ int zmq::zmtp_engine_t::process_command_message (msg_t *msg_)
if
(
unlikely
(
msg_
->
size
()
<
cmd_name_size
+
sizeof
(
cmd_name_size
)))
return
-
1
;
uint8_t
*
cmd_name
=
(
static_cast
<
uint8_t
*>
(
msg_
->
data
()))
+
1
;
const
uint8_t
*
const
cmd_name
=
static_cast
<
const
uint8_t
*>
(
msg_
->
data
())
+
1
;
if
(
cmd_name_size
==
ping_name_size
&&
memcmp
(
cmd_name
,
"PING"
,
cmd_name_size
)
==
0
)
msg_
->
set_flags
(
zmq
::
msg_t
::
ping
);
...
...
tests/test_app_meta.cpp
View file @
495fb00b
...
...
@@ -123,10 +123,10 @@ void test_app_meta_reqrep ()
TEST_ASSERT_EQUAL_STRING
(
"hello"
,
zmq_msg_gets
(
&
msg
,
"X-hello"
));
TEST_ASSERT_EQUAL_STRING
(
"primary"
,
zmq_msg_gets
(
&
msg
,
"X-connection"
));
c
har
*
bindata
=
const_cast
<
char
*>
(
zmq_msg_gets
(
&
msg
,
"X-bin"
)
);
c
onst
char
*
const
bindata
=
zmq_msg_gets
(
&
msg
,
"X-bin"
);
TEST_ASSERT_NOT_NULL
(
bindata
);
uint8_t
rawdata
[
4
];
void
*
ret
=
zmq_z85_decode
(
rawdata
,
bindata
);
const
uint8_t
*
const
ret
=
zmq_z85_decode
(
rawdata
,
bindata
);
TEST_ASSERT_NOT_NULL
(
ret
);
TEST_ASSERT_EQUAL_UINT8
(
0
,
rawdata
[
0
]);
TEST_ASSERT_EQUAL_UINT8
(
1
,
rawdata
[
1
]);
...
...
tests/test_base85.cpp
View file @
495fb00b
...
...
@@ -94,11 +94,12 @@ void test__zmq_z85_encode__zmq_z85_decode__roundtrip (
const
uint8_t
(
&
test_data_
)[
SIZE
])
{
char
test_data_z85
[
SIZE
*
5
/
4
+
1
];
c
har
*
res1
=
zmq_z85_encode
(
test_data_z85
,
test_data_
,
SIZE
);
c
onst
char
*
const
res1
=
zmq_z85_encode
(
test_data_z85
,
test_data_
,
SIZE
);
TEST_ASSERT_NOT_NULL
(
res1
);
uint8_t
test_data_decoded
[
SIZE
];
uint8_t
*
res2
=
zmq_z85_decode
(
test_data_decoded
,
test_data_z85
);
const
uint8_t
*
const
res2
=
zmq_z85_decode
(
test_data_decoded
,
test_data_z85
);
TEST_ASSERT_NOT_NULL
(
res2
);
TEST_ASSERT_EQUAL_UINT8_ARRAY
(
test_data_
,
test_data_decoded
,
SIZE
);
...
...
@@ -111,11 +112,11 @@ void test__zmq_z85_decode__zmq_z85_encode__roundtrip (
{
const
size_t
decoded_size
=
(
SIZE
-
1
)
*
4
/
5
;
uint8_t
test_data_decoded
[
decoded_size
];
uint8_t
*
res1
=
zmq_z85_decode
(
test_data_decoded
,
test_data_
);
const
uint8_t
*
const
res1
=
zmq_z85_decode
(
test_data_decoded
,
test_data_
);
TEST_ASSERT_NOT_NULL
(
res1
);
char
test_data_z85
[
SIZE
];
c
har
*
res2
=
c
onst
char
*
const
res2
=
zmq_z85_encode
(
test_data_z85
,
test_data_decoded
,
decoded_size
);
TEST_ASSERT_NOT_NULL
(
res2
);
...
...
tests/test_ctx_destroy.cpp
View file @
495fb00b
...
...
@@ -162,8 +162,8 @@ struct poller_test_data_t
void
run_poller
(
void
*
data_
)
{
struct
poller_test_data_t
*
poller_test_data
=
static_cast
<
struc
t
poller_test_data_t
*>
(
data_
);
const
poller_test_data_t
*
const
poller_test_data
=
static_cast
<
cons
t
poller_test_data_t
*>
(
data_
);
void
*
socket
=
zmq_socket
(
poller_test_data
->
ctx
,
poller_test_data
->
socket_type
);
...
...
tests/test_disconnect_inproc.cpp
View file @
495fb00b
...
...
@@ -68,7 +68,8 @@ void test_disconnect_inproc ()
zmq_msg_t
msg
;
zmq_msg_init
(
&
msg
);
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_msg_recv
(
&
msg
,
pub_socket
,
0
));
char
*
buffer
=
static_cast
<
char
*>
(
zmq_msg_data
(
&
msg
));
const
char
*
const
buffer
=
static_cast
<
const
char
*>
(
zmq_msg_data
(
&
msg
));
if
(
buffer
[
0
]
==
0
)
{
TEST_ASSERT_TRUE
(
isSubscribed
);
...
...
tests/test_many_sockets.cpp
View file @
495fb00b
...
...
@@ -56,8 +56,7 @@ void test_system_max ()
// System is out of resources, further calls to zmq_socket should return NULL
for
(
unsigned
int
i
=
0
;
i
<
10
;
++
i
)
{
void
*
socket
=
zmq_socket
(
get_test_context
(),
ZMQ_PAIR
);
TEST_ASSERT_NULL
(
socket
);
TEST_ASSERT_NULL
(
zmq_socket
(
get_test_context
(),
ZMQ_PAIR
));
}
// Clean up.
for
(
unsigned
int
i
=
0
;
i
<
sockets
.
size
();
++
i
)
...
...
@@ -80,8 +79,7 @@ void test_zmq_default_max ()
// Further calls to zmq_socket should return NULL
for
(
unsigned
int
i
=
0
;
i
<
10
;
++
i
)
{
void
*
socket
=
zmq_socket
(
get_test_context
(),
ZMQ_PAIR
);
TEST_ASSERT_NULL
(
socket
);
TEST_ASSERT_NULL
(
zmq_socket
(
get_test_context
(),
ZMQ_PAIR
));
}
// Clean up
...
...
tests/test_proxy.cpp
View file @
495fb00b
...
...
@@ -80,7 +80,7 @@ void *g_workers_pkts_out = NULL;
static
void
client_task
(
void
*
db_
)
{
struct
thread_data
*
databag
=
static_cast
<
struc
t
thread_data
*>
(
db_
);
const
thread_data
*
const
databag
=
static_cast
<
cons
t
thread_data
*>
(
db_
);
// Endpoint socket gets random port to avoid test failing when port in use
void
*
endpoint
=
zmq_socket
(
get_test_context
(),
ZMQ_PAIR
);
TEST_ASSERT_NOT_NULL
(
endpoint
);
...
...
tests/test_proxy_hwm.cpp
View file @
495fb00b
...
...
@@ -83,7 +83,8 @@ static void lower_hwm (void *skt_)
static
void
publisher_thread_main
(
void
*
pvoid_
)
{
proxy_hwm_cfg_t
*
cfg
=
static_cast
<
proxy_hwm_cfg_t
*>
(
pvoid_
);
const
proxy_hwm_cfg_t
*
const
cfg
=
static_cast
<
const
proxy_hwm_cfg_t
*>
(
pvoid_
);
void
*
pubsocket
=
zmq_socket
(
cfg
->
context
,
ZMQ_XPUB
);
assert
(
pubsocket
);
...
...
@@ -138,7 +139,8 @@ static void publisher_thread_main (void *pvoid_)
static
void
subscriber_thread_main
(
void
*
pvoid_
)
{
proxy_hwm_cfg_t
*
cfg
=
static_cast
<
proxy_hwm_cfg_t
*>
(
pvoid_
);
const
proxy_hwm_cfg_t
*
const
cfg
=
static_cast
<
const
proxy_hwm_cfg_t
*>
(
pvoid_
);
void
*
subsocket
=
zmq_socket
(
cfg
->
context
,
ZMQ_SUB
);
assert
(
subsocket
);
...
...
@@ -266,8 +268,8 @@ bool check_proxy_stats (void *control_proxy_)
static
void
proxy_stats_asker_thread_main
(
void
*
pvoid_
)
{
proxy_hwm_cfg_t
*
cfg
=
static_cast
<
proxy_hwm_cfg_t
*>
(
pvoid_
);
const
proxy_hwm_cfg_t
*
const
cfg
=
static_cast
<
const
proxy_hwm_cfg_t
*>
(
pvoid_
);
// CONTROL REQ
...
...
@@ -318,10 +320,10 @@ static void proxy_stats_asker_thread_main (void *pvoid_)
static
void
proxy_thread_main
(
void
*
pvoid_
)
{
proxy_hwm_cfg_t
*
cfg
=
static_cast
<
proxy_hwm_cfg_t
*>
(
pvoid_
);
const
proxy_hwm_cfg_t
*
const
cfg
=
static_cast
<
const
proxy_hwm_cfg_t
*>
(
pvoid_
);
int
rc
;
// FRONTEND SUB
void
*
frontend_xsub
=
zmq_socket
(
...
...
tests/test_radio_dish.cpp
View file @
495fb00b
...
...
@@ -350,7 +350,7 @@ static bool is_multicast_available (int ipv6_)
if
(
ipv6_
)
{
struct
ipv6_mreq
mreq
;
struct
sockaddr_in6
*
mcast_ipv6
=
&
mcast
.
ipv6
;
const
sockaddr_in6
*
const
mcast_ipv6
=
&
mcast
.
ipv6
;
mreq
.
ipv6mr_multiaddr
=
mcast_ipv6
->
sin6_addr
;
mreq
.
ipv6mr_interface
=
0
;
...
...
@@ -369,7 +369,7 @@ static bool is_multicast_available (int ipv6_)
}
}
else
{
struct
ip_mreq
mreq
;
struct
sockaddr_in
*
mcast_ipv4
=
&
mcast
.
ipv4
;
const
sockaddr_in
*
const
mcast_ipv4
=
&
mcast
.
ipv4
;
mreq
.
imr_multiaddr
=
mcast_ipv4
->
sin_addr
;
mreq
.
imr_interface
.
s_addr
=
htonl
(
INADDR_ANY
);
...
...
tests/test_security_gssapi.cpp
View file @
495fb00b
...
...
@@ -203,8 +203,9 @@ static int get_monitor_event (void *monitor_, int *value_, char **address_)
TEST_ASSERT_FALSE
(
zmq_msg_more
(
&
msg
));
if
(
address_
)
{
uint8_t
*
data
=
static_cast
<
uint8_t
*>
(
zmq_msg_data
(
&
msg
));
size_t
size
=
zmq_msg_size
(
&
msg
);
const
uint8_t
*
const
data
=
static_cast
<
const
uint8_t
*>
(
zmq_msg_data
(
&
msg
));
const
size_t
size
=
zmq_msg_size
(
&
msg
);
*
address_
=
static_cast
<
char
*>
(
malloc
(
size
+
1
));
memcpy
(
*
address_
,
data
,
size
);
*
address_
[
size
]
=
0
;
...
...
tests/test_shutdown_stress.cpp
View file @
495fb00b
...
...
@@ -48,7 +48,7 @@ struct thread_data
extern
"C"
{
static
void
worker
(
void
*
data_
)
{
struct
thread_data
*
tdata
=
(
struct
thread_data
*
)
data_
;
const
thread_data
*
const
tdata
=
static_cast
<
const
thread_data
*>
(
data_
)
;
void
*
socket
=
zmq_socket
(
get_test_context
(),
ZMQ_SUB
);
...
...
tests/test_socket_null.cpp
View file @
495fb00b
...
...
@@ -42,8 +42,7 @@ void tearDown ()
// tests all socket-related functions with a NULL socket argument
void
test_zmq_socket_null_context
()
{
void
*
s
=
zmq_socket
(
NULL
,
ZMQ_PAIR
);
TEST_ASSERT_NULL
(
s
);
TEST_ASSERT_NULL
(
zmq_socket
(
NULL
,
ZMQ_PAIR
));
TEST_ASSERT_EQUAL_INT
(
EFAULT
,
errno
);
// TODO use EINVAL instead?
}
...
...
tests/test_stream_timeout.cpp
View file @
495fb00b
...
...
@@ -60,8 +60,9 @@ static int get_monitor_event (void *monitor_, int *value_, char **address_)
TEST_ASSERT_TRUE
(
!
zmq_msg_more
(
&
msg
));
if
(
address_
)
{
uint8_t
*
data
=
static_cast
<
uint8_t
*>
(
zmq_msg_data
(
&
msg
));
size_t
size
=
zmq_msg_size
(
&
msg
);
const
uint8_t
*
const
data
=
static_cast
<
const
uint8_t
*>
(
zmq_msg_data
(
&
msg
));
const
size_t
size
=
zmq_msg_size
(
&
msg
);
*
address_
=
static_cast
<
char
*>
(
malloc
(
size
+
1
));
memcpy
(
*
address_
,
data
,
size
);
*
address_
[
size
]
=
0
;
...
...
tests/testutil_monitoring.cpp
View file @
495fb00b
...
...
@@ -61,8 +61,9 @@ static int get_monitor_event_internal (void *monitor_,
TEST_ASSERT_FALSE
(
zmq_msg_more
(
&
msg
));
if
(
address_
)
{
uint8_t
*
data
=
static_cast
<
uint8_t
*>
(
zmq_msg_data
(
&
msg
));
size_t
size
=
zmq_msg_size
(
&
msg
);
const
uint8_t
*
const
data
=
static_cast
<
const
uint8_t
*>
(
zmq_msg_data
(
&
msg
));
const
size_t
size
=
zmq_msg_size
(
&
msg
);
*
address_
=
static_cast
<
char
*>
(
malloc
(
size
+
1
));
memcpy
(
*
address_
,
data
,
size
);
(
*
address_
)[
size
]
=
0
;
...
...
@@ -246,8 +247,9 @@ static int64_t get_monitor_event_internal_v2 (void *monitor_,
TEST_ASSERT_TRUE
(
zmq_msg_more
(
&
msg
));
if
(
local_address_
)
{
uint8_t
*
data
=
static_cast
<
uint8_t
*>
(
zmq_msg_data
(
&
msg
));
size_t
size
=
zmq_msg_size
(
&
msg
);
const
uint8_t
*
const
data
=
static_cast
<
const
uint8_t
*>
(
zmq_msg_data
(
&
msg
));
const
size_t
size
=
zmq_msg_size
(
&
msg
);
*
local_address_
=
static_cast
<
char
*>
(
malloc
(
size
+
1
));
memcpy
(
*
local_address_
,
data
,
size
);
(
*
local_address_
)[
size
]
=
0
;
...
...
@@ -260,8 +262,9 @@ static int64_t get_monitor_event_internal_v2 (void *monitor_,
TEST_ASSERT_TRUE
(
!
zmq_msg_more
(
&
msg
));
if
(
remote_address_
)
{
uint8_t
*
data
=
static_cast
<
uint8_t
*>
(
zmq_msg_data
(
&
msg
));
size_t
size
=
zmq_msg_size
(
&
msg
);
const
uint8_t
*
data
=
static_cast
<
const
uint8_t
*>
(
zmq_msg_data
(
&
msg
));
const
size_t
size
=
zmq_msg_size
(
&
msg
);
*
remote_address_
=
static_cast
<
char
*>
(
malloc
(
size
+
1
));
memcpy
(
*
remote_address_
,
data
,
size
);
(
*
remote_address_
)[
size
]
=
0
;
...
...
tests/testutil_security.cpp
View file @
495fb00b
...
...
@@ -109,8 +109,8 @@ void socket_config_curve_server (void *server_, void *server_secret_)
void
socket_config_curve_client
(
void
*
client_
,
void
*
data_
)
{
c
urve_client_data_t
*
curve_client_data
=
static_cast
<
curve_client_data_t
*>
(
data_
);
c
onst
curve_client_data_t
*
const
curve_client_data
=
static_cast
<
c
onst
c
urve_client_data_t
*>
(
data_
);
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_setsockopt
(
client_
,
ZMQ_CURVE_SERVERKEY
,
curve_client_data
->
server_public
,
41
));
...
...
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