Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,30 @@ target_link_libraries(
${PYTHON_LIBRARIES}
${Boost_LIBRARIES}
nlohmann_json::nlohmann_json
libhttp
httpparser
)

# add custom targets
add_custom_target(
ProjectHeaderFiles
SOURCES
./src/Helper.hpp
./src//Global.hpp
./src//Server.hpp
./src//Client.hpp
./src//Filesystem.hpp
./src//Configuration.hpp
./src//MemoryManager.hpp
./src//ThreadHandler.hpp
./src//IPCHandler.hpp
./src//IPCHandlerAS.hpp
./src//ClientHandler.hpp
./src//ASProcessHandler.hpp
./src//ASRequestHandler.hpp
./src//ResultProcessor.hpp
./src//ResultOrder.hpp
./src//Constant.hpp
./src//Vector.hpp
./src/Global.hpp
./src/Server.hpp
./src/Client.hpp
./src/Filesystem.hpp
./src/Configuration.hpp
./src/MemoryManager.hpp
./src/ThreadHandler.hpp
./src/IPCHandler.hpp
./src/IPCHandlerAS.hpp
./src/ClientHandler.hpp
./src/ASProcessHandler.hpp
./src/ASRequestHandler.hpp
./src/ResultProcessor.hpp
./src/ResultOrder.hpp
./src/Constant.hpp
./src/Vector.hpp
)

# add subdirs
Expand Down
23 changes: 13 additions & 10 deletions lib/http/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# find boost::python
find_package(Boost 1.74 REQUIRED COMPONENTS regex)

# add source dir
aux_source_directory(. SRC_LIST_LIBHTTP)

# add library
add_library(libhttp STATIC ${SRC_LIST_LIBHTTP})
add_library(httpparser STATIC ${SRC_LIST_LIBHTTP})

# add lib parser and network
add_custom_target(
libhttpheader
httpparserheader
SOURCES
./httpparser.hpp
./httpnet.hpp
)

# set target link libraries
target_link_libraries(libhttp ${Boost_LIBRARIES})
# install static .a library
install(
TARGETS httpparser
LIBRARY DESTINATION /usr/local/lib
)

# install
install(TARGETS libhttp DESTINATION lib)
# install header file
install(
FILES
./httpparser.hpp
DESTINATION /usr/local/include
)
35 changes: 35 additions & 0 deletions lib/http/httpconstants.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#pragma once

#include <string>
#include <vector>
#include <stdint.h>

//- constant expressions
constexpr uint16_t HTTP_VERSION_UNKNOWN = 0;
constexpr uint16_t HTTP_VERSION_1_1 = 1;

constexpr uint16_t HTTP_METHOD_OTHER = 0;
constexpr uint16_t HTTP_METHOD_GET = 1;
constexpr uint16_t HTTP_METHOD_POST = 2;

constexpr uint16_t HTTP_POST_MAX_CONTENT_LENGTH = 4096;

constexpr uint16_t URL_PARAM_NOT_FOUND_ERROR = 10;

//- constant expressions (error)
constexpr uint16_t HTTP_ERROR_PARSE_BUFFER_EXCEEDED = 10;
constexpr uint16_t HTTP_ERROR_BAD_REQUEST = 400;

//- contant strings
static const std::string HTTP_1_1_END_MARKER("\r\n\r\n");
static const std::string HTTP_HEADER_CONTENT_LENGTH("Content-Length");

//- contant multidimensional
static const std::vector<std::string> HTTPHeaderTypes
{
"Host",
"Transfer-Encoding",
"If-None-Match",
"Content-Type",
HTTP_HEADER_CONTENT_LENGTH
};
15 changes: 0 additions & 15 deletions lib/http/httpnet.cpp

This file was deleted.

26 changes: 0 additions & 26 deletions lib/http/httpnet.hpp

This file was deleted.

Loading
Loading