update domo
This commit is contained in:
@@ -23,17 +23,25 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// This is an independent project of an individual developer. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com
|
||||
|
||||
/*------------------------------- INCLUDES ----------------------------------*/
|
||||
|
||||
#include "CivetServer.h"
|
||||
|
||||
#include "web/handler/exit-handler.h"
|
||||
|
||||
#include "web-server.h"
|
||||
|
||||
#define EXIT_URI "/exit"
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn WebServer
|
||||
*
|
||||
* @brief Constructor of the Web Server Object.
|
||||
*/
|
||||
|
||||
WebServer::WebServer(void)
|
||||
WebServer::WebServer(void) : m_server(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -45,4 +53,26 @@ WebServer::WebServer(void)
|
||||
|
||||
WebServer::~WebServer(void)
|
||||
{
|
||||
delete m_server;
|
||||
}
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn setup
|
||||
*
|
||||
* @brief Setup the Web server
|
||||
*/
|
||||
int WebServer::setup(const char *a_document_root, const char *a_port, struct event_base *an_evt_loop)
|
||||
{
|
||||
std::vector<std::string> the_options;
|
||||
|
||||
the_options.push_back("document_root");
|
||||
the_options.push_back(a_document_root);
|
||||
the_options.push_back("listening_ports");
|
||||
the_options.push_back(a_port);
|
||||
|
||||
m_server = new CivetServer(the_options);
|
||||
|
||||
m_server->addHandler(EXIT_URI, new ExitHandler(an_evt_loop));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user