Commit 5bf8ab68 authored by jan.koester's avatar jan.koester
Browse files

test

parent a5c9ecf3
Loading
Loading
Loading
Loading
Loading
+5 −0
Changes for client/client.cpp: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -149,6 +149,7 @@ void ClientConnection::setUrl(const libhttppp::HttpUrl& url) {
    _RequestPath = normalize_path(_Url.getPath());
    if (_Client) {
        _Client = std::make_unique<libhttppp::HttpClient>(_Url);
        _Client->setTimeout(_Timeout);
    }
}

@@ -161,6 +162,7 @@ void ClientConnection::setUrl(const std::string& url) {
    _RequestPath = normalize_path(path);
    if (_Client) {
        _Client = std::make_unique<libhttppp::HttpClient>(_Url);
        _Client->setTimeout(_Timeout);
    }
}

@@ -187,6 +189,8 @@ void ClientConnection::setSessionID(const ::uuid::uuid& sid) { _SessionID = sid;

void ClientConnection::setMaxTries(int maxtries) { _MaxTries = maxtries; }

void ClientConnection::setTimeout(int timeout_sec) { _Timeout = timeout_sec; }

// -------- Client --------

Client::Client(ClientConnection& clt) : _Con(clt) {
@@ -200,6 +204,7 @@ Client::~Client() = default;
inline void ensure_http_client(ClientConnection& con) {
    if (!con._Client) {
        con._Client = std::make_unique<libhttppp::HttpClient>(con._Url);
        con._Client->setTimeout(con._Timeout);
    }
}

+2 −0
Changes for client/client.h: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ namespace authdb {
            void setUsername(const std::string &username);
            void setUserPassword(const std::string &password);
            void setMaxTries(int maxtries);
            void setTimeout(int timeout_sec);

            const uuid::uuid &getClientId();
            const uuid::uuid &getSessionID();
@@ -90,6 +91,7 @@ namespace authdb {
            uuid::uuid             _SessionID;
            uuid::uuid             _ClientId;
            int                    _MaxTries = 3;
            int                    _Timeout = 10;
            friend inline void ensure_http_client(ClientConnection& con);
            friend std::vector<char> post_with_redirect(ClientConnection& con,
                                                        libhttppp::HttpRequest& req,