Commit bb91c5e1 authored by jan.koester's avatar jan.koester
Browse files

test

# Conflicts:
#	src/httpd.cpp
parent 32ab024b
Loading
Loading
Loading
Loading
+8 −8
Changes for examples/httpsysinfo.cpp: 8 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -112,9 +112,9 @@ public:
        libhtmlpp::HtmlTable htmltable;

        /*create table rows*/
        htmltable << libhtmlpp::HtmlTable::Row() << "Operating system:" << usysinfo.sysname;
        htmltable << libhtmlpp::HtmlTable::Row() << "Release Version :" << usysinfo.release;
        htmltable << libhtmlpp::HtmlTable::Row() << "Hardware        :" << usysinfo.machine;
        htmltable << (libhtmlpp::HtmlTable::Row() << "Operating system:" << usysinfo.sysname);
        htmltable << (libhtmlpp::HtmlTable::Row() << "Release Version :" << usysinfo.release);
        htmltable << (libhtmlpp::HtmlTable::Row() << "Hardware        :" << usysinfo.machine);

        libhtmlpp::HtmlElement table;
        /*convert htmltable to dom HtmlElement*/
@@ -126,7 +126,7 @@ public:
        libhtmlpp::HtmlString html;
        html << "<div><span>KernelInfo:</span> <br/> </div> ";
        /*convert Htmlstring to Html Dom element*/
        libhtmlpp::HtmlElement *div=(libhtmlpp::HtmlElement*)html.parse();
        libhtmlpp::HtmlElement *div=(libhtmlpp::HtmlElement*)&html.parse();

        /*append table to dom element div*/
        div->appendChild(&table);
@@ -169,9 +169,9 @@ public:
        GetSystemInfo(&usysinfo);

        /*create table rows*/
        htmltable << libhtmlpp::HtmlTable::Row() << "Operating system: " << "Windows";
        htmltable << libhtmlpp::HtmlTable::Row() << "Release Version: " << rver;
        htmltable << libhtmlpp::HtmlTable::Row() << "Hardware: " << getArchText(usysinfo.wProcessorArchitecture);
        htmltable << (libhtmlpp::HtmlTable::Row() << "Operating system: " << "Windows");
        htmltable << (libhtmlpp::HtmlTable::Row() << "Release Version: " << rver);
        htmltable << (libhtmlpp::HtmlTable::Row() << "Hardware: " << getArchText(usysinfo.wProcessorArchitecture));

        libhtmlpp::HtmlElement table;
        /*convert htmltable to dom HtmlElement*/
@@ -218,7 +218,7 @@ public:
                Sysinfo sys;
                sys.TimeInfo(index);
                sys.KernelInfo(index);
                libhtmlpp::print(&index,html);
                libhtmlpp::print(index,html);
                curres.send(curreq,html.data(),html.size());
            }else if(curreq.getRequestURL()=="/images/header.png"){
                curres.setContentType("image/png");
+12 −5
Changes for src/httpd.cpp: 12 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -205,11 +205,15 @@ libhttppp::HttpD::HttpD(int argc, char** argv) {
        }else{
            #ifndef Windows
            if (portset == true)
                _ServerSocket = new netplus::tcp(httpaddr, port, maxconnections,-1);
                _ServerSocket = std::make_unique<netplus::tcp>(httpaddr, port, maxconnections,-1);
            else
                _ServerSocket = new netplus::tcp(httpaddr, maxconnections,-1);
                _ServerSocket = std::make_unique<netplus::tcp>(httpaddr, maxconnections,-1);
            #else
<<<<<<< HEAD
                _ServerSocket = new netplus::tcp(httpaddr, port, maxconnections, -1);
=======
            _ServerSocket = std::make_unique<netplus::tcp>(httpaddr, port, maxconnections,-1);
>>>>>>> d052137 (test)
            #endif 
        }

@@ -258,11 +262,15 @@ libhttppp::HttpD::HttpD(const std::string& httpaddr, int port,int maxconnections
        }else{
            #ifndef Windows
            if (port != -1)
                _ServerSocket = new netplus::tcp(httpaddr, port, maxconnections,-1);
                _ServerSocket = std::make_unique<netplus::tcp>(httpaddr, port, maxconnections,-1);
            else
                _ServerSocket = new netplus::tcp(httpaddr, maxconnections,-1);
                _ServerSocket = std::make_unique<netplus::tcp>(httpaddr, maxconnections,-1);
            #else
<<<<<<< HEAD
                _ServerSocket = new netplus::tcp(httpaddr, port, maxconnections,-1);
=======
                _ServerSocket = std::make_unique<netplus::tcp>(httpaddr, port, maxconnections,0);
>>>>>>> d052137 (test)
            #endif
        }
    }catch (netplus::NetException &e) {
@@ -277,5 +285,4 @@ netplus::socket &libhttppp::HttpD::getServerSocket(){
}

libhttppp::HttpD::~HttpD(){
    delete _ServerSocket;
}
+1 −1
Changes for src/httpd.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ namespace libhttppp {
    private:

        bool             _fileServer;
        netplus::socket *_ServerSocket;
        std::unique_ptr<netplus::socket> _ServerSocket;
        HTTPException    _httpexception;
    };
};