Commit f6dfc34b authored by jan.koester's avatar jan.koester
Browse files

fiexed init

parent ff050834
Loading
Loading
Loading
Loading
Loading
+17 −4
Changes for src/api.cpp: 17 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -61,6 +61,19 @@ namespace authdb {
        }

        bool checkConnection(json_object *request,json_object *response){
            json_object *cmd=json_object_object_get(request,"commands");

            if(!cmd)
                throw(AuthBackendError("Invalid Api Commands"));

            int fcount = json_object_array_length(cmd);
            for(int i =0; i<fcount; ++i) {
                json_object_object_foreach(json_object_array_get_idx(cmd,i), key, val) {
                    if(strcmp(key,"clientsession")==0){

                    }
                }
            }
            return false;
        }

@@ -189,8 +202,8 @@ namespace authdb {
                rep.setState(HTTP401);
                rep.setContentType("text/json");
                rep.send(curreq,ret,strlen(ret));
                while (json_object_put(jresponse) != 1) ;
                while (json_object_put(jrequest) != 1) ;
                 json_object_put(jresponse) ;
                 json_object_put(jrequest) ;
                return;
            }

@@ -200,8 +213,8 @@ namespace authdb {
            rep.setState(HTTP200);
            rep.setContentType("text/json");
            rep.send(curreq,out,outsize);
            while (json_object_put(jresponse) != 1) ;
            while (json_object_put(jrequest) != 1) ;
            json_object_put(jresponse) ;
            json_object_put(jrequest);
        }

        ~Api(){
+3 −2
Changes for src/client.cpp: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -33,8 +33,8 @@ namespace authdb{
    class ConnectionData {
    private:
            ConnectionData(uuid &id){
                _next=nullptr;
                _Id=id;
                _next=nullptr;
            };

            uuid                     _Id;
@@ -167,7 +167,8 @@ void authdb::Client::remove(AuthBackend& backend, const uuid_t clid){
}

authdb::Client::Client(){

    _firstConnection=nullptr;
    _lastConnection=nullptr;
}

authdb::Client::~Client(){