Commit 2dc3ebd3 authored by jan.koester's avatar jan.koester
Browse files

needs testing

parent 88354eed
Loading
Loading
Loading
Loading
+2 −6
Changes for examples/httpauth.cpp: 2 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@

class Controller : public libhttppp::HttpEvent {
public:
    Controller(netplus::socket &serversocket) : HttpEvent(serversocket){
    Controller(std::vector<netplus::socket*> serversocket) : HttpEvent(serversocket){
        
    };
    
@@ -49,7 +49,6 @@ public:
            if(curreq.getRequestURL()=="/"){
                libhttppp::HttpResponse curres;
                curres.setState(HTTP200);
                curres.setVersion(HTTPVERSION(1.1));
                curres.setContentType("text/html");
                libhtmlpp::HtmlString condat;
                condat  << "<!DOCTYPE HTML>"
@@ -89,7 +88,6 @@ public:
                condat  << "</ul></body></html>";
                libhttppp::HttpResponse curres;
                curres.setState(HTTP200);
                curres.setVersion(HTTPVERSION(1.1));
                curres.setContentType("text/html");
                libhtmlpp::HtmlString html;
                libhtmlpp::print(condat.parse(),html);
@@ -98,7 +96,6 @@ public:
            }else{
                    libhttppp::HttpResponse curres;
                    curres.setState(HTTP401);
                    curres.setVersion(HTTPVERSION(1.1));
                    if(curreq.getRequestURL()=="/httpbasicauth"){
                        httpauth.setAuthType(BASICAUTH);
                    }else if(curreq.getRequestURL()=="/httpdigestauth"){
@@ -112,7 +109,6 @@ public:
            }else{
                libhttppp::HttpResponse curres;
                curres.setState(HTTP404);
                curres.setVersion(HTTPVERSION(1.1));
                curres.setContentType("text/html");
                curres.send(curreq,std::vector<char>(),0);
            }                
@@ -131,7 +127,7 @@ public:
    HttpConD(int argc, char** argv) : HttpD(argc,argv){
        libhttppp::HTTPException httpexception;
        try {
            Controller controller(getServerSocket());
            Controller controller(getServerSockets());
            controller.runEventloop();
        }catch(libhttppp::HTTPException &e){
            std::cout << e.what() << std::endl;
+0 −1
Changes for examples/httpclient.cpp: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -54,7 +54,6 @@ int main(int argc, char** argv){
      libhttppp::HttpRequest req;
      req.setRequestType(GETREQUEST);
      req.setRequestURL(url.getPath());
      req.setRequestVersion(HTTPVERSION(1.1));
      req.setHeaderData("connection")->push_back("keep-alive");
      req.setHeaderData("host")->push_back(url.getHost());
      req.setHeaderData("accept")->push_back("text/json");
+2 −3
Changes for examples/httpcon.cpp: 2 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void sendResponse(libhttppp::HttpRequest &curreq) {
     libhttppp::HttpResponse curres;
     curres.setState(HTTP200);
     curres.setVersion(HTTPVERSION(1.1));
     curres.setContentType("text/html");
     libhtmlpp::HtmlString condat;
     condat  << "<!DOCTYPE HTML>"
@@ -69,7 +68,7 @@ void sendResponse(libhttppp::HttpRequest &curreq) {

class Controller : public libhttppp::HttpEvent {
public:
    Controller(netplus::socket &serversocket) : HttpEvent(serversocket){
    Controller(std::vector<netplus::socket*> serversocket) : HttpEvent(serversocket){
        
    };
    void RequestEvent(libhttppp::HttpRequest &curreq, const int tid,ULONG_PTR args){
@@ -89,7 +88,7 @@ class HttpConD : public libhttppp::HttpD {
public:
  HttpConD(int argc, char** argv) : HttpD(argc,argv){
    libhttppp::HTTPException httpexception;
      Controller controller(getServerSocket());
      Controller controller(getServerSockets());
      controller.runEventloop();
  };
private:
+2 −3
Changes for examples/httpcookie.cpp: 2 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ class CookieTest {
public:
    CookieTest(libhttppp::HttpRequest &curreq) : _Curreq(curreq) {
        _Curres.setState(HTTP200);
        _Curres.setVersion(HTTPVERSION(1.1));
        _Curres.setContentType("text/html"); 
        _HTMLDat  << "<!DOCTYPE HTML>"
        << " <html>"
@@ -132,7 +131,7 @@ private:

class Controller : public libhttppp::HttpEvent {
public:
    Controller(netplus::socket& serversocket) : HttpEvent(serversocket){
    Controller(std::vector<netplus::socket*> serversocket) : HttpEvent(serversocket){
        
    };
    void RequestEvent(libhttppp::HttpRequest &curreq, const int tid,ULONG_PTR args){
@@ -154,7 +153,7 @@ public:
    HttpConD(int argc, char** argv) : HttpD(argc,argv){
        libhttppp::HTTPException httpexception;
        try {
            Controller controller(getServerSocket());
            Controller controller(getServerSockets());
            controller.runEventloop();
        }catch(libhttppp::HTTPException &e){
            std::cerr<< e.what() << std::endl;
+2 −4
Changes for examples/httpform.cpp: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

class Controller : public libhttppp::HttpEvent {
public:
    Controller(netplus::socket& serversocket) : HttpEvent(serversocket){
    Controller(std::vector<netplus::socket*> serversocket) : HttpEvent(serversocket){
        
    };

@@ -56,7 +56,6 @@ public:
                if (e.getErrorType() != libhttppp::HTTPException::Note) {
                    libhttppp::HttpResponse curres;
                    curres.setState(HTTP500);
                    curres.setVersion(HTTPVERSION(2.0));
                    curres.setContentLength(0);
					std::vector<char> errdat;
					std::copy(e.what().begin(), e.what().end(), std::back_inserter(errdat));
@@ -112,7 +111,6 @@ private:
        libhttppp::HttpResponse curres;
        libhtmlpp::HtmlString condat;
        curres.setState(HTTP200);
        curres.setVersion(HTTPVERSION(1.1));
        curres.setContentType("text/html");
        condat << "<!DOCTYPE HTML>"
            << " <html>"
@@ -190,7 +188,7 @@ public:
  HttpConD(int argc, char** argv) : HttpD(argc,argv){
    libhttppp::HTTPException httpexception;
    try {
      Controller controller(getServerSocket());
      Controller controller(getServerSockets());
      controller.runEventloop();
    }catch(netplus::NetException &e){
      std::cerr << e.what() << std::endl;
Loading