Commit 196e41c9 authored by jan.koester's avatar jan.koester
Browse files

test

parent e6f7948c
Loading
Loading
Loading
Loading
Loading
+8 −9
Changes for client/client.cpp: 8 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ authdb::client::ClientConnection::ClientConnection(){
}

authdb::client::ClientConnection::~ClientConnection(){
    delete _Client;
}

void authdb::client::ClientConnection::setUrl(const std::string &url){
@@ -81,18 +80,18 @@ void authdb::client::ClientConnection::setSessionID(const ::uuid::uuid& sid){
}

authdb::client::Client::Client(ClientConnection& clt) : _Con(clt){
    if(!_Con._Client){
        _Con._Client=new libhttppp::HttpClient(_Con._Url);
    }else{
try {
            libhttppp::HttpRequest nreq;
            nreq.setHeaderData("accept")->push_back("text/html");
            _Con._Client->Get(nreq);
        libhttppp::HttpRequest nreq_test;
        nreq_test.setHeaderData("accept")->push_back("text/html");
        _Con._Client->Get(nreq_test);
    } catch (libhttppp::HTTPException &e) {
            throw(authdb::AuthBackendError("Auth Connect HttpError: "+e.what()));
        try {
            _Con._Client->reconnect();
        } catch (...) {
            throw(authdb::AuthBackendError("Unkwon Error Auth Connect!"));
            throw(authdb::AuthBackendError("Auth Connect HttpError: " + e.what()));
        }
    } catch (...) {
        throw(authdb::AuthBackendError("Auth Connect Unknown Error during connection test!"));
    }
}

+2 −1
Changes for client/client.h: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
 *******************************************************************************/

#include <string>
#include <memor>
#include <uuidp.h>

#ifndef Windows
@@ -79,7 +80,7 @@ namespace authdb {
            std::string _UserName;
            std::string _UserPassword;

            libhttppp::HttpClient *_Client;
            std::unique_ptr<libhttppp::HttpClient> _Client;
            uuid::uuid             _SessionID;
            uuid::uuid             _ClientId;
            friend class Client;