Loading src/ssod.cpp +52 −43 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading
src/ssod.cpp +52 −43 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading