1
0
mirror of synced 2025-04-24 21:07:01 +03:00

1159 Commits

Author SHA1 Message Date
yhirose
f4b02dfdc1 Fix #1533 2023-03-25 21:13:07 -04:00
yhirose
4cf218643e Code format 2023-03-25 21:12:40 -04:00
yhirose
8f96b69a25 Update test.yaml to use microsoft/setup-msbuild@v1.1 2023-03-23 18:53:27 -04:00
Johannes Flügel
d262033ded
Prevent overflow in hash function str2tag_core() (#1529)
* str2tag_core(): prevent overflow

* Update httplib.h

works for all sizes of unsigned int and if there exists a #define for max
2023-03-22 14:16:32 -04:00
yhirose
5745eabe69 Updated test.yaml to use ctions/checkout@v3 2023-03-21 18:54:54 -04:00
yhirose
5f18642271 Close #1531 2023-03-20 11:47:06 -04:00
yhirose
88a9278872 Fix #1486 2023-03-11 17:04:08 -05:00
yhirose
9bb3ca8169
Fix #1459 (#1523) 2023-03-10 22:21:42 -05:00
yhirose
f2f4728489 Release v0.12.1 v0.12.1 2023-03-10 17:53:19 -05:00
yhirose
d1b616286f Add note for macOS regarding system certs 2023-03-10 17:48:19 -05:00
Mathieu Gaillard
df74526f91
Fix multipart Content-Type headers with both boundary and charset parameters (#1516)
* Fix multipart Content-Type headers with both boundary and charset parameters

* Improve code readability

* Add missing forward declaration

---------

Co-authored-by: Mathieu Gaillard <gaillard@adobe.com>
2023-03-08 23:57:17 -05:00
Joel Rosdahl
9f7ae0737a
Fix typos (#1517) 2023-03-08 17:03:20 -05:00
yhirose
1ebb8412c5 Use SSL_ERROR_ZERO_RETURN to check if the SSL peer is closed. 2023-03-07 08:15:16 -05:00
Petr Menšík
7b69999c37
Reuse gtest on system (#1493)
* Reuse gtest on the system

Try to use gtest on the system if found. Avoid using recent CMake
features.

* Set CMP0135 only when using FetchContent

* Add /bigobj option for MSVC

* Support also cmake between 3.14 and 3.20

Older versions provided only GTest::Main target, not currently used
gtest_main. Provide backward compatibility also to old cmake versions.

* Remove redundant variable checking

---------

Co-authored-by: Jiwoo Park <jiwoo_90@naver.com>
2023-03-05 21:35:35 -05:00
yhirose
c7e959a948 Fix #1481 2023-03-04 18:14:00 -05:00
yhirose
ba5884e779
Fix #1481 (#1513) 2023-03-03 23:45:19 -05:00
yhirose
cdaa5c48db Code cleanup 2023-03-03 22:41:57 -05:00
Alexandre Bouvier
bab5c0e907
cmake: fix find_dependency (#1509) 2023-03-01 08:38:58 -05:00
Alexandre Bouvier
016838fd10
cmake: support components (#1504) 2023-02-25 09:56:56 -05:00
yhirose
75053bf855
Fix #1498 (#1501)
* Fix #1498

* Fixed build error
2023-02-22 13:19:36 -05:00
yhirose
ae3a6dd2a9 Fixed an issue with example/Makefile on MacOS 2023-02-21 22:00:10 -05:00
Sergey Kazmin
6d963fbe8d
Support loading system certs from Keychein on MacOS (#1474)
* Support loading system certs from Keychein on MacOS

* review improvements: add deps to meson.build and improve conditional expressions in cmake

* fix tabs

* fix tabs

* review improvements

* fix after review

* additionally load root certs from the system root keychain

* cmake fix

* fix

* small refactoring

* small refactoring

---------

Co-authored-by: Sergey Kazmin <sergey.kazmin@kaspersky.com>
2023-02-17 12:06:55 -05:00
jingTian-z
88f6245c84
feat: Add Request::get_file_multi_value func. (#1495)
Support to get multiple values of a key.

perf: Rename function names, variable names etc.
2023-02-16 21:51:06 -05:00
yhirose
0e7d2f9f93 Resolve #1482 2023-02-14 11:40:47 -05:00
yhirose
4e6ded1f36 Release v0.12.0 v0.12.0 2023-02-07 10:27:40 -05:00
yhirose
d663588491
Removed is_writable() from DataSink (Resolve #1478, too) (#1483) 2023-02-04 13:53:42 -05:00
yhirose
439caf5b79 Fix #1479 2023-02-01 19:11:11 -05:00
yhirose
c4ba43ca6f Removed incorrect comment 2023-01-24 09:07:42 -05:00
Jiwoo Park
20cba2ecd9
Support CTest (#1468)
* Add test/CMakeLists.txt to enable testing with CTest

Add HTTPLIB_TEST option
Downlaod GoogleTest source using FetchContent module
Generate cert files to test httplib with OpenSSL

* Generate cert2.pem with a new certificate request

* Use the latest GoogleTest library
2023-01-21 03:43:22 -05:00
yhirose
0ff2e16d69 Issue 52666: cpp-httplib:server_fuzzer: Timeout in server_fuzzer 2023-01-21 01:09:19 -05:00
Ray Beck
51607ec752
add to_human_string (#1467)
* add to_human_string

* replace to_string with to_human_string

* fix test
2023-01-19 07:01:34 -05:00
yhirose
7992b14896 Release v0.11.4 v0.11.4 2023-01-09 17:08:11 -05:00
Ray Beck
7e420aeed3
add support for requests with both MultipartFormDataItems and Content Providers (#1454)
* add support for requests with both MultipartFormDataItems and ContentProviders

* rework implementation

* use const auto & and fix offset calculation

* fix zero items

* snake case variables

* clang-format

* commonize get_multipart_content_provider, add Put() with MultipartFormDataProviderItems

* fix linker multiple definition error

* add test MultipartFormDataTest.DataProviderItems
2023-01-08 18:38:14 -05:00
yukun
227d2c2050
Add EINTR and EAGAIN judge for accept (#1438)
* Add EINTR and EAGAIN judge for accept

* Add EINTR signal tests

* Cancel win32 and win64 compile on signal unittest

Co-authored-by: yukun.yu <yukun.yu@alibaba-inc.com>
2022-12-20 19:34:51 -05:00
yhirose
93e53c91f7 Updated unit test 2022-12-10 11:45:56 -05:00
Jiwoo Park
58cffd3223
std::condition_variable::notify_one/all() should be called after unlocking mutex (#1448)
* Move next job in task queue rather than copy

* Notify waiting thread after unlocking mutex

* Add unit test for TaskQueue

* Don't use C++14 feature in test code
2022-12-09 17:37:48 -05:00
Ingo Bauersachs
8f32271e8c
Support LOCAL_ADDR and LOCAL_PORT header in client Request (#1450)
Having the local address/port is useful if the server is bound to
all interfaces, e.g. to serve different content for developers
on localhost only.
2022-12-06 08:23:09 -05:00
yhirose
c8c1c3d376 Fix #1442 2022-12-01 17:21:40 -05:00
yhirose
9f512acb42 Removed code for upsupported OpenSSL 2022-12-01 13:41:18 -05:00
yhirose
c0b461a3b7 Release v0.11.3 v0.11.3 2022-11-29 19:26:10 -05:00
yhirose
74fe5a5029 Fix #1426 2022-11-27 10:53:11 -05:00
yhirose
9d0a9d4e23 Fix #1437 2022-11-27 10:21:24 -05:00
TheMarpe
5758769ad3
Windows CMake directory install fix (#1434)
* Fixed install convention pre 3.25

* Simplified CMAKEDIR installation directory
2022-11-24 22:51:55 -05:00
Ray Beck
e7eadc3605
add SYSTEM to include to prevent warnings (#1428) 2022-11-24 22:23:11 -05:00
yhirose
07c6e58951 Fix #1421 2022-11-15 11:57:14 -05:00
Pavel Artemkin
87994811a1
undef poll at the end if CPPHTTPLIB_USE_POLL (#1427)
* undef poll at the end if CPPHTTPLIB_USE_POLL

* win32 only
2022-11-13 21:49:49 -05:00
yhirose
42feb7e8be Updated README 2022-11-10 08:27:30 -05:00
yhirose
26196b70af Add test case for 'Issue 52666 in oss-fuzz: cpp-httplib:server_fuzzer: Timeout in server_fuzzer' 2022-11-03 13:07:04 -04:00
Changbin Park
93a51979c4
Get client process id over ip/port when server runs on UNIX socket. (#1418)
* handle socket options for UNIX socket same as others

 * set FD_CLOEXEC by default
 * invoke `socket_options` callback if set

* Offer Client info even on UNIX socket based Server

HTTP Request header "REMOTE_PORT" contains client process id if possible
when Server works on UNIX socket.

* retrigger checks

* retrigger checks

* add support macOS

Co-authored-by: Changbin Park <changbin.park@ahnlab.com>
2022-11-03 10:25:18 -04:00
Changbin Park
ad7edc7b27
avoid lockup in ThreadPool::shutdown() on legacy host (#1417)
It is found on CentOS 7.0.1406 which is very early version of CentOS 7.

Co-authored-by: Changbin Park <changbin.park@ahnlab.com>
2022-11-03 10:23:45 -04:00