run clang-format

This commit is contained in:
Lucca Jiménez Könings
2024-06-26 14:06:06 +02:00
parent 3c80bcbf01
commit 29f4d0d286
19 changed files with 44 additions and 57 deletions
+5 -5
View File
@@ -30,8 +30,8 @@
using json = nlohmann::json;
struct Connection {
std::string host{};
int port{};
std::string host {};
int port {};
Connection() = default;
Connection(std::string host, int port)
: host(host)
@@ -54,13 +54,13 @@ static thread_local std::array<std::shared_ptr<httplib::SSLClient>, CONNECTION_A
write_index++;
write_index %= CONNECTION_AMOUNT;
clients[i] = std::make_shared<httplib::SSLClient>(connectionInfo.host, connectionInfo.port);
connections[i] = {connectionInfo.host, connectionInfo.port};
connections[i] = { connectionInfo.host, connectionInfo.port };
beammp_tracef("New client connected, with ip {} and port {}", connectionInfo.host, connectionInfo.port);
return clients[i];
}
std::string Http::GET(const std::string& host, int port, const std::string& target, unsigned int* status) {
std::shared_ptr<httplib::SSLClient> client = getClient({host, port});
std::shared_ptr<httplib::SSLClient> client = getClient({ host, port });
client->enable_server_certificate_verification(false);
client->set_address_family(AF_INET);
auto res = client->Get(target.c_str());
@@ -75,7 +75,7 @@ std::string Http::GET(const std::string& host, int port, const std::string& targ
}
std::string Http::POST(const std::string& host, int port, const std::string& target, const std::string& body, const std::string& ContentType, unsigned int* status, const httplib::Headers& headers) {
std::shared_ptr<httplib::SSLClient> client = getClient({host, port});
std::shared_ptr<httplib::SSLClient> client = getClient({ host, port });
client->set_read_timeout(std::chrono::seconds(10));
beammp_assert(client->is_valid());
client->enable_server_certificate_verification(false);