Commit 8d99dd8e authored by jan.koester's avatar jan.koester
Browse files

work cmake

parent 4cb923f4
Loading
Loading
Loading
Loading
+52 −43
Original line number Diff line number Diff line
@@ -31,17 +31,7 @@ public:
        libhttppp::HttpRequest http;
        try{
            http.parse(curcon);
            if(strncmp(http.getRequestURL(),"/admin",6)!=0){
                libhttppp::HttpResponse resp;
                resp.setVersion(HTTPVERSION(1.1));
                resp.setState(HTTP404);
                resp.setContentType("text/html");
                resp.send(curcon,"Wrong Url",10);
                return;
            }
        }catch(libhttppp::HTTPException &e){
            std::cerr << e.what() << std::endl;
        }
            if(strncmp(http.getRequestURL(),"/admin/api",10)){
                try{
                    netplus::tcp *csock=admSock->connect();
                    std::string header;
@@ -83,6 +73,25 @@ public:
                    resp.send(curcon,e.what());
                    return;
                }
            }else if(strncmp(http.getRequestURL(),"/admin",6)){
                libhttppp::HttpResponse resp;
                resp.setVersion(HTTPVERSION(1.1));
                resp.setState(HTTP200);
                resp.setContentType("text/html");
                resp.send(curcon,"index",5);
                return;
            }else{
                libhttppp::HttpResponse resp;
                resp.setVersion(HTTPVERSION(1.1));
                resp.setState(HTTP404);
                resp.setContentType("text/html");
                resp.send(curcon,"Wrong Url",10);
                return;
            }
        }catch(libhttppp::HTTPException &e){
            std::cerr << e.what() << std::endl;
        }

    };
private:
    netplus::socket *srvSock;