Commit 777355cc authored by jan.koester's avatar jan.koester
Browse files

test

parent 2b1ebfd9
Loading
Loading
Loading
Loading
+1 −1
Changes for examples/httpcon.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ public:
    Controller(std::shared_ptr<netplus::socket> serversocket) : HttpEvent(serversocket){
        
    };
    void RequestEvent(std::shared_ptr<libhttppp::HttpRequest> &curreq, const int tid,ULONG_PTR args){
    void RequestEvent(std::shared_ptr<libhttppp::HttpRequest> curreq, const int tid,ULONG_PTR args){
        try{
            std::cout << "Send answer" << std::endl;
            sendResponse(curreq);
+1 −1
Changes for src/http.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -1070,7 +1070,7 @@ libhttppp::HttpRequest::HttpRequest() : HttpHeader(){
  _lastHeaderData=nullptr;
};

libhttppp::HttpRequest::HttpRequest(std::shared_ptr <netplus::event> evapi) : netplus::con(evapi) {
libhttppp::HttpRequest::HttpRequest(std::shared_ptr <netplus::eventapi> evapi) : netplus::con(evapi) {
  _RequestType=PARSEREQUEST;
  _MaxUploadSize=DEFAULT_UPLOADSIZE;
  _firstHeaderData=nullptr;
+1 −1
Changes for src/http.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ namespace libhttppp {
  class HttpRequest : public HttpHeader, public netplus::con, std::enable_shared_from_this<HttpRequest> {
  public:
    HttpRequest();
    HttpRequest(std::shared_ptr <netplus::event> evapi);
    HttpRequest(std::shared_ptr <netplus::eventapi> evapi);
    ~HttpRequest();

    void clear();
+2 −2
Changes for src/httpd.cpp: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -49,8 +49,8 @@ libhttppp::HttpEvent::HttpEvent(std::shared_ptr<netplus::socket> &ssock, int tim

}

void libhttppp::HttpEvent::CreateConnetion(std::shared_ptr <netplus::con> &curcon) {
         curcon=std::make_shared<HttpRequest>(std::enable_shared_from_this<event>::shared_from_this());
void libhttppp::HttpEvent::CreateConnection(std::shared_ptr <netplus::con> &curcon){
    curcon=std::make_shared<HttpRequest>(std::enable_shared_from_this<netplus::event>::shared_from_this());
}

void libhttppp::HttpEvent::RequestEvent(std::shared_ptr <HttpRequest> curreq,const int tid,ULONG_PTR args){
+2 −4
Changes for src/httpd.h: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -38,18 +38,16 @@ namespace cmdplus {
}

namespace libhttppp {

    class HttpEvent : public netplus::event, std::enable_shared_from_this<HttpEvent>{
    public:
        HttpEvent(std::shared_ptr<netplus::socket> &ssock,int timeout = -1);

        void CreateConnetion(std::shared_ptr <netplus::con> &curcon);

        virtual void RequestEvent(std::shared_ptr <HttpRequest> curreq,const int tid,ULONG_PTR args);
        virtual void ResponseEvent(std::shared_ptr <HttpRequest> curreq,const int tid,ULONG_PTR args);
        virtual void ConnectEvent(std::shared_ptr <HttpRequest> curreq,const int tid,ULONG_PTR args);
        virtual void DisconnectEvent(std::shared_ptr <HttpRequest> curreq,const int tid,ULONG_PTR args);

    protected:
        void CreateConnection(std::shared_ptr <netplus::con> &curcon);
    private:
        void RequestEvent(std::shared_ptr <netplus::con> curcon, const int tid, ULONG_PTR args);
        void ResponseEvent(std::shared_ptr <netplus::con> curcon,const int tid,ULONG_PTR args);