Commit 92e68058 authored by jan.koester's avatar jan.koester
Browse files

better

parent 27d31fea
Loading
Loading
Loading
Loading
+72 −71
Original line number Diff line number Diff line
@@ -263,6 +263,8 @@ void blogi::Blogi::RequestEvent(netplus::con *curcon){

        std::cout << std::endl;

RETRY_REQUEST:
        try{
            /*blogi internal pages and redirections*/
            if(strcmp(req.getRequestURL(),"/")==0 || strcmp(req.getRequestURL(),PlgArgs->config->getprefix())==0){
                libhttppp::HttpResponse curres;
@@ -331,20 +333,19 @@ void blogi::Blogi::RequestEvent(netplus::con *curcon){
                resp.setState(HTTP404);
                resp.setContentType("text/html");
                resp.send(curcon,output.c_str(),output.length());

            }
        }catch(libhttppp::HTTPException &e){
        if(e.getErrorType() == libhttppp::HTTPException::Note || e.getErrorType() == libhttppp::HTTPException::Warning)
            return;

            if(!PlgArgs->database->isConnected()){
                PlgArgs->database->reset();
                if(PlgArgs->database->isConnected()){
                RequestEvent(curcon);
                return;
                    goto RETRY_REQUEST;
                }
            }

            throw e;
        }
    }catch(libhttppp::HTTPException &e){
        if(e.getErrorType() == libhttppp::HTTPException::Note || e.getErrorType() == libhttppp::HTTPException::Warning)
            return;
        std::string output;
        libhtmlpp::HtmlString err,hreason;
        libhtmlpp::HtmlEncode(e.what(),hreason);