1
0
mirror of synced 2025-04-19 00:24:02 +03:00

1537 Commits

Author SHA1 Message Date
yhirose
9589519d58 Fix #2130 2025-04-17 11:52:22 -04:00
Alexey Sokolov
caf7c55785
Fix regression of #2121 (#2126) 2025-04-08 16:08:41 -04:00
yhirose
9e4aed482e Fix style error 2025-04-06 09:02:25 -04:00
yhirose
65d6316d65 Fix #2113 2025-04-05 22:40:08 -04:00
yhirose
3e3a8cc02f Made the max timeout threshold for SSL longer. 2025-04-05 22:38:50 -04:00
KTGH
b7e33b08f1
Add missing component comment (#2124)
Fix #2123
2025-03-31 20:34:28 -04:00
Alexey Sokolov
0dbe8ba144
Support zstd also via pkg-config (#2121)
* Support zstd also via pkg-config

It doesn't always provide cmake config

* Find zstd with pkg-config also in non-required case

Code by @sum01, slightly modified
2025-03-29 11:46:22 -04:00
Piotr
dbc4af819a
Fix compilation error on windows (#2118)
afunix.h uses types declared in winsock2.h, and so has to be included
after it. Including afunix.h first will result in a somewhat unhelpful
compilation error:

error C3646: 'sun_family': unknown override specifier

Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
2025-03-25 08:36:20 -04:00
yhirose
7dbf5471ce Fix the style error and comment 2025-03-24 19:16:48 -04:00
Piotr
72b35befb2
Add AF_UNIX support on windows (#2115)
Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
2025-03-24 19:14:24 -04:00
Jean-Francois Simoneau
65ce51aed7
Fix start_time shadow variable (#2114) 2025-03-18 19:17:47 -04:00
yhirose
787a34ad7f Release v0.20.0 v0.20.0 2025-03-16 21:24:53 -04:00
yhirose
7a212cfe40 clang-format 2025-03-16 21:22:53 -04:00
Alexandre Bouvier
0be0526085
cmake: only validate component when the required library is found (#2112) 2025-03-16 21:05:55 -04:00
yhirose
87a5ae64a4 Fix #2097 2025-03-16 20:57:17 -04:00
yhirose
33acccb346 Fix #2109 2025-03-16 20:36:15 -04:00
davidalo
c765584e6b
Add zstd support (#2088)
* Add zstd support

* Add zstd to CI tests

* Use use zstd cmake target instead of ZSTD. Use cmake variable for found packages

* Add missing comment for HTTPLIB_REQUIRE_ZSTD

* Fix test.yaml rebase error

* Use zstd::libzstd target

* Add include and library paths to ZSTD args

* Run clang-format

* Add zstd to httplibConfig.cmake.in
2025-03-16 15:51:53 -04:00
yhirose
0bda3a7d1a Update benchmark 2025-03-13 21:54:05 -04:00
Florian Albrechtskirchinger
2eaa2ea64f
Make random_string() thread-safe (#2110)
By making the random engine thread_local, each thread now has its own
independent random sequence, ensuring safe concurrent access.
Additionally, using an immediately invoked lambda expression to
initialize the engine eliminates the need for separate static seed
variables.
2025-03-13 12:44:43 -04:00
Florian Albrechtskirchinger
94a4028821
Update vendored gtest to 1.12.1 (#2100)
Update googletest to the last version supporting C++11.
2025-03-12 12:16:27 -04:00
Florian Albrechtskirchinger
a8d6172250
Avoid static std::string (#2103)
Replace static std::string objects with constexpr character arrays and
use compile-time string length calculations.
2025-03-12 12:12:54 -04:00
Florian Albrechtskirchinger
2f39723d08
Wrap poll()/WSAPoll() in a function and build compiled library on Windows (#2107)
* Wrap poll()/WSAPoll() in a function

Instead of using a macro for poll() on Windows, which breaks when the
implementation is compiled separately, add a detail::poll_wrapper()
function that dispatches to either ::poll() or ::WSAPoll().

* Build compiled library on Windows
2025-03-12 12:12:03 -04:00
Florian Albrechtskirchinger
a9ba0a4dff
Remove SSLInit (#2102)
Quote: "As of version 1.1.0 OpenSSL will automatically allocate all
resources that it needs so no explicit initialisation is required."
2025-03-12 12:10:02 -04:00
Andrea Pappacoda
37399af996
build(meson): copy MountTest.MultibytesPathName files (#2098)
Fixes the test suite in Meson.
2025-03-11 13:10:30 -04:00
yhirose
48084d55f2 Fix #2096 2025-03-10 23:31:51 -04:00
Florian Albrechtskirchinger
5a1ecc3958
Run 32-bit compiled unit tests on Ubuntu (#2095) 2025-03-06 21:17:41 -05:00
Florian Albrechtskirchinger
85b5cdd78d
Move detail::read_file() to test/test.cc (#2092)
The unit test code is the only user of the function.

read_file() now throws an exception if the file isn't found.
2025-03-06 11:58:55 -05:00
Florian Albrechtskirchinger
f2928d7152
Switch redirect tests to httpbingo.org (#2090)
Redirect tests fail using httpbin.org or nghttp2.org/httpbin. The
location header value contains a string representation of a Python byte
string (e.g., b'http://www.google.com/'), which results in a 404 error.
2025-03-06 11:55:11 -05:00
Florian Albrechtskirchinger
ee0bee3907
Fix HttpWatch tests (#2089)
HttpWatch changed the formatting of the returned JSON. Normalize it by
removing all whitespace.
2025-03-06 07:17:05 -05:00
yhirose
71ba7e7b1b
Fix #2068 (#2080)
* Fix #2068

* Add unit test
2025-02-20 23:45:21 -05:00
Florian Albrechtskirchinger
ebe7efa1cc
Parallelize testing with/without SSL on Windows & set concurrency group (#2079)
* Parallelize testing with/without SSL on Windows

* Set concurrency group in workflows
2025-02-20 20:57:18 -05:00
Florian Albrechtskirchinger
22d90c29b4
Remove select() and use poll() (#2078)
* Revert "Fix typo in meson.build (#2070)"

This reverts commit 5c0135fa5d7e059f5dd4c3a1a8a2d767d30ac491.

* Revert "build(meson): automatically use poll or select as needed (#2067)"

This reverts commit 2b5d1eea8d7e9f881ac4be04ce31df782b26b6a9.

* Revert "Make poll() the default (#2065)"

This reverts commit 6e73a63153e936e753211a5608acf336fb848a37.

* Remove select() and use poll()
2025-02-20 18:51:35 -05:00
Florian Albrechtskirchinger
b944f942ee
Correct default thread pool size in README.md (#2077) 2025-02-20 12:59:38 -05:00
Florian Albrechtskirchinger
550f728165
Refactor streams: rename is_* to wait_* for clarity (#2069)
- Replace is_readable() with wait_readable() and is_writable() with
  wait_writable() in the Stream interface.
- Implement a new is_readable() function with semantics that more
  closely reflect its name. It returns immediately whether data is
  available for reading, without waiting.
- Update call sites of is_writable(), removing redundant checks.
2025-02-20 12:56:39 -05:00
yhirose
a4b2c61a65
Max timeout test refactoring (#2071)
* Simplify code

* Adjust threshold
2025-02-19 22:19:02 -05:00
Florian Albrechtskirchinger
5c0135fa5d
Fix typo in meson.build (#2070) 2025-02-19 16:20:44 -05:00
Andrea Pappacoda
2b5d1eea8d
build(meson): automatically use poll or select as needed (#2067)
Follow-up to 6e73a63153e936e753211a5608acf336fb848a37
2025-02-19 12:47:56 -05:00
yhirose
d274c0abe5 Fix typo 2025-02-18 21:33:32 -05:00
yhirose
dda2e007a0 Fixed documentation about Unix Domain Sockt (#2066) 2025-02-18 11:40:50 -05:00
yhirose
321a86d9f2 Add *.dSYM to Makefile clean 2025-02-18 05:56:22 -05:00
yhirose
ada97046a2 Fix misspelled words 2025-02-18 05:54:22 -05:00
Florian Albrechtskirchinger
6e73a63153
Make poll() the default (#2065)
* Make poll() the default

select() can still be enabled by defining CPPHTTPLIB_USE_SELECT.

* Run tests with select() and poll()
2025-02-18 05:23:23 -05:00
Uros Gaber
cdc223019a
server_certificate_verifier extended to reuse built-in verifier (#2064)
* server_certificate_verifier extended to reuse built-in verifier

* code cleanup and SSLVerifierResponse enum clarification as per @falbrechtskirchinger comment

* cleanup

* clang-format

* change local var verification_status_ declaration to auto

* change local var verification_status_ to verification_status

* clang-format

* clang-format

---------

Co-authored-by: UrosG <uros@ub330.net>
2025-02-17 17:24:41 -05:00
Florian Albrechtskirchinger
574f5ce93e
Add style check to workflow (#2062)
* Add style check to workflow

* Add example files to style check
2025-02-17 12:14:53 -05:00
Florian Albrechtskirchinger
2996cecee0
Fix code inconsistently formatted and re-format (#2063)
* Fix code inconsistently formatted by clang-format

* Run clang-format
2025-02-17 12:14:02 -05:00
Florian Albrechtskirchinger
32bf5c9c09
Simplify SSL shutdown (#2059) 2025-02-16 17:38:41 -05:00
Florian Albrechtskirchinger
735e5930eb
Detect additional CMake build failures (#2058)
Add include_httplib.cc to the main test executable (already done in
Makefile), and add include_windows_h.cc to the main test executable on
Windows to test if including windows.h conflicts with httplib.h.
2025-02-16 15:45:28 -05:00
Florian Albrechtskirchinger
748f47b377
Add workflow_dispatch with Google Test filter and OS selection (#2056)
* Add workflow_dispatch with Google Test filter

Add the workflow_dispatch trigger to the test.yaml workflow. Includes an
input for an optional Google Test filter pattern.

* Add OS selection to workflow_dispatch

* Fix wording
2025-02-16 12:34:28 -05:00
Florian Albrechtskirchinger
4cb8ff9f90
Print timeout exceedance in MaxTimeoutTest (#2060) 2025-02-16 08:43:54 -05:00
Florian Albrechtskirchinger
985cd9f6a2
Fix compilation failures with include <windows.h> (#2057) 2025-02-16 08:39:29 -05:00