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
f0945c85
Commit
f0945c85
authored
Sep 17, 2016
by
Luca Boccassi
Committed by
GitHub
Sep 17, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2110 from c-rack/remove-tabs
Problem: source conatins tabs and trailing spaces
parents
e8d665c4
8cd33339
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
68 additions
and
68 deletions
+68
-68
ctx.cpp
src/ctx.cpp
+5
-5
decoder.hpp
src/decoder.hpp
+1
-1
dgram.cpp
src/dgram.cpp
+1
-1
ip.cpp
src/ip.cpp
+1
-1
norm_engine.cpp
src/norm_engine.cpp
+0
-0
norm_engine.hpp
src/norm_engine.hpp
+36
-36
pipe.cpp
src/pipe.cpp
+3
-3
select.cpp
src/select.cpp
+3
-3
signaler.cpp
src/signaler.cpp
+5
-5
socket_base.cpp
src/socket_base.cpp
+1
-1
stream.cpp
src/stream.cpp
+1
-1
tcp.cpp
src/tcp.cpp
+8
-8
tcp_listener.cpp
src/tcp_listener.cpp
+1
-1
tweetnacl.c
src/tweetnacl.c
+2
-2
No files found.
src/ctx.cpp
View file @
f0945c85
...
...
@@ -91,7 +91,7 @@ zmq::ctx_t::ctx_t () :
vmci_family
=
-
1
;
#endif
scoped_lock_t
locker
(
crypto_sync
);
scoped_lock_t
locker
(
crypto_sync
);
#if defined (ZMQ_USE_TWEETNACL)
// allow opening of /dev/urandom
unsigned
char
tmpbytes
[
4
];
...
...
@@ -510,13 +510,13 @@ void zmq::ctx_t::pend_connection (const std::string &addr_,
endpoints_t
::
iterator
it
=
endpoints
.
find
(
addr_
);
if
(
it
==
endpoints
.
end
())
{
// Still no bind.
//
Still no bind.
endpoint_
.
socket
->
inc_seqnum
();
pending_connections
.
insert
(
pending_connections_t
::
value_type
(
addr_
,
pending_connection
));
}
else
{
//
Bind has happened in the mean time, connect directly
connect_inproc_sockets
(
it
->
second
.
socket
,
it
->
second
.
options
,
pending_connection
,
connect_side
);
}
//
Bind has happened in the mean time, connect directly
connect_inproc_sockets
(
it
->
second
.
socket
,
it
->
second
.
options
,
pending_connection
,
connect_side
);
}
}
void
zmq
::
ctx_t
::
connect_pending
(
const
char
*
addr_
,
zmq
::
socket_base_t
*
bind_socket_
)
...
...
src/decoder.hpp
View file @
f0945c85
...
...
@@ -119,7 +119,7 @@ namespace zmq
bytes_used_
=
size_
;
while
(
!
to_read
)
{
const
int
rc
=
const
int
rc
=
(
static_cast
<
T
*>
(
this
)
->*
next
)
(
data_
+
bytes_used_
);
if
(
rc
!=
0
)
return
rc
;
...
...
src/dgram.cpp
View file @
f0945c85
...
...
@@ -53,7 +53,7 @@ zmq::dgram_t::~dgram_t ()
void
zmq
::
dgram_t
::
xattach_pipe
(
pipe_t
*
pipe_
,
bool
subscribe_to_all_
)
{
LIBZMQ_UNUSED
(
subscribe_to_all_
);
LIBZMQ_UNUSED
(
subscribe_to_all_
);
zmq_assert
(
pipe_
);
...
...
src/ip.cpp
View file @
f0945c85
...
...
@@ -130,7 +130,7 @@ int zmq::get_peer_ip_address (fd_t sockfd_, std::string &ip_addr_)
rc
=
getpeername
(
sockfd_
,
(
struct
sockaddr
*
)
&
ss
,
&
addrlen
);
#ifdef ZMQ_HAVE_WINDOWS
if
(
rc
==
SOCKET_ERROR
)
{
const
int
last_error
=
WSAGetLastError
();
const
int
last_error
=
WSAGetLastError
();
wsa_assert
(
last_error
!=
WSANOTINITIALISED
&&
last_error
!=
WSAEFAULT
&&
last_error
!=
WSAEINPROGRESS
&&
...
...
src/norm_engine.cpp
View file @
f0945c85
This diff is collapsed.
Click to expand it.
src/norm_engine.hpp
View file @
f0945c85
...
...
@@ -16,17 +16,17 @@ namespace zmq
{
class
io_thread_t
;
class
session_base_t
;
class
norm_engine_t
:
public
io_object_t
,
public
i_engine
{
public
:
norm_engine_t
(
zmq
::
io_thread_t
*
parent_
,
const
options_t
&
options_
);
~
norm_engine_t
();
// create NORM instance, session, etc
int
init
(
const
char
*
network_
,
bool
send
,
bool
recv
);
void
shutdown
();
// i_engine interface implementation.
// Plug the engine to the session.
virtual
void
plug
(
zmq
::
io_thread_t
*
io_thread_
,
...
...
@@ -45,43 +45,43 @@ namespace zmq
virtual
void
restart_output
();
virtual
void
zap_msg_available
()
{};
// i_poll_events interface implementation.
// (we only need in_event() for NormEvent notification)
// (i.e., don't have any output events or timers (yet))
void
in_event
();
private
:
void
unplug
();
void
send_data
();
void
recv_data
(
NormObjectHandle
stream
);
void
recv_data
(
NormObjectHandle
stream
);
enum
{
BUFFER_SIZE
=
2048
};
// Used to keep track of streams from multiple senders
// Used to keep track of streams from multiple senders
class
NormRxStreamState
{
public
:
NormRxStreamState
(
NormObjectHandle
normStream
,
int64_t
maxMsgSize
);
~
NormRxStreamState
();
NormObjectHandle
GetStreamHandle
()
const
{
return
norm_stream
;}
bool
Init
();
void
SetRxReady
(
bool
state
)
{
rx_ready
=
state
;}
bool
IsRxReady
()
const
{
return
rx_ready
;}
void
SetSync
(
bool
state
)
{
in_sync
=
state
;}
bool
InSync
()
const
{
return
in_sync
;}
// These are used to feed data to decoder
// and its underlying "msg" buffer
char
*
AccessBuffer
()
...
...
@@ -98,21 +98,21 @@ namespace zmq
// occurs the 'sync' is dropped and the
// decoder re-initialized
int
Decode
();
class
List
{
public
:
List
();
~
List
();
void
Append
(
NormRxStreamState
&
item
);
void
Remove
(
NormRxStreamState
&
item
);
bool
IsEmpty
()
const
{
return
(
NULL
==
head
);}
void
Destroy
();
class
Iterator
{
public
:
...
...
@@ -122,36 +122,36 @@ namespace zmq
NormRxStreamState
*
next_item
;
};
friend
class
Iterator
;
private
:
NormRxStreamState
*
head
;
NormRxStreamState
*
tail
;
NormRxStreamState
*
tail
;
};
// end class zmq::norm_engine_t::NormRxStreamState::List
friend
class
List
;
List
*
AccessList
()
{
return
list
;}
private
:
NormObjectHandle
norm_stream
;
int64_t
max_msg_size
;
bool
in_sync
;
bool
in_sync
;
bool
rx_ready
;
v2_decoder_t
*
zmq_decoder
;
bool
skip_norm_sync
;
unsigned
char
*
buffer_ptr
;
size_t
buffer_size
;
size_t
buffer_count
;
NormRxStreamState
*
prev
;
NormRxStreamState
*
next
;
NormRxStreamState
::
List
*
list
;
};
// end class zmq::norm_engine_t::NormRxStreamState
session_base_t
*
zmq_session
;
options_t
options
;
NormInstanceHandle
norm_instance
;
...
...
@@ -161,25 +161,25 @@ namespace zmq
bool
is_receiver
;
// Sender state
msg_t
tx_msg
;
v2_encoder_t
zmq_encoder
;
// for tx messages (we use v2 for now)
v2_encoder_t
zmq_encoder
;
// for tx messages (we use v2 for now)
NormObjectHandle
norm_tx_stream
;
bool
tx_first_msg
;
bool
tx_more_bit
;
bool
zmq_output_ready
;
// zmq has msg(s) to send
bool
zmq_output_ready
;
// zmq has msg(s) to send
bool
norm_tx_ready
;
// norm has tx queue vacancy
// TBD - maybe don't need buffer if can access zmq message buffer directly?
char
tx_buffer
[
BUFFER_SIZE
];
unsigned
int
tx_index
;
unsigned
int
tx_len
;
// Receiver state
// Lists of norm rx streams from remote senders
bool
zmq_input_ready
;
// zmq ready to receive msg(s)
NormRxStreamState
::
List
rx_pending_list
;
// rx streams waiting for data reception
NormRxStreamState
::
List
rx_ready_list
;
// rx streams ready for NormStreamRead()
NormRxStreamState
::
List
msg_ready_list
;
// rx streams w/ msg ready for push to zmq
};
// end class norm_engine_t
}
...
...
src/pipe.cpp
View file @
f0945c85
...
...
@@ -390,12 +390,12 @@ void zmq::pipe_t::terminate (bool delay_)
// If terminate was already called, we can ignore the duplicate invocation.
if
(
state
==
term_req_sent1
||
state
==
term_req_sent2
)
{
return
;
}
}
// If the pipe is in the final phase of async termination, it's going to
// closed anyway. No need to do anything special here.
else
if
(
state
==
term_ack_sent
)
{
return
;
}
}
// The simple sync termination case. Ask the peer to terminate and wait
// for the ack.
else
if
(
state
==
active
)
{
...
...
@@ -422,7 +422,7 @@ void zmq::pipe_t::terminate (bool delay_)
// There are no other states.
else
{
zmq_assert
(
false
);
}
}
// Stop outbound flow of messages.
out_active
=
false
;
...
...
src/select.cpp
View file @
f0945c85
...
...
@@ -432,9 +432,9 @@ bool zmq::select_t::is_retired_fd (const fd_entry_t &entry)
#if defined ZMQ_HAVE_WINDOWS
u_short
zmq
::
select_t
::
get_fd_family
(
fd_t
fd_
)
{
//
Use sockaddr_storage instead of sockaddr to accomodate differect structure sizes
sockaddr_storage
addr
=
{
0
};
int
addr_size
=
sizeof
addr
;
//
Use sockaddr_storage instead of sockaddr to accomodate differect structure sizes
sockaddr_storage
addr
=
{
0
};
int
addr_size
=
sizeof
addr
;
int
type
;
int
type_length
=
sizeof
(
int
);
...
...
src/signaler.cpp
View file @
f0945c85
...
...
@@ -338,11 +338,11 @@ int zmq::signaler_t::recv_failable ()
#if defined ZMQ_HAVE_WINDOWS
int
nbytes
=
::
recv
(
r
,
(
char
*
)
&
dummy
,
sizeof
(
dummy
),
0
);
if
(
nbytes
==
SOCKET_ERROR
)
{
const
int
last_error
=
WSAGetLastError
();
if
(
last_error
==
WSAEWOULDBLOCK
)
{
errno
=
EAGAIN
;
const
int
last_error
=
WSAGetLastError
();
if
(
last_error
==
WSAEWOULDBLOCK
)
{
errno
=
EAGAIN
;
return
-
1
;
}
}
wsa_assert
(
last_error
==
WSAEWOULDBLOCK
);
}
#else
...
...
@@ -388,7 +388,7 @@ int zmq::signaler_t::make_fdpair (fd_t *r_, fd_t *w_)
#elif defined ZMQ_HAVE_WINDOWS
# if !defined _WIN32_WCE
// Windows CE does not manage security attributes
//
Windows CE does not manage security attributes
SECURITY_DESCRIPTOR
sd
;
SECURITY_ATTRIBUTES
sa
;
memset
(
&
sd
,
0
,
sizeof
sd
);
...
...
src/socket_base.cpp
View file @
f0945c85
...
...
@@ -432,7 +432,7 @@ int zmq::socket_base_t::getsockopt (int option_, void *optval_,
return
-
1
;
}
memset
(
optval_
,
0
,
*
optvallen_
);
*
((
int
*
)
optval_
)
=
thread_safe
?
1
:
0
;
*
((
int
*
)
optval_
)
=
thread_safe
?
1
:
0
;
*
optvallen_
=
sizeof
(
int
);
return
0
;
}
...
...
src/stream.cpp
View file @
f0945c85
...
...
@@ -60,7 +60,7 @@ zmq::stream_t::~stream_t ()
void
zmq
::
stream_t
::
xattach_pipe
(
pipe_t
*
pipe_
,
bool
subscribe_to_all_
)
{
LIBZMQ_UNUSED
(
subscribe_to_all_
);
LIBZMQ_UNUSED
(
subscribe_to_all_
);
zmq_assert
(
pipe_
);
...
...
src/tcp.cpp
View file @
f0945c85
...
...
@@ -189,7 +189,7 @@ void zmq::tune_tcp_maxrt (fd_t sockfd_, int timeout_)
// If not a single byte can be written to the socket in non-blocking mode
// we'll get an error (this may happen during the speculative write).
const
int
last_error
=
WSAGetLastError
();
const
int
last_error
=
WSAGetLastError
();
if
(
nbytes
==
SOCKET_ERROR
&&
last_error
==
WSAEWOULDBLOCK
)
return
0
;
...
...
@@ -201,7 +201,7 @@ void zmq::tune_tcp_maxrt (fd_t sockfd_, int timeout_)
last_error
==
WSAECONNABORTED
||
last_error
==
WSAETIMEDOUT
||
last_error
==
WSAECONNRESET
))
))
return
-
1
;
// Circumvent a Windows bug:
...
...
@@ -256,12 +256,12 @@ int zmq::tcp_read (fd_t s_, void *data_, size_t size_)
errno
=
EAGAIN
;
}
else
{
wsa_assert
(
last_error
==
WSAENETDOWN
||
last_error
==
WSAENETRESET
||
last_error
==
WSAECONNABORTED
||
last_error
==
WSAETIMEDOUT
||
last_error
==
WSAECONNRESET
||
last_error
==
WSAECONNREFUSED
||
wsa_assert
(
last_error
==
WSAENETDOWN
||
last_error
==
WSAENETRESET
||
last_error
==
WSAECONNABORTED
||
last_error
==
WSAETIMEDOUT
||
last_error
==
WSAECONNRESET
||
last_error
==
WSAECONNREFUSED
||
last_error
==
WSAENOTCONN
);
errno
=
wsa_error_to_errno
(
last_error
);
}
...
...
src/tcp_listener.cpp
View file @
f0945c85
...
...
@@ -281,7 +281,7 @@ zmq::fd_t zmq::tcp_listener_t::accept ()
#ifdef ZMQ_HAVE_WINDOWS
if
(
sock
==
INVALID_SOCKET
)
{
const
int
last_error
=
WSAGetLastError
();
const
int
last_error
=
WSAGetLastError
();
wsa_assert
(
last_error
==
WSAEWOULDBLOCK
||
last_error
==
WSAECONNRESET
||
last_error
==
WSAEMFILE
||
...
...
src/tweetnacl.c
View file @
f0945c85
...
...
@@ -573,8 +573,8 @@ int crypto_hashblocks(u8 *x,const u8 *m,u64 n)
b
[
3
]
+=
t
;
FOR
(
j
,
8
)
a
[(
j
+
1
)
%
8
]
=
b
[
j
];
if
(
i
%
16
==
15
)
FOR
(
j
,
16
)
w
[
j
]
+=
w
[(
j
+
9
)
%
16
]
+
sigma0
(
w
[(
j
+
1
)
%
16
])
+
sigma1
(
w
[(
j
+
14
)
%
16
]);
FOR
(
j
,
16
)
w
[
j
]
+=
w
[(
j
+
9
)
%
16
]
+
sigma0
(
w
[(
j
+
1
)
%
16
])
+
sigma1
(
w
[(
j
+
14
)
%
16
]);
}
FOR
(
i
,
8
)
{
a
[
i
]
+=
z
[
i
];
z
[
i
]
=
a
[
i
];
}
...
...
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