From 4962a3b1d7643cfe0391e4b8eb897d7e002372ab Mon Sep 17 00:00:00 2001 From: yizhinailong Date: Wed, 26 Aug 2026 23:03:04 +0800 Subject: [PATCH 1/2] feat: add brotli example to test suite - include tests/examples/brotli in the members list of mcpp.toml - enables testing for brotli library integration --- mcpp.toml | 1 + pkgs/c/compat.brotli.lua | 56 +++++++++++++++++++++++ tests/examples/brotli/mcpp.toml | 8 ++++ tests/examples/brotli/tests/roundtrip.cpp | 43 +++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 pkgs/c/compat.brotli.lua create mode 100644 tests/examples/brotli/mcpp.toml create mode 100644 tests/examples/brotli/tests/roundtrip.cpp diff --git a/mcpp.toml b/mcpp.toml index 38ca572..e29f7d6 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -17,6 +17,7 @@ members = [ "tests/examples/boost-throw-exception", "tests/examples/boost-type-traits", "tests/examples/boost-uuid", + "tests/examples/brotli", "tests/examples/build-mcpp", "tests/examples/c-ares", "tests/examples/catch2", diff --git a/pkgs/c/compat.brotli.lua b/pkgs/c/compat.brotli.lua new file mode 100644 index 0000000..0a6ad5d --- /dev/null +++ b/pkgs/c/compat.brotli.lua @@ -0,0 +1,56 @@ +-- Form B C-source compat descriptor for Brotli. The three source globs match +-- upstream v1.2.0's BROTLI_COMMON_SOURCES, BROTLI_DEC_SOURCES, and +-- BROTLI_ENC_SOURCES CMake sets; the CLI, tests, fuzzers, and the optional C++ +-- lazy static-initialization implementation are outside those sets. +package = { + spec = "1", + namespace = "compat", + name = "brotli", + description = "Brotli compression library", + licenses = {"MIT"}, + repo = "https://github.com/google/brotli", + type = "package", + + xpm = { + linux = { + ["1.2.0"] = { + url = "https://github.com/google/brotli/archive/refs/tags/v1.2.0.tar.gz", + sha256 = "816c96e8e8f193b40151dad7e8ff37b1221d019dbcb9c35cd3fadbfe6477dfec", + }, + }, + macosx = { + ["1.2.0"] = { + url = "https://github.com/google/brotli/archive/refs/tags/v1.2.0.tar.gz", + sha256 = "816c96e8e8f193b40151dad7e8ff37b1221d019dbcb9c35cd3fadbfe6477dfec", + }, + }, + windows = { + ["1.2.0"] = { + url = "https://github.com/google/brotli/archive/refs/tags/v1.2.0.tar.gz", + sha256 = "816c96e8e8f193b40151dad7e8ff37b1221d019dbcb9c35cd3fadbfe6477dfec", + }, + }, + }, + + mcpp = { + language = "c++23", + import_std = false, + c_standard = "c11", + include_dirs = { "*/c/include" }, + sources = { + "*/c/common/*.c", + "*/c/dec/*.c", + "*/c/enc/*.c", + }, + targets = { ["brotli"] = { kind = "lib" } }, + deps = {}, + + -- Upstream detects libm and propagates it for static builds. + linux = { ldflags = { "-lm" } }, + macosx = { ldflags = { "-lm" } }, + windows = { + -- This is upstream's only MSVC-specific library definition. + cflags = { "-D_CRT_SECURE_NO_WARNINGS" }, + }, + }, +} diff --git a/tests/examples/brotli/mcpp.toml b/tests/examples/brotli/mcpp.toml new file mode 100644 index 0000000..792e872 --- /dev/null +++ b/tests/examples/brotli/mcpp.toml @@ -0,0 +1,8 @@ +# Brotli test project: consumes compat.brotli through the workspace-root +# `compat` index redirect and exercises encoder, decoder, and common code. +[package] +name = "brotli-tests" +version = "0.1.0" + +[dependencies.compat] +brotli = "1.2.0" diff --git a/tests/examples/brotli/tests/roundtrip.cpp b/tests/examples/brotli/tests/roundtrip.cpp new file mode 100644 index 0000000..33781e8 --- /dev/null +++ b/tests/examples/brotli/tests/roundtrip.cpp @@ -0,0 +1,43 @@ +#include +#include + +#include +#include +#include + +int main() { + static constexpr unsigned char original[] = + "Brotli round-trip payload. Brotli round-trip payload. " + "Brotli round-trip payload. Brotli round-trip payload."; + constexpr std::size_t original_size = sizeof(original) - 1; + + const std::size_t encoded_capacity = BrotliEncoderMaxCompressedSize(original_size); + if (original_size == 0 || encoded_capacity == 0) return 1; + + std::vector encoded(encoded_capacity); + std::size_t encoded_size = encoded.size(); + const BROTLI_BOOL encoded_ok = BrotliEncoderCompress( + BROTLI_DEFAULT_QUALITY, + BROTLI_DEFAULT_WINDOW, + BROTLI_MODE_GENERIC, + original_size, + original, + &encoded_size, + encoded.data()); + if (encoded_ok != BROTLI_TRUE || encoded_size == 0) return 2; + + std::vector decoded(original_size); + std::size_t decoded_size = decoded.size(); + const BrotliDecoderResult decoded_result = BrotliDecoderDecompress( + encoded_size, + encoded.data(), + &decoded_size, + decoded.data()); + if (decoded_result != BROTLI_DECODER_RESULT_SUCCESS) return 3; + if (decoded_size != original_size) return 4; + + for (std::size_t i = 0; i < original_size; ++i) { + if (decoded[i] != original[i]) return 5; + } + return std::memcmp(decoded.data(), original, original_size) == 0 ? 0 : 6; +} From 2a44e1f20794aeee0f84d204741900402b19c197 Mon Sep 17 00:00:00 2001 From: yizhinailong Date: Thu, 27 Aug 2026 13:06:29 +0800 Subject: [PATCH 2/2] feat: add httplib - Add httplib example project - Add httplib-brotli example project - Add httplib-no-exceptions example project - Add httplib-tls example project - Add httplib-zlib example project - Add httplib-zstd example project --- mcpp.toml | 6 ++ pkgs/c/compat.httplib.lua | 89 +++++++++++++++++++ tests/examples/httplib-brotli/mcpp.toml | 6 ++ .../examples/httplib-brotli/tests/brotli.cpp | 7 ++ .../examples/httplib-no-exceptions/mcpp.toml | 6 ++ .../tests/no_exceptions.cpp | 19 ++++ tests/examples/httplib-tls/mcpp.toml | 6 ++ tests/examples/httplib-tls/tests/tls.cpp | 53 +++++++++++ tests/examples/httplib-zlib/mcpp.toml | 6 ++ tests/examples/httplib-zlib/tests/zlib.cpp | 7 ++ tests/examples/httplib-zstd/mcpp.toml | 6 ++ tests/examples/httplib-zstd/tests/zstd.cpp | 7 ++ tests/examples/httplib/mcpp.toml | 6 ++ tests/examples/httplib/tests/http.cpp | 40 +++++++++ tests/fixtures/httplib_compression_case.hpp | 65 ++++++++++++++ tests/fixtures/httplib_localhost_pem.hpp | 57 ++++++++++++ 16 files changed, 386 insertions(+) create mode 100644 pkgs/c/compat.httplib.lua create mode 100644 tests/examples/httplib-brotli/mcpp.toml create mode 100644 tests/examples/httplib-brotli/tests/brotli.cpp create mode 100644 tests/examples/httplib-no-exceptions/mcpp.toml create mode 100644 tests/examples/httplib-no-exceptions/tests/no_exceptions.cpp create mode 100644 tests/examples/httplib-tls/mcpp.toml create mode 100644 tests/examples/httplib-tls/tests/tls.cpp create mode 100644 tests/examples/httplib-zlib/mcpp.toml create mode 100644 tests/examples/httplib-zlib/tests/zlib.cpp create mode 100644 tests/examples/httplib-zstd/mcpp.toml create mode 100644 tests/examples/httplib-zstd/tests/zstd.cpp create mode 100644 tests/examples/httplib/mcpp.toml create mode 100644 tests/examples/httplib/tests/http.cpp create mode 100644 tests/fixtures/httplib_compression_case.hpp create mode 100644 tests/fixtures/httplib_localhost_pem.hpp diff --git a/mcpp.toml b/mcpp.toml index e29f7d6..6f3644c 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -98,6 +98,12 @@ members = [ "tests/examples/magic_enum", "tests/examples/mimalloc", "tests/examples/harfbuzz", + "tests/examples/httplib", + "tests/examples/httplib-brotli", + "tests/examples/httplib-no-exceptions", + "tests/examples/httplib-tls", + "tests/examples/httplib-zlib", + "tests/examples/httplib-zstd", "tests/examples/msdfgen", "tests/examples/gtl", "tests/examples/miniaudio", diff --git a/pkgs/c/compat.httplib.lua b/pkgs/c/compat.httplib.lua new file mode 100644 index 0000000..f11223a --- /dev/null +++ b/pkgs/c/compat.httplib.lua @@ -0,0 +1,89 @@ +-- Form B header-only descriptor for cpp-httplib. Optional backends stay off +-- unless a consumer requests the corresponding mcpp feature. +package = { + spec = "1", + namespace = "compat", + name = "httplib", + description = "C++ single-header HTTP/HTTPS server and client library", + licenses = {"MIT"}, + repo = "https://github.com/yhirose/cpp-httplib", + type = "package", + + xpm = { + -- No mcpp-res credentials are available in this environment. Keep the + -- GLOBAL URL as a plain string until a byte-identical CN asset exists. + linux = { + ["0.53.1"] = { + url = "https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.53.1.tar.gz", + sha256 = "185af9587e270de9a3bfee234c6740f02e82265da33c7a41f97e02ee42f979d2", + }, + }, + macosx = { + ["0.53.1"] = { + url = "https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.53.1.tar.gz", + sha256 = "185af9587e270de9a3bfee234c6740f02e82265da33c7a41f97e02ee42f979d2", + }, + }, + windows = { + ["0.53.1"] = { + url = "https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.53.1.tar.gz", + sha256 = "185af9587e270de9a3bfee234c6740f02e82265da33c7a41f97e02ee42f979d2", + }, + }, + }, + + mcpp = { + language = "c++23", + import_std = false, + include_dirs = { "*" }, + generated_files = { + ["mcpp_generated/compat_httplib_anchor.cpp"] = + "int mcpp_compat_httplib_anchor(void) { return 0; }\n", + }, + sources = { "mcpp_generated/compat_httplib_anchor.cpp" }, + targets = { ["httplib"] = { kind = "lib" } }, + + -- Feature defines are interface requirements for this header-only + -- package: cpp-httplib's implementation is compiled in consumer TUs. + features = { + ["tls"] = { + defines = { "CPPHTTPLIB_OPENSSL_SUPPORT" }, + deps = { ["compat.openssl"] = "3.5.1" }, + }, + ["zlib"] = { + defines = { "CPPHTTPLIB_ZLIB_SUPPORT" }, + deps = { ["compat.zlib"] = "1.3.2" }, + }, + ["brotli"] = { + defines = { "CPPHTTPLIB_BROTLI_SUPPORT" }, + deps = { ["compat.brotli"] = "1.2.0" }, + }, + ["zstd"] = { + defines = { "CPPHTTPLIB_ZSTD_SUPPORT" }, + deps = { ["compat.zstd"] = "1.5.7" }, + }, + ["no-exceptions"] = { + defines = { "CPPHTTPLIB_NO_EXCEPTIONS" }, + }, + }, + deps = {}, + + -- Feature entries cannot carry platform-local ldflags. These are the + -- upstream target's system link requirements; unused system libraries + -- and frameworks are harmless for feature-free consumers. + linux = { + ldflags = { "-lpthread" }, + }, + macosx = { + ldflags = { + "-lpthread", + "-framework", "CFNetwork", + "-framework", "CoreFoundation", + "-framework", "Security", + }, + }, + windows = { + ldflags = { "-lws2_32", "-lcrypt32" }, + }, + }, +} diff --git a/tests/examples/httplib-brotli/mcpp.toml b/tests/examples/httplib-brotli/mcpp.toml new file mode 100644 index 0000000..ad9d9a4 --- /dev/null +++ b/tests/examples/httplib-brotli/mcpp.toml @@ -0,0 +1,6 @@ +[package] +name = "httplib-brotli-tests" +version = "0.1.0" + +[dependencies.compat] +httplib = { version = "0.53.1", features = ["brotli"] } diff --git a/tests/examples/httplib-brotli/tests/brotli.cpp b/tests/examples/httplib-brotli/tests/brotli.cpp new file mode 100644 index 0000000..8507600 --- /dev/null +++ b/tests/examples/httplib-brotli/tests/brotli.cpp @@ -0,0 +1,7 @@ +#ifndef CPPHTTPLIB_BROTLI_SUPPORT +#error "compat.httplib[brotli] must define CPPHTTPLIB_BROTLI_SUPPORT in consumers" +#endif + +#define MCPP_HTTPLIB_FEATURE_NAME "brotli" +#define MCPP_HTTPLIB_ENCODING "br" +#include "../../../fixtures/httplib_compression_case.hpp" diff --git a/tests/examples/httplib-no-exceptions/mcpp.toml b/tests/examples/httplib-no-exceptions/mcpp.toml new file mode 100644 index 0000000..01ea560 --- /dev/null +++ b/tests/examples/httplib-no-exceptions/mcpp.toml @@ -0,0 +1,6 @@ +[package] +name = "httplib-no-exceptions-tests" +version = "0.1.0" + +[dependencies.compat] +httplib = { version = "0.53.1", features = ["no-exceptions"] } diff --git a/tests/examples/httplib-no-exceptions/tests/no_exceptions.cpp b/tests/examples/httplib-no-exceptions/tests/no_exceptions.cpp new file mode 100644 index 0000000..855b91c --- /dev/null +++ b/tests/examples/httplib-no-exceptions/tests/no_exceptions.cpp @@ -0,0 +1,19 @@ +#ifndef CPPHTTPLIB_NO_EXCEPTIONS +#error "compat.httplib[no-exceptions] must define CPPHTTPLIB_NO_EXCEPTIONS in consumers" +#endif + +#include + +#include + +int main() { + // Without CPPHTTPLIB_NO_EXCEPTIONS this constructor throws for an invalid + // scheme. The feature changes it into a normal invalid client result. + httplib::Client invalid("ftp://127.0.0.1:1"); + if (invalid.is_valid()) return 1; + + httplib::Headers headers; + const char *prohibited = httplib::detail::get_header_value( + headers, "REMOTE_ADDR", "missing", 0); + return prohibited != nullptr && prohibited[0] == '\0' ? 0 : 2; +} diff --git a/tests/examples/httplib-tls/mcpp.toml b/tests/examples/httplib-tls/mcpp.toml new file mode 100644 index 0000000..b04ce82 --- /dev/null +++ b/tests/examples/httplib-tls/mcpp.toml @@ -0,0 +1,6 @@ +[package] +name = "httplib-tls-tests" +version = "0.1.0" + +[dependencies.compat] +httplib = { version = "0.53.1", features = ["tls"] } diff --git a/tests/examples/httplib-tls/tests/tls.cpp b/tests/examples/httplib-tls/tests/tls.cpp new file mode 100644 index 0000000..2c0d0e5 --- /dev/null +++ b/tests/examples/httplib-tls/tests/tls.cpp @@ -0,0 +1,53 @@ +#ifndef CPPHTTPLIB_OPENSSL_SUPPORT +#error "compat.httplib[tls] must define CPPHTTPLIB_OPENSSL_SUPPORT in consumers" +#endif + +#include + +#include "../../../fixtures/httplib_localhost_pem.hpp" + +#include +#include +#include +#include + +int main() { + httplib::SSLServer::PemMemory pem{ + kHttplibCertificatePem, + std::strlen(kHttplibCertificatePem), + kHttplibPrivateKeyPem, + std::strlen(kHttplibPrivateKeyPem), + nullptr, + 0, + nullptr, + }; + httplib::SSLServer server(pem); + if (!server.is_valid()) return 1; + + const std::string expected = "certificate-validated HTTPS response"; + std::atomic handled{false}; + server.Get("/secure", [&](const httplib::Request &req, httplib::Response &res) { + handled = req.method == "GET" && req.path == "/secure"; + res.set_content(expected, "text/plain"); + }); + + const int port = server.bind_to_any_port("127.0.0.1"); + if (port <= 0) return 2; + std::thread server_thread([&] { server.listen_after_bind(); }); + + httplib::SSLClient client("localhost", port); + client.enable_system_ca(false); + client.load_ca_cert_store(kHttplibCertificatePem, + std::strlen(kHttplibCertificatePem)); + client.set_connection_timeout(8, 0); + client.set_read_timeout(8, 0); + const auto result = client.Get("/secure"); + + const bool ok = result && result->status == httplib::StatusCode::OK_200 && + result->get_header_value("Content-Type") == "text/plain" && + result->body == expected && handled.load(); + + server.stop(); + server_thread.join(); + return ok ? 0 : 3; +} diff --git a/tests/examples/httplib-zlib/mcpp.toml b/tests/examples/httplib-zlib/mcpp.toml new file mode 100644 index 0000000..e557f6b --- /dev/null +++ b/tests/examples/httplib-zlib/mcpp.toml @@ -0,0 +1,6 @@ +[package] +name = "httplib-zlib-tests" +version = "0.1.0" + +[dependencies.compat] +httplib = { version = "0.53.1", features = ["zlib"] } diff --git a/tests/examples/httplib-zlib/tests/zlib.cpp b/tests/examples/httplib-zlib/tests/zlib.cpp new file mode 100644 index 0000000..683ef19 --- /dev/null +++ b/tests/examples/httplib-zlib/tests/zlib.cpp @@ -0,0 +1,7 @@ +#ifndef CPPHTTPLIB_ZLIB_SUPPORT +#error "compat.httplib[zlib] must define CPPHTTPLIB_ZLIB_SUPPORT in consumers" +#endif + +#define MCPP_HTTPLIB_FEATURE_NAME "zlib" +#define MCPP_HTTPLIB_ENCODING "gzip" +#include "../../../fixtures/httplib_compression_case.hpp" diff --git a/tests/examples/httplib-zstd/mcpp.toml b/tests/examples/httplib-zstd/mcpp.toml new file mode 100644 index 0000000..cf588ca --- /dev/null +++ b/tests/examples/httplib-zstd/mcpp.toml @@ -0,0 +1,6 @@ +[package] +name = "httplib-zstd-tests" +version = "0.1.0" + +[dependencies.compat] +httplib = { version = "0.53.1", features = ["zstd"] } diff --git a/tests/examples/httplib-zstd/tests/zstd.cpp b/tests/examples/httplib-zstd/tests/zstd.cpp new file mode 100644 index 0000000..47fefdf --- /dev/null +++ b/tests/examples/httplib-zstd/tests/zstd.cpp @@ -0,0 +1,7 @@ +#ifndef CPPHTTPLIB_ZSTD_SUPPORT +#error "compat.httplib[zstd] must define CPPHTTPLIB_ZSTD_SUPPORT in consumers" +#endif + +#define MCPP_HTTPLIB_FEATURE_NAME "zstd" +#define MCPP_HTTPLIB_ENCODING "zstd" +#include "../../../fixtures/httplib_compression_case.hpp" diff --git a/tests/examples/httplib/mcpp.toml b/tests/examples/httplib/mcpp.toml new file mode 100644 index 0000000..0a16701 --- /dev/null +++ b/tests/examples/httplib/mcpp.toml @@ -0,0 +1,6 @@ +[package] +name = "httplib-tests" +version = "0.1.0" + +[dependencies.compat] +httplib = "0.53.1" diff --git a/tests/examples/httplib/tests/http.cpp b/tests/examples/httplib/tests/http.cpp new file mode 100644 index 0000000..e3f25dd --- /dev/null +++ b/tests/examples/httplib/tests/http.cpp @@ -0,0 +1,40 @@ +#include + +#include +#include +#include + +#if defined(CPPHTTPLIB_OPENSSL_SUPPORT) || defined(CPPHTTPLIB_ZLIB_SUPPORT) || \ + defined(CPPHTTPLIB_BROTLI_SUPPORT) || defined(CPPHTTPLIB_ZSTD_SUPPORT) || \ + defined(CPPHTTPLIB_NO_EXCEPTIONS) +#error "compat.httplib enables no optional feature by default" +#endif + +int main() { + const std::string expected = R"({"package":"compat.httplib","ok":true})"; + std::atomic handled{false}; + + httplib::Server server; + server.Get("/status", [&](const httplib::Request &req, httplib::Response &res) { + handled = req.method == "GET" && req.path == "/status"; + res.set_content(expected, "application/json"); + }); + + const int port = server.bind_to_any_port("127.0.0.1"); + if (port <= 0) return 1; + + std::thread server_thread([&] { server.listen_after_bind(); }); + + httplib::Client client("127.0.0.1", port); + client.set_connection_timeout(5, 0); + client.set_read_timeout(5, 0); + const auto result = client.Get("/status"); + + const bool ok = result && result->status == httplib::StatusCode::OK_200 && + result->get_header_value("Content-Type") == "application/json" && + result->body == expected && handled.load(); + + server.stop(); + server_thread.join(); + return ok ? 0 : 2; +} diff --git a/tests/fixtures/httplib_compression_case.hpp b/tests/fixtures/httplib_compression_case.hpp new file mode 100644 index 0000000..9e2dc6b --- /dev/null +++ b/tests/fixtures/httplib_compression_case.hpp @@ -0,0 +1,65 @@ +#ifndef MCPP_INDEX_HTTPLIB_COMPRESSION_CASE_HPP +#define MCPP_INDEX_HTTPLIB_COMPRESSION_CASE_HPP + +#if !defined(MCPP_HTTPLIB_FEATURE_NAME) || !defined(MCPP_HTTPLIB_ENCODING) +#error "compression test wrapper must name its feature and HTTP encoding" +#endif + +#include + +#include +#include +#include +#include +#include + +int main() { + std::string payload; + payload.reserve(128 * 1024); + for (int i = 0; i < 2048; ++i) { + payload += "mcpp compat.httplib compression feature payload: "; + payload += MCPP_HTTPLIB_FEATURE_NAME; + payload += "\n"; + } + + std::atomic accepted_encoding{false}; + httplib::Server server; + server.Get("/compressed", [&](const httplib::Request &req, httplib::Response &res) { + accepted_encoding = + req.get_header_value("Accept-Encoding").find(MCPP_HTTPLIB_ENCODING) != + std::string::npos; + res.set_content(payload, "text/plain"); + }); + + const int port = server.bind_to_any_port("127.0.0.1"); + if (port <= 0) return 1; + + std::thread server_thread([&] { server.listen_after_bind(); }); + + httplib::Client client("127.0.0.1", port); + client.set_connection_timeout(5, 0); + client.set_read_timeout(5, 0); + const httplib::Headers headers{{"Accept-Encoding", MCPP_HTTPLIB_ENCODING}}; + const auto result = client.Get("/compressed", headers); + + bool compressed_on_wire = false; + bool ok = result && result->status == httplib::StatusCode::OK_200 && + result->get_header_value("Content-Type") == "text/plain" && + result->get_header_value("Content-Encoding") == MCPP_HTTPLIB_ENCODING && + result->body == payload && accepted_encoding.load(); + if (result) { + const auto length_text = result->get_header_value("Content-Length"); + std::size_t wire_length = 0; + const auto parsed = std::from_chars( + length_text.data(), length_text.data() + length_text.size(), wire_length); + compressed_on_wire = parsed.ec == std::errc{} && + parsed.ptr == length_text.data() + length_text.size() && + wire_length < payload.size() / 4; + } + + server.stop(); + server_thread.join(); + return ok && compressed_on_wire ? 0 : 2; +} + +#endif diff --git a/tests/fixtures/httplib_localhost_pem.hpp b/tests/fixtures/httplib_localhost_pem.hpp new file mode 100644 index 0000000..8b252e9 --- /dev/null +++ b/tests/fixtures/httplib_localhost_pem.hpp @@ -0,0 +1,57 @@ +#ifndef MCPP_INDEX_HTTPLIB_LOCALHOST_PEM_HPP +#define MCPP_INDEX_HTTPLIB_LOCALHOST_PEM_HPP + +// Test-only self-signed certificate for localhost and 127.0.0.1. It is valid +// from 2026-08-24 through 2036-08-21 and never leaves loopback tests. +constexpr const char *kHttplibCertific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