revert
All checks were successful
BlockStorage/repertory_linux_builds/pipeline/head This commit looks good
BlockStorage/repertory_osx_builds/pipeline/head This commit looks good

This commit is contained in:
2024-01-29 11:36:26 -06:00
parent d175a38ad1
commit 99533a9687
213 changed files with 43429 additions and 41103 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2023> <scott.e.graves@protonmail.com>
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -45,6 +45,12 @@ public:
~packet_server();
public:
packet_server(const packet_server &) = delete;
packet_server(packet_server &&) = delete;
auto operator=(const packet_server &) -> packet_server & = delete;
auto operator=(packet_server &&) -> packet_server & = delete;
private:
struct connection {
connection(boost::asio::io_service &io_service, tcp::acceptor &acceptor_)
@@ -56,11 +62,11 @@ private:
std::string client_id;
std::string nonce;
void generate_nonce() { nonce = utils::generate_random_string(256u); }
void generate_nonce() { nonce = utils::generate_random_string(256U); }
};
private:
const std::string encryption_token_;
std::string encryption_token_;
closed_callback closed_;
message_handler_callback message_handler_;
boost::asio::io_context io_context_;
@@ -70,21 +76,22 @@ private:
std::unordered_map<std::string, std::uint32_t> connection_lookup_;
private:
void add_client(connection &c, const std::string &client_id);
void add_client(connection &conn, const std::string &client_id);
void initialize(const uint16_t &port, uint8_t pool_size);
void listen_for_connection(tcp::acceptor &acceptor);
void on_accept(std::shared_ptr<connection> c, boost::system::error_code ec);
void on_accept(std::shared_ptr<connection> conn,
boost::system::error_code err);
void read_header(std::shared_ptr<connection> c);
void read_header(std::shared_ptr<connection> conn);
void read_packet(std::shared_ptr<connection> c, std::uint32_t data_size);
void read_packet(std::shared_ptr<connection> conn, std::uint32_t data_size);
void remove_client(connection &c);
void remove_client(connection &conn);
void send_response(std::shared_ptr<connection> c,
void send_response(std::shared_ptr<connection> conn,
const packet::error_type &result, packet &response);
};
} // namespace repertory