http: make llhttp the default

This commit is contained in:
Edward Thomson
2024-04-22 13:44:55 +01:00
parent d396819101
commit d02b549dab
4 changed files with 10 additions and 10 deletions

View File

@@ -24,9 +24,9 @@ elseif(USE_HTTP_PARSER STREQUAL "llhttp")
message(FATAL_ERROR "llhttp support was requested but not found")
endif()
else()
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/http-parser" "${PROJECT_BINARY_DIR}/deps/http-parser")
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/http-parser")
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:http-parser>")
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/llhttp" "${PROJECT_BINARY_DIR}/deps/llhttp")
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/llhttp")
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:llhttp>")
set(GIT_HTTPPARSER_BUILTIN 1)
add_feature_info(http-parser ON "using bundled parser")
endif()

View File

@@ -1,7 +1,7 @@
file(GLOB SRC_HTTP "*.c" "*.h")
list(SORT SRC_HTTP)
file(GLOB SRC_LLHTTP "*.c" "*.h")
list(SORT SRC_LLHTTP)
add_library(llhttp OBJECT ${SRC_HTTP})
add_library(llhttp OBJECT ${SRC_LLHTTP})
if(NOT MSVC)
set_source_files_properties(api.c http.c llhttp.c PROPERTIES COMPILE_FLAGS "-Wno-unused-parameter -Wno-missing-declarations")

View File

@@ -9,7 +9,7 @@
#include <string.h>
#if defined(GIT_HTTPPARSER_HTTPPARSER) || defined(GIT_HTTPPARSER_BUILTIN)
#if defined(GIT_HTTPPARSER_HTTPPARSER)
#include "http_parser.h"
@@ -82,7 +82,7 @@ size_t git_http_parser_execute(
return http_parser_execute(&parser->parser, &settings_proxy, data, len);
}
#elif defined(GIT_HTTPPARSER_LLHTTP)
#elif defined(GIT_HTTPPARSER_LLHTTP) || defined(GIT_HTTPPARSER_BUILTIN)
# include <llhttp.h>

View File

@@ -10,7 +10,7 @@
#include "git2_util.h"
#if defined(GIT_HTTPPARSER_HTTPPARSER) || defined(GIT_HTTPPARSER_BUILTIN)
#if defined(GIT_HTTPPARSER_HTTPPARSER)
# include <http_parser.h>
@@ -60,7 +60,7 @@ size_t git_http_parser_execute(
# define git_http_parser_errno(parser) parser->parser.http_errno
# define git_http_parser_errmsg(parser, errno) http_errno_description(errno)
#elif defined(GIT_HTTPPARSER_LLHTTP)
#elif defined(GIT_HTTPPARSER_LLHTTP) || defined(GIT_HTTPPARSER_BUILTIN)
# include <llhttp.h>