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
b2d0ab18
Commit
b2d0ab18
authored
Apr 25, 2016
by
hitstergtd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: trailing whitespace in code
Solution: fix them
parent
11311f97
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
125 additions
and
125 deletions
+125
-125
client.hpp
src/client.hpp
+3
-3
dist.cpp
src/dist.cpp
+1
-1
encoder.hpp
src/encoder.hpp
+1
-1
err.cpp
src/err.cpp
+51
-51
err.hpp
src/err.hpp
+1
-1
i_poll_events.hpp
src/i_poll_events.hpp
+9
-9
ipc_connecter.cpp
src/ipc_connecter.cpp
+3
-3
lb.cpp
src/lb.cpp
+1
-1
mailbox_safe.cpp
src/mailbox_safe.cpp
+2
-2
mailbox_safe.hpp
src/mailbox_safe.hpp
+2
-2
object.cpp
src/object.cpp
+2
-2
own.cpp
src/own.cpp
+1
-1
pgm_receiver.cpp
src/pgm_receiver.cpp
+1
-1
pgm_receiver.hpp
src/pgm_receiver.hpp
+1
-1
pgm_sender.hpp
src/pgm_sender.hpp
+1
-1
pgm_socket.hpp
src/pgm_socket.hpp
+6
-6
pipe.hpp
src/pipe.hpp
+1
-1
router.cpp
src/router.cpp
+1
-1
router.hpp
src/router.hpp
+1
-1
select.cpp
src/select.cpp
+3
-3
server.hpp
src/server.hpp
+4
-4
socket_poller.hpp
src/socket_poller.hpp
+6
-6
stream.hpp
src/stream.hpp
+1
-1
tcp.hpp
src/tcp.hpp
+1
-1
thread.hpp
src/thread.hpp
+1
-1
tweetnacl.c
src/tweetnacl.c
+4
-4
xsub.cpp
src/xsub.cpp
+3
-3
zmq_utils.cpp
src/zmq_utils.cpp
+13
-13
No files found.
src/client.hpp
View file @
b2d0ab18
...
...
@@ -55,7 +55,7 @@ namespace zmq
protected
:
// Overrides of functions from socket_base_t.
void
xattach_pipe
(
zmq
::
pipe_t
*
pipe_
,
bool
subscribe_to_all_
);
void
xattach_pipe
(
zmq
::
pipe_t
*
pipe_
,
bool
subscribe_to_all_
);
int
xsend
(
zmq
::
msg_t
*
msg_
);
int
xrecv
(
zmq
::
msg_t
*
msg_
);
bool
xhas_in
();
...
...
@@ -64,14 +64,14 @@ namespace zmq
void
xread_activated
(
zmq
::
pipe_t
*
pipe_
);
void
xwrite_activated
(
zmq
::
pipe_t
*
pipe_
);
void
xpipe_terminated
(
zmq
::
pipe_t
*
pipe_
);
private
:
// Messages are fair-queued from inbound pipes. And load-balanced to
// the outbound pipes.
fq_t
fq
;
lb_t
lb
;
client_t
(
const
client_t
&
);
const
client_t
&
operator
=
(
const
client_t
&
);
};
...
...
src/dist.cpp
View file @
b2d0ab18
...
...
@@ -77,7 +77,7 @@ void zmq::dist_t::match (pipe_t *pipe_)
// Mark the pipe as matching.
pipes
.
swap
(
pipes
.
index
(
pipe_
),
matching
);
matching
++
;
matching
++
;
}
void
zmq
::
dist_t
::
reverse_match
()
...
...
src/encoder.hpp
View file @
b2d0ab18
...
...
@@ -74,7 +74,7 @@ namespace zmq
{
free
(
buf
);
}
// The function returns a batch of binary data. The data
// are filled to a supplied buffer. If no buffer is supplied (data_
// points to NULL) decoder object will provide buffer of its own.
...
...
src/err.cpp
View file @
b2d0ab18
...
...
@@ -104,108 +104,108 @@ const char *zmq::wsa_error_no (int no_)
// automatically (wsaError->HRESULT->string?).
return
(
no_
==
WSABASEERR
)
?
"No Error"
:
"No Error"
:
(
no_
==
WSAEINTR
)
?
"Interrupted system call"
:
"Interrupted system call"
:
(
no_
==
WSAEBADF
)
?
"Bad file number"
:
"Bad file number"
:
(
no_
==
WSAEACCES
)
?
"Permission denied"
:
"Permission denied"
:
(
no_
==
WSAEFAULT
)
?
"Bad address"
:
"Bad address"
:
(
no_
==
WSAEINVAL
)
?
"Invalid argument"
:
"Invalid argument"
:
(
no_
==
WSAEMFILE
)
?
"Too many open files"
:
"Too many open files"
:
(
no_
==
WSAEWOULDBLOCK
)
?
"Operation would block"
:
"Operation would block"
:
(
no_
==
WSAEINPROGRESS
)
?
"Operation now in progress"
:
"Operation now in progress"
:
(
no_
==
WSAEALREADY
)
?
"Operation already in progress"
:
"Operation already in progress"
:
(
no_
==
WSAENOTSOCK
)
?
"Socket operation on non-socket"
:
"Socket operation on non-socket"
:
(
no_
==
WSAEDESTADDRREQ
)
?
"Destination address required"
:
"Destination address required"
:
(
no_
==
WSAEMSGSIZE
)
?
"Message too long"
:
"Message too long"
:
(
no_
==
WSAEPROTOTYPE
)
?
"Protocol wrong type for socket"
:
"Protocol wrong type for socket"
:
(
no_
==
WSAENOPROTOOPT
)
?
"Bad protocol option"
:
"Bad protocol option"
:
(
no_
==
WSAEPROTONOSUPPORT
)
?
"Protocol not supported"
:
"Protocol not supported"
:
(
no_
==
WSAESOCKTNOSUPPORT
)
?
"Socket type not supported"
:
"Socket type not supported"
:
(
no_
==
WSAEOPNOTSUPP
)
?
"Operation not supported on socket"
:
"Operation not supported on socket"
:
(
no_
==
WSAEPFNOSUPPORT
)
?
"Protocol family not supported"
:
"Protocol family not supported"
:
(
no_
==
WSAEAFNOSUPPORT
)
?
"Address family not supported by protocol family"
:
"Address family not supported by protocol family"
:
(
no_
==
WSAEADDRINUSE
)
?
"Address already in use"
:
"Address already in use"
:
(
no_
==
WSAEADDRNOTAVAIL
)
?
"Can't assign requested address"
:
"Can't assign requested address"
:
(
no_
==
WSAENETDOWN
)
?
"Network is down"
:
"Network is down"
:
(
no_
==
WSAENETUNREACH
)
?
"Network is unreachable"
:
"Network is unreachable"
:
(
no_
==
WSAENETRESET
)
?
"Net dropped connection or reset"
:
"Net dropped connection or reset"
:
(
no_
==
WSAECONNABORTED
)
?
"Software caused connection abort"
:
"Software caused connection abort"
:
(
no_
==
WSAECONNRESET
)
?
"Connection reset by peer"
:
"Connection reset by peer"
:
(
no_
==
WSAENOBUFS
)
?
"No buffer space available"
:
"No buffer space available"
:
(
no_
==
WSAEISCONN
)
?
"Socket is already connected"
:
"Socket is already connected"
:
(
no_
==
WSAENOTCONN
)
?
"Socket is not connected"
:
"Socket is not connected"
:
(
no_
==
WSAESHUTDOWN
)
?
"Can't send after socket shutdown"
:
"Can't send after socket shutdown"
:
(
no_
==
WSAETOOMANYREFS
)
?
"Too many references can't splice"
:
"Too many references can't splice"
:
(
no_
==
WSAETIMEDOUT
)
?
"Connection timed out"
:
"Connection timed out"
:
(
no_
==
WSAECONNREFUSED
)
?
"Connection refused"
:
"Connection refused"
:
(
no_
==
WSAELOOP
)
?
"Too many levels of symbolic links"
:
"Too many levels of symbolic links"
:
(
no_
==
WSAENAMETOOLONG
)
?
"File name too long"
:
"File name too long"
:
(
no_
==
WSAEHOSTDOWN
)
?
"Host is down"
:
"Host is down"
:
(
no_
==
WSAEHOSTUNREACH
)
?
"No Route to Host"
:
"No Route to Host"
:
(
no_
==
WSAENOTEMPTY
)
?
"Directory not empty"
:
"Directory not empty"
:
(
no_
==
WSAEPROCLIM
)
?
"Too many processes"
:
"Too many processes"
:
(
no_
==
WSAEUSERS
)
?
"Too many users"
:
"Too many users"
:
(
no_
==
WSAEDQUOT
)
?
"Disc Quota Exceeded"
:
"Disc Quota Exceeded"
:
(
no_
==
WSAESTALE
)
?
"Stale NFS file handle"
:
"Stale NFS file handle"
:
(
no_
==
WSAEREMOTE
)
?
"Too many levels of remote in path"
:
"Too many levels of remote in path"
:
(
no_
==
WSASYSNOTREADY
)
?
"Network SubSystem is unavailable"
:
"Network SubSystem is unavailable"
:
(
no_
==
WSAVERNOTSUPPORTED
)
?
"WINSOCK DLL Version out of range"
:
"WINSOCK DLL Version out of range"
:
(
no_
==
WSANOTINITIALISED
)
?
"Successful WSASTARTUP not yet performed"
:
"Successful WSASTARTUP not yet performed"
:
(
no_
==
WSAHOST_NOT_FOUND
)
?
"Host not found"
:
"Host not found"
:
(
no_
==
WSATRY_AGAIN
)
?
"Non-Authoritative Host not found"
:
"Non-Authoritative Host not found"
:
(
no_
==
WSANO_RECOVERY
)
?
"Non-Recoverable errors: FORMERR REFUSED NOTIMP"
:
"Non-Recoverable errors: FORMERR REFUSED NOTIMP"
:
(
no_
==
WSANO_DATA
)
?
"Valid name no data record of requested"
:
"error not defined"
;
"error not defined"
;
}
void
zmq
::
win_error
(
char
*
buffer_
,
size_t
buffer_size_
)
...
...
src/err.hpp
View file @
b2d0ab18
...
...
@@ -122,7 +122,7 @@ namespace zmq
__FILE__, __LINE__);\
zmq::zmq_abort (#x);\
}\
} while (false)
} while (false)
// Provides convenient way to check for errno-style errors.
#define errno_assert(x) \
...
...
src/i_poll_events.hpp
View file @
b2d0ab18
...
...
@@ -26,30 +26,30 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __ZMQ_I_POLL_EVENTS_HPP_INCLUDED__
#define __ZMQ_I_POLL_EVENTS_HPP_INCLUDED__
namespace
zmq
{
// Virtual interface to be exposed by object that want to be notified
// about events on file descriptors.
struct
i_poll_events
{
virtual
~
i_poll_events
()
{}
// Called by I/O thread when file descriptor is ready for reading.
virtual
void
in_event
()
=
0
;
// Called by I/O thread when file descriptor is ready for writing.
virtual
void
out_event
()
=
0
;
// Called when timer expires.
virtual
void
timer_event
(
int
id_
)
=
0
;
};
}
#endif
src/ipc_connecter.cpp
View file @
b2d0ab18
...
...
@@ -188,14 +188,14 @@ int zmq::ipc_connecter_t::get_new_reconnect_ivl ()
// Only change the current reconnect interval if the maximum reconnect
// interval was set and if it's larger than the reconnect interval.
if
(
options
.
reconnect_ivl_max
>
0
&&
if
(
options
.
reconnect_ivl_max
>
0
&&
options
.
reconnect_ivl_max
>
options
.
reconnect_ivl
)
{
// Calculate the next interval
current_reconnect_ivl
=
current_reconnect_ivl
*
2
;
if
(
current_reconnect_ivl
>=
options
.
reconnect_ivl_max
)
{
current_reconnect_ivl
=
options
.
reconnect_ivl_max
;
}
}
}
return
this_interval
;
}
...
...
@@ -220,7 +220,7 @@ int zmq::ipc_connecter_t::open ()
// Connect was successful immediately.
if
(
rc
==
0
)
return
0
;
// Translate other error codes indicating asynchronous connect has been
// launched to a uniform EINPROGRESS.
if
(
rc
==
-
1
&&
errno
==
EINTR
)
{
...
...
src/lb.cpp
View file @
b2d0ab18
...
...
@@ -110,7 +110,7 @@ int zmq::lb_t::sendpipe (msg_t *msg_, pipe_t **pipe_)
// If send fails for multi-part msg rollback other
// parts sent earlier and return EAGAIN.
// Application should handle this as suitable
// Application should handle this as suitable
if
(
more
)
{
pipes
[
current
]
->
rollback
();
...
...
src/mailbox_safe.cpp
View file @
b2d0ab18
...
...
@@ -64,7 +64,7 @@ void zmq::mailbox_safe_t::remove_signaler(signaler_t* signaler)
// TODO: make a copy of array and signal outside the lock
for
(;
it
!=
signalers
.
end
();
++
it
){
if
(
*
it
==
signaler
)
break
;
break
;
}
if
(
it
!=
signalers
.
end
())
...
...
@@ -92,7 +92,7 @@ int zmq::mailbox_safe_t::recv (command_t *cmd_, int timeout_)
// Try to get the command straight away.
if
(
cpipe
.
read
(
cmd_
))
return
0
;
// Wait for signal from the command sender.
int
rc
=
cond_var
.
wait
(
sync
,
timeout_
);
if
(
rc
==
-
1
)
{
...
...
src/mailbox_safe.hpp
View file @
b2d0ab18
...
...
@@ -64,8 +64,8 @@ namespace zmq
// close the file descriptors in the signaller. This is used in a forked
// child process to close the file descriptors so that they do not interfere
// with the context in the parent process.
void
forked
()
{
void
forked
()
{
// TODO: call fork on the condition variable
}
#endif
...
...
src/object.cpp
View file @
b2d0ab18
...
...
@@ -121,7 +121,7 @@ void zmq::object_t::process_command (command_t &cmd_)
case
command_t
:
:
term_req
:
process_term_req
(
cmd_
.
args
.
term_req
.
object
);
break
;
case
command_t
:
:
term
:
process_term
(
cmd_
.
args
.
term
.
linger
);
break
;
...
...
@@ -194,7 +194,7 @@ zmq::io_thread_t *zmq::object_t::choose_io_thread (uint64_t affinity_)
void
zmq
::
object_t
::
send_stop
()
{
// 'stop' command goes always from administrative thread to
// the current object.
// the current object.
command_t
cmd
;
cmd
.
destination
=
this
;
cmd
.
type
=
command_t
::
stop
;
...
...
src/own.cpp
View file @
b2d0ab18
...
...
@@ -183,7 +183,7 @@ void zmq::own_t::unregister_term_ack ()
term_acks
--
;
// This may be a last ack we are waiting for before termination...
check_term_acks
();
check_term_acks
();
}
void
zmq
::
own_t
::
process_term_ack
()
...
...
src/pgm_receiver.cpp
View file @
b2d0ab18
...
...
@@ -46,7 +46,7 @@
#include "wire.hpp"
#include "err.hpp"
zmq
::
pgm_receiver_t
::
pgm_receiver_t
(
class
io_thread_t
*
parent_
,
zmq
::
pgm_receiver_t
::
pgm_receiver_t
(
class
io_thread_t
*
parent_
,
const
options_t
&
options_
)
:
io_object_t
(
parent_
),
has_rx_timer
(
false
),
...
...
src/pgm_receiver.hpp
View file @
b2d0ab18
...
...
@@ -55,7 +55,7 @@ namespace zmq
class
pgm_receiver_t
:
public
io_object_t
,
public
i_engine
{
public
:
pgm_receiver_t
(
zmq
::
io_thread_t
*
parent_
,
const
options_t
&
options_
);
...
...
src/pgm_sender.hpp
View file @
b2d0ab18
...
...
@@ -111,7 +111,7 @@ namespace zmq
// Output buffer from pgm_socket.
unsigned
char
*
out_buffer
;
// Output buffer size.
size_t
out_buffer_size
;
...
...
src/pgm_socket.hpp
View file @
b2d0ab18
...
...
@@ -67,11 +67,11 @@ namespace zmq
// Resolve PGM socket address.
static
int
init_address
(
const
char
*
network_
,
struct
pgm_addrinfo_t
**
addr
,
uint16_t
*
port_number
);
// Get receiver fds and store them into user allocated memory.
void
get_receiver_fds
(
fd_t
*
receive_fd_
,
fd_t
*
waiting_pipe_fd_
);
// Get sender and receiver fds and store it to user allocated
// Get sender and receiver fds and store it to user allocated
// memory. Receive fd is used to process NAKs from peers.
void
get_sender_fds
(
fd_t
*
send_fd_
,
fd_t
*
receive_fd_
,
fd_t
*
rdata_notify_fd_
,
fd_t
*
pending_notify_fd_
);
...
...
@@ -88,7 +88,7 @@ namespace zmq
long
get_rx_timeout
();
long
get_tx_timeout
();
// POLLIN on sender side should mean NAK or SPMR receiving.
// POLLIN on sender side should mean NAK or SPMR receiving.
// process_upstream function is used to handle such a situation.
void
process_upstream
();
...
...
@@ -96,7 +96,7 @@ namespace zmq
// Compute size of the buffer based on rate and recovery interval.
int
compute_sqns
(
int
tpdu_
);
// OpenPGM transport.
pgm_sock_t
*
sock
;
...
...
@@ -104,7 +104,7 @@ namespace zmq
// Associated socket options.
options_t
options
;
// true when pgm_socket should create receiving side.
bool
receiver
;
...
...
@@ -120,7 +120,7 @@ namespace zmq
// How many bytes were processed from last pgm socket read.
size_t
nbytes_processed
;
// How many messages from pgm_msgv were already sent up.
size_t
pgm_msgv_processed
;
};
...
...
src/pipe.hpp
View file @
b2d0ab18
...
...
@@ -84,7 +84,7 @@ namespace zmq
// Specifies the object to send events to.
void
set_event_sink
(
i_pipe_events
*
sink_
);
// Pipe endpoint can store an routing ID to be used by its clients.
// Pipe endpoint can store an routing ID to be used by its clients.
void
set_routing_id
(
uint32_t
routing_id_
);
uint32_t
get_routing_id
();
...
...
src/router.cpp
View file @
b2d0ab18
...
...
@@ -299,7 +299,7 @@ int zmq::router_t::xrecv (msg_t *msg_)
prefetched
=
false
;
}
more_in
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
if
(
!
more_in
)
{
if
(
terminate_current_in
)
{
current_in
->
terminate
(
true
);
...
...
src/router.hpp
View file @
b2d0ab18
...
...
@@ -124,7 +124,7 @@ namespace zmq
// algorithm. This value is the next ID to use (if not used already).
uint32_t
next_rid
;
// If true, report EAGAIN to the caller instead of silently dropping
// If true, report EAGAIN to the caller instead of silently dropping
// the message targeting an unknown peer.
bool
mandatory
;
bool
raw_socket
;
...
...
src/select.cpp
View file @
b2d0ab18
...
...
@@ -441,7 +441,7 @@ u_short zmq::select_t::get_fd_family (fd_t fd_)
int
type
;
int
type_length
=
sizeof
(
int
);
int
rc
=
getsockopt
(
fd_
,
SOL_SOCKET
,
SO_TYPE
,
(
char
*
)
&
type
,
&
type_length
);
if
(
rc
==
0
)
{
...
...
@@ -455,9 +455,9 @@ u_short zmq::select_t::get_fd_family (fd_t fd_)
if
(
rc
!=
SOCKET_ERROR
)
return
addr
.
ss_family
==
AF_INET6
?
AF_INET
:
addr
.
ss_family
;
}
}
}
return
AF_UNSPEC
;
return
AF_UNSPEC
;
}
zmq
::
select_t
::
family_entry_t
::
family_entry_t
()
:
...
...
src/server.hpp
View file @
b2d0ab18
...
...
@@ -55,7 +55,7 @@ namespace zmq
~
server_t
();
// Overrides of functions from socket_base_t.
void
xattach_pipe
(
zmq
::
pipe_t
*
pipe_
,
bool
subscribe_to_all_
);
void
xattach_pipe
(
zmq
::
pipe_t
*
pipe_
,
bool
subscribe_to_all_
);
int
xsend
(
zmq
::
msg_t
*
msg_
);
int
xrecv
(
zmq
::
msg_t
*
msg_
);
bool
xhas_in
();
...
...
@@ -72,7 +72,7 @@ namespace zmq
// Fair queueing object for inbound pipes.
fq_t
fq
;
struct
outpipe_t
{
zmq
::
pipe_t
*
pipe
;
...
...
@@ -82,11 +82,11 @@ namespace zmq
// Outbound pipes indexed by the peer IDs.
typedef
std
::
map
<
uint32_t
,
outpipe_t
>
outpipes_t
;
outpipes_t
outpipes
;
// Routing IDs are generated. It's a simple increment and wrap-over
// algorithm. This value is the next ID to use (if not used already).
uint32_t
next_rid
;
server_t
(
const
server_t
&
);
const
server_t
&
operator
=
(
const
server_t
&
);
};
...
...
src/socket_poller.hpp
View file @
b2d0ab18
...
...
@@ -61,7 +61,7 @@ namespace zmq
{
socket_base_t
*
socket
;
fd_t
fd
;
void
*
user_data
;
void
*
user_data
;
short
events
;
}
event_t
;
...
...
@@ -79,7 +79,7 @@ namespace zmq
bool
check_tag
();
private
:
int
rebuild
();
int
rebuild
();
// Used to check whether the object is a socket_poller.
uint32_t
tag
;
...
...
@@ -90,7 +90,7 @@ namespace zmq
typedef
struct
item_t
{
socket_base_t
*
socket
;
fd_t
fd
;
void
*
user_data
;
void
*
user_data
;
short
events
;
#if defined ZMQ_POLL_BASED_ON_POLL
int
pollfd_index
;
...
...
@@ -106,10 +106,10 @@ namespace zmq
// Should the signaler be used for the thread safe polling?
bool
use_signaler
;
// Size of the pollset
int
poll_size
;
#if defined ZMQ_POLL_BASED_ON_POLL
pollfd
*
pollfds
;
#elif defined ZMQ_POLL_BASED_ON_SELECT
...
...
@@ -118,7 +118,7 @@ namespace zmq
fd_set
pollset_err
;
zmq
::
fd_t
maxfd
;
#endif
socket_poller_t
(
const
socket_poller_t
&
);
const
socket_poller_t
&
operator
=
(
const
socket_poller_t
&
);
};
...
...
src/stream.hpp
View file @
b2d0ab18
...
...
@@ -57,7 +57,7 @@ namespace zmq
void
xread_activated
(
zmq
::
pipe_t
*
pipe_
);
void
xwrite_activated
(
zmq
::
pipe_t
*
pipe_
);
void
xpipe_terminated
(
zmq
::
pipe_t
*
pipe_
);
int
xsetsockopt
(
int
option_
,
const
void
*
optval_
,
size_t
optvallen_
);
int
xsetsockopt
(
int
option_
,
const
void
*
optval_
,
size_t
optvallen_
);
private
:
// Generate peer's id and update lookup map
void
identify_peer
(
pipe_t
*
pipe_
);
...
...
src/tcp.hpp
View file @
b2d0ab18
...
...
@@ -62,4 +62,4 @@ namespace zmq
}
#endif
#endif
src/thread.hpp
View file @
b2d0ab18
...
...
@@ -75,7 +75,7 @@ namespace zmq
// they would not be accessible from the main C routine of the thread.
thread_fn
*
tfn
;
void
*
arg
;
private
:
#ifdef ZMQ_HAVE_WINDOWS
...
...
src/tweetnacl.c
View file @
b2d0ab18
...
...
@@ -479,7 +479,7 @@ int crypto_scalarmult(u8 *q,const u8 *n,const u8 *p)
}
int
crypto_scalarmult_base
(
u8
*
q
,
const
u8
*
n
)
{
{
return
crypto_scalarmult
(
q
,
n
,
_9
);
}
...
...
@@ -528,7 +528,7 @@ static u64 Sigma1(u64 x) { return R(x,14) ^ R(x,18) ^ R(x,41); }
static
u64
sigma0
(
u64
x
)
{
return
R
(
x
,
1
)
^
R
(
x
,
8
)
^
(
x
>>
7
);
}
static
u64
sigma1
(
u64
x
)
{
return
R
(
x
,
19
)
^
R
(
x
,
61
)
^
(
x
>>
6
);
}
static
const
u64
K
[
80
]
=
static
const
u64
K
[
80
]
=
{
0x428a2f98d728ae22ULL
,
0x7137449123ef65cdULL
,
0xb5c0fbcfec4d3b2fULL
,
0xe9b5dba58189dbbcULL
,
0x3956c25bf348b538ULL
,
0x59f111f1b605d019ULL
,
0x923f82a4af194f9bULL
,
0xab1c5ed5da6d8118ULL
,
...
...
@@ -624,7 +624,7 @@ int crypto_hash(u8 *out,const u8 *m,u64 n)
sv
add
(
gf
p
[
4
],
gf
q
[
4
])
{
gf
a
,
b
,
c
,
d
,
t
,
e
,
f
,
g
,
h
;
Z
(
a
,
p
[
1
],
p
[
0
]);
Z
(
t
,
q
[
1
],
q
[
0
]);
M
(
a
,
a
,
t
);
...
...
@@ -656,7 +656,7 @@ sv cswap(gf p[4],gf q[4],u8 b)
sv
pack
(
u8
*
r
,
gf
p
[
4
])
{
gf
tx
,
ty
,
zi
;
inv25519
(
zi
,
p
[
2
]);
inv25519
(
zi
,
p
[
2
]);
M
(
tx
,
p
[
0
],
zi
);
M
(
ty
,
p
[
1
],
zi
);
pack25519
(
r
,
ty
);
...
...
src/xsub.cpp
View file @
b2d0ab18
...
...
@@ -105,13 +105,13 @@ int zmq::xsub_t::xsend (msg_t *msg_)
subscriptions
.
add
(
data
+
1
,
size
-
1
);
return
dist
.
send_to_all
(
msg_
);
}
else
else
if
(
size
>
0
&&
*
data
==
0
)
{
// Process unsubscribe message
if
(
subscriptions
.
rm
(
data
+
1
,
size
-
1
))
return
dist
.
send_to_all
(
msg_
);
}
else
else
// User message sent upstream to XPUB socket
return
dist
.
send_to_all
(
msg_
);
...
...
@@ -155,7 +155,7 @@ int zmq::xsub_t::xrecv (msg_t *msg_)
return
-
1
;
// Check whether the message matches at least one subscription.
// Non-initial parts of the message are passed
// Non-initial parts of the message are passed
if
(
more
||
!
options
.
filter
||
match
(
msg_
))
{
more
=
msg_
->
flags
()
&
msg_t
::
more
?
true
:
false
;
return
0
;
...
...
src/zmq_utils.cpp
View file @
b2d0ab18
...
...
@@ -94,24 +94,24 @@ void zmq_threadclose(void* thread)
// Maps base 256 to base 85
static
char
encoder
[
85
+
1
]
=
{
"0123456789"
"abcdefghij"
"klmnopqrst"
"uvwxyzABCD"
"EFGHIJKLMN"
"OPQRSTUVWX"
"YZ.-:+=^!/"
"*?&<>()[]{"
"EFGHIJKLMN"
"OPQRSTUVWX"
"YZ.-:+=^!/"
"*?&<>()[]{"
"}@%$#"
};
// Maps base 85 to base 256
// We chop off lower 32 and higher 128 ranges
static
uint8_t
decoder
[
96
]
=
{
0x00
,
0x44
,
0x00
,
0x54
,
0x53
,
0x52
,
0x48
,
0x00
,
0x4B
,
0x4C
,
0x46
,
0x41
,
0x00
,
0x3F
,
0x3E
,
0x45
,
0x00
,
0x01
,
0x02
,
0x03
,
0x04
,
0x05
,
0x06
,
0x07
,
0x08
,
0x09
,
0x40
,
0x00
,
0x49
,
0x42
,
0x4A
,
0x47
,
0x51
,
0x24
,
0x25
,
0x26
,
0x27
,
0x28
,
0x29
,
0x2A
,
0x2B
,
0x2C
,
0x2D
,
0x2E
,
0x2F
,
0x30
,
0x31
,
0x32
,
0x33
,
0x34
,
0x35
,
0x36
,
0x37
,
0x38
,
0x39
,
0x3A
,
0x3B
,
0x3C
,
0x3D
,
0x4D
,
0x00
,
0x4E
,
0x43
,
0x00
,
0x00
,
0x0A
,
0x0B
,
0x0C
,
0x0D
,
0x0E
,
0x0F
,
0x10
,
0x11
,
0x12
,
0x13
,
0x14
,
0x15
,
0x16
,
0x17
,
0x18
,
0x19
,
0x1A
,
0x1B
,
0x1C
,
0x1D
,
0x1E
,
0x1F
,
0x20
,
0x00
,
0x44
,
0x00
,
0x54
,
0x53
,
0x52
,
0x48
,
0x00
,
0x4B
,
0x4C
,
0x46
,
0x41
,
0x00
,
0x3F
,
0x3E
,
0x45
,
0x00
,
0x01
,
0x02
,
0x03
,
0x04
,
0x05
,
0x06
,
0x07
,
0x08
,
0x09
,
0x40
,
0x00
,
0x49
,
0x42
,
0x4A
,
0x47
,
0x51
,
0x24
,
0x25
,
0x26
,
0x27
,
0x28
,
0x29
,
0x2A
,
0x2B
,
0x2C
,
0x2D
,
0x2E
,
0x2F
,
0x30
,
0x31
,
0x32
,
0x33
,
0x34
,
0x35
,
0x36
,
0x37
,
0x38
,
0x39
,
0x3A
,
0x3B
,
0x3C
,
0x3D
,
0x4D
,
0x00
,
0x4E
,
0x43
,
0x00
,
0x00
,
0x0A
,
0x0B
,
0x0C
,
0x0D
,
0x0E
,
0x0F
,
0x10
,
0x11
,
0x12
,
0x13
,
0x14
,
0x15
,
0x16
,
0x17
,
0x18
,
0x19
,
0x1A
,
0x1B
,
0x1C
,
0x1D
,
0x1E
,
0x1F
,
0x20
,
0x21
,
0x22
,
0x23
,
0x4F
,
0x00
,
0x50
,
0x00
,
0x00
};
...
...
@@ -151,7 +151,7 @@ char *zmq_z85_encode (char *dest, const uint8_t *data, size_t size)
// --------------------------------------------------------------------------
// Decode an encoded string into a binary frame; dest must be at least
// strlen (string) * 4 / 5 bytes long. Returns dest. strlen (string)
// strlen (string) * 4 / 5 bytes long. Returns dest. strlen (string)
// must be a multiple of 5.
// Returns NULL and sets errno = EINVAL for invalid input.
...
...
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