Commit 1a079163 authored by jan.koester's avatar jan.koester
Browse files

changed api for html

parent a6ee8a69
Loading
Loading
Loading
Loading
+6 −2
Changes for examples/httpauth.cpp: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -67,7 +67,9 @@ public:
                << "<li><a href=\"/httpbasicauth\"> Basicauth </<a></li>"
                << "<li><a href=\"/httpdigestauth\"> Digestauth </<a></li>";
                condat  << "</ul></body></html>";
                curres.send(curcon,condat.c_str(),condat.size());
                std::string html;
                (condat.parse())->printHtmlElement(html);
                curres.send(curcon,html.c_str(),html.length());
            }else if(strncmp(cururl,"/httpbasicauth",strlen(cururl))==0 ||
                strncmp(cururl,"/httpdigestauth",strlen(cururl))==0){
                libhttppp::HttpAuth httpauth;
@@ -92,7 +94,9 @@ public:
                curres.setState(HTTP200);
                curres.setVersion(HTTPVERSION(1.1));
                curres.setContentType("text/html");
                curres.send(curcon,condat.c_str(),condat.size());
                std::string html;
                (condat.parse())->printHtmlElement(html);
                curres.send(curcon,html.c_str(),html.length());
                return;
                }else{
                    libhttppp::HttpResponse curres;
+3 −1
Changes for examples/httpcon.cpp: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -57,7 +57,9 @@ void sendResponse(netplus::con *curcon,libhttppp::HttpRequest *curreq) {
               << "<br/>";
     }
     condat  << "</body></html>";
     curres.send(curcon,condat.c_str(),condat.size());
     std::string html;
     (condat.parse())->printHtmlElement(html);
     curres.send(curcon,html.c_str(),html.length());
};

class Controller : public netplus::event {
+4 −1
Changes for examples/httpcookie.cpp: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -60,7 +60,10 @@ public:
        setCookieForm();
        parseCookie();
        _HTMLDat  << "</body></html>";
        _Curres.send(_Curcon,_HTMLDat.c_str(),_HTMLDat.size());

        std::string html;
        (_HTMLDat.parse())->printHtmlElement(html);
        _Curres.send(_Curcon,html.c_str(),html.length());
    };
    
    const char *getData(const char *key){
+6 −4
Changes for examples/httpform.cpp: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -176,10 +176,12 @@ private:
            << "</form>"
            << "</div></br>"
            << "<div style=\"border: thin solid black\">"
            << "<h2>Output</h2>"
            << formdat.c_str()
            << "</div></body></html>";
        curres.send(curcon, condat.c_str(), condat.length());
            << "<h2>Output</h2>";
        condat+=formdat;
        condat << "</div></body></html>";
        std::string html;
        (condat.parse())->printHtmlElement(html);
        curres.send(curcon, html.c_str(), html.length());
    };
};

+3 −1
Changes for examples/httpproxy.cpp: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -57,7 +57,9 @@ void sendResponse(netplus::con *curcon,libhttppp::HttpRequest *curreq) {
               << "<br/>";
     }
     condat  << "</body></html>";
     curres.send(curcon,condat.c_str(),condat.size());
     std::string html;
     (condat.parse())->printHtmlElement(html);
     curres.send(curcon,html.c_str(),html.length());
};

class Controller : public netplus::event {
Loading