Commit a80ca31a authored by Dominik Charousset's avatar Dominik Charousset

Fix formatting

parent 230fa863
...@@ -15,10 +15,10 @@ struct default_handshake_worker_factory { ...@@ -15,10 +15,10 @@ struct default_handshake_worker_factory {
OnError abort; OnError abort;
}; };
/// An connect worker calls an asynchronous `connect` callback until it succeeds. /// An connect worker calls an asynchronous `connect` callback until it
/// On success, the worker calls a factory object to transfer ownership of /// succeeds. On success, the worker calls a factory object to transfer
/// socket and communication policy to the create the socket manager that takes /// ownership of socket and communication policy to the create the socket
/// care of the established connection. /// manager that takes care of the established connection.
template <bool IsServer, class Socket, class Policy, class Factory> template <bool IsServer, class Socket, class Policy, class Factory>
class handshake_worker : public socket_manager { class handshake_worker : public socket_manager {
public: public:
...@@ -31,7 +31,7 @@ public: ...@@ -31,7 +31,7 @@ public:
using write_result = typename super::write_result; using write_result = typename super::write_result;
handshake_worker(Socket handle, multiplexer* parent, Policy policy, handshake_worker(Socket handle, multiplexer* parent, Policy policy,
Factory factory) Factory factory)
: super(handle, parent), : super(handle, parent),
policy_(std::move(policy)), policy_(std::move(policy)),
factory_(std::move(factory)) { factory_(std::move(factory)) {
......
...@@ -460,7 +460,8 @@ private: ...@@ -460,7 +460,8 @@ private:
/// Stores the current offset in `read_buf_`. /// Stores the current offset in `read_buf_`.
ptrdiff_t offset_ = 0; ptrdiff_t offset_ = 0;
/// Stores the offset in `read_buf_` since last calling `upper_layer_.consume`. /// Stores the offset in `read_buf_` since last calling
/// `upper_layer_.consume`.
ptrdiff_t delta_offset_ = 0; ptrdiff_t delta_offset_ = 0;
/// Caches incoming data. /// Caches incoming data.
......
...@@ -158,7 +158,7 @@ operation multiplexer::mask_of(const socket_manager_ptr& mgr) { ...@@ -158,7 +158,7 @@ operation multiplexer::mask_of(const socket_manager_ptr& mgr) {
auto fd = mgr->handle(); auto fd = mgr->handle();
if (auto i = updates_.find(fd); i != updates_.end()) if (auto i = updates_.find(fd); i != updates_.end())
return to_operation(mgr, i->second.events); return to_operation(mgr, i->second.events);
else if (auto index = index_of(mgr);index!=-1) else if (auto index = index_of(mgr); index != -1)
return to_operation(mgr, pollset_[index].events); return to_operation(mgr, pollset_[index].events);
else else
return to_operation(mgr, std::nullopt); return to_operation(mgr, std::nullopt);
...@@ -281,7 +281,7 @@ bool multiplexer::poll_once(bool blocking) { ...@@ -281,7 +281,7 @@ bool multiplexer::poll_once(bool blocking) {
// is allowed to modify pollset_ and managers_. Since this may very well // is allowed to modify pollset_ and managers_. Since this may very well
// mess with the for loop below, we process this handler first. // mess with the for loop below, we process this handler first.
auto mgr = managers_[0]; auto mgr = managers_[0];
handle(mgr,pollset_[0].events,revents); handle(mgr, pollset_[0].events, revents);
--presult; --presult;
} }
for (size_t i = 1; i < pollset_.size() && presult > 0; ++i) { for (size_t i = 1; i < pollset_.size() && presult > 0; ++i) {
......
...@@ -43,7 +43,7 @@ using byte_buffer_ptr = std::shared_ptr<byte_buffer>; ...@@ -43,7 +43,7 @@ using byte_buffer_ptr = std::shared_ptr<byte_buffer>;
struct fixture : host_fixture { struct fixture : host_fixture {
using byte_buffer_ptr = std::shared_ptr<byte_buffer>; using byte_buffer_ptr = std::shared_ptr<byte_buffer>;
fixture(){ fixture() {
multiplexer::block_sigpipe(); multiplexer::block_sigpipe();
OPENSSL_init_ssl(OPENSSL_INIT_SSL_DEFAULT, nullptr); OPENSSL_init_ssl(OPENSSL_INIT_SSL_DEFAULT, nullptr);
// Make a directory name with 8 random (hex) character suffix. // Make a directory name with 8 random (hex) character suffix.
...@@ -174,7 +174,7 @@ void dummy_tls_server(stream_socket fd, std::string cert_file, ...@@ -174,7 +174,7 @@ void dummy_tls_server(stream_socket fd, std::string cert_file,
if (f.accept(fd) <= 0) { if (f.accept(fd) <= 0) {
std::cerr << "*** accept failed: " << ssl::fetch_error_str(); std::cerr << "*** accept failed: " << ssl::fetch_error_str();
return; return;
} }
// Do some ping-pong messaging. // Do some ping-pong messaging.
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
byte_buffer buf; byte_buffer buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment