From bdd4c01fd6f3ca3519d2159970cdd712c4c00a35 Mon Sep 17 00:00:00 2001 From: uchenily Date: Sat, 8 Jun 2024 19:22:02 +0800 Subject: [PATCH] Revert "Add llhttp to subprojects" This reverts commit 75d36589458a1a484aa0ca6445296ae86a4e3164. --- meson.build | 2 -- subprojects/llhttp.wrap | 10 ------ subprojects/packagefiles/llhttp/meson.build | 40 --------------------- tests/meson.build | 1 - tests/test_llhttp.cpp | 34 ------------------ 5 files changed, 87 deletions(-) delete mode 100644 subprojects/llhttp.wrap delete mode 100644 subprojects/packagefiles/llhttp/meson.build delete mode 100644 tests/test_llhttp.cpp diff --git a/meson.build b/meson.build index bef7bcc..04bf025 100644 --- a/meson.build +++ b/meson.build @@ -14,7 +14,6 @@ includes = include_directories('.') cpp = meson.get_compiler('cpp') libuv_dep = dependency('libuv') libbfd_dep = cpp.find_library('bfd', required: false) -llhttp_dep = dependency('llhttp') curl_dep = cpp.find_library('curl', required: false) if curl_dep.found() compile_args += '-DHAS_CURL' @@ -26,7 +25,6 @@ endif dependencies = [] dependencies += libuv_dep -dependencies += llhttp_dep if libbfd_dep.found() dependencies += libbfd_dep diff --git a/subprojects/llhttp.wrap b/subprojects/llhttp.wrap deleted file mode 100644 index 1cde87f..0000000 --- a/subprojects/llhttp.wrap +++ /dev/null @@ -1,10 +0,0 @@ -[wrap-file] -directory = llhttp-release-v9.2.1 -source_url = https://github.com/nodejs/llhttp/archive/refs/tags/release/v9.2.1.tar.gz -source_filename = llhttp-9.2.1.tar.gz -source_hash = 3c163891446e529604b590f9ad097b2e98b5ef7e4d3ddcf1cf98b62ca668f23e -patch_directory = llhttp -# diff_files = llhttp/libllhttp.patch - -[provide] -llhttp = llhttp_dep diff --git a/subprojects/packagefiles/llhttp/meson.build b/subprojects/packagefiles/llhttp/meson.build deleted file mode 100644 index 67386bf..0000000 --- a/subprojects/packagefiles/llhttp/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -project('llhttp', 'c', version: '9.2.1', license: 'MIT') - -llhttp_include = include_directories('include') -c_args = [] -llhttp_deps = [] - -config_data = configuration_data() -config_data.set('CMAKE_INSTALL_PREFIX', get_option('prefix')) -config_data.set('CMAKE_INSTALL_LIBDIR', get_option('libdir')) -config_data.set('CMAKE_INSTALL_INCLUDEDIR', get_option('includedir')) -config_data.set('PROJECT_VERSION', meson.project_version()) - -configure_file( - input: 'libllhttp.pc.in', - output: 'libllhttp.pc', - configuration: config_data, - install_dir: get_option('libdir') / 'pkgconfig', - install: true, -) - -llhttp_src = files( - 'src/api.c', - 'src/http.c', - 'src/llhttp.c', -) - -llhttp_lib = library('llhttp', llhttp_src, - include_directories: llhttp_include, - dependencies: llhttp_deps, - c_args: c_args, - install: true, -) - -llhttp_dep = declare_dependency( - include_directories: llhttp_include, - link_with: llhttp_lib, - dependencies: llhttp_deps, -) - -install_headers('include/llhttp.h') diff --git a/tests/meson.build b/tests/meson.build index 9947368..fc3556d 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -17,7 +17,6 @@ all_tests_sources = [ 'test_buffered.cpp', 'test_buffered2.cpp', 'test_coredump.cpp', - 'test_llhttp.cpp', 'test_caseinsensitive.cpp', ] diff --git a/tests/test_llhttp.cpp b/tests/test_llhttp.cpp deleted file mode 100644 index ac02a22..0000000 --- a/tests/test_llhttp.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "uvio/debug.hpp" - -#include "llhttp.h" - -auto main() -> int { - llhttp_t parser; - llhttp_settings_t settings; - - /*Initialize user callbacks and settings */ - llhttp_settings_init(&settings); - - /*Set user callback */ - settings.on_message_complete = [](llhttp_t * /*parser*/) -> int { - LOG_INFO("Message completed!"); - return 0; - }; - - /*Initialize the parser in HTTP_BOTH mode, meaning that it will select - *between HTTP_REQUEST and HTTP_RESPONSE parsing automatically while reading - *the first input. - */ - llhttp_init(&parser, HTTP_BOTH, &settings); - - /*Parse request! */ - std::string request - = "POST / HTTP/1.1\r\nContent-Length: 11\r\n\r\nhello world"; - - auto err = llhttp_execute(&parser, request.data(), request.size()); - if (err == HPE_OK) { - LOG_INFO("Successfully parsed!"); - } else { - LOG_INFO("Parse error: {} {}", llhttp_errno_name(err), parser.reason); - } -}