Commit graph

753 commits

Author SHA1 Message Date
yhirose
bd9612b81e
Changed to use auto (#1594) 2023-06-17 02:18:34 -04:00
yhirose
7ab5fb65b2
Code cleanup (#1593) 2023-06-16 18:08:28 -04:00
Andre Eisenbach
8df5fedc35
Fix -Wold-style-cast warnings (#1591)
Removed multiple old-style (C) casts and replaced them with the
appropriate _cast's. This makes httplib a better citizen inside projects
that are compiled with all warnings enabled.

Unfortunately one warning remains as a result of invoking an
OpenSSL macro (at least on Linux), that would have to be fixed
upstream.

Also fixed a few casts for invocations of setsockopt.
setsockopt takes a const void* for the value pointer, not a char*.
Well, except on Windows ...

Co-authored-by: Andre Eisenbach <git@4ae.us>
2023-06-16 17:30:24 -04:00
Jiwoo Park
4a61f68fa4
Don't overwrite the last redirected location (#1589)
* Don't overwrite the last redirected location

* Check the last redirected location
2023-06-16 14:56:16 -04:00
yhirose
d3076f5a70 v0.12.6 2023-06-10 07:02:38 +09:00
yhirose
ed129f057f Fixed C++11 warnings and code format 2023-06-09 20:49:46 +09:00
Jiwoo Park
eab5ea01d7
Load in-memory CA certificates (#1579)
* Load in-memory CA certs

* Add test cases for in-memory cert loading

* Don't use the IIFE style
2023-06-09 16:34:51 +09:00
v1gnesh
4f33637b43
Add support for zOS (#1581)
Signed-off-by: v1gnesh <v1gnesh@users.noreply.github.com>
2023-06-06 14:14:06 +09:00
db-src
698a1e51ec
Move, not copy, Logger and Handler functors (#1576)
* Explicitly #include <utility> for use of std::move

* Move not copy Logger arg from Client to ClientImpl

* Move not copy, set_error_handler Handler to lambda

* Remove null statement in non-empty if/else block

I guess it was a relic from a time before the other statement was added.

---------

Co-authored-by: Daniel Boles <daniel.boles@voltalis.com>
2023-06-02 15:40:00 +09:00
yhirose
27c0e1186c Release v12.0.5 2023-05-30 16:09:42 +09:00
yhirose
f8ef5fab64 Release v0.12.4 2023-05-27 00:57:43 +09:00
yhirose
5b397d455d Fix more CRLF injection problems. 2023-05-22 22:56:16 +09:00
yhirose
f977558a28 Release v0.12.3 2023-04-30 10:44:36 +09:00
Oleg Shparber
c2e156e0e0
Fix leaked handle in create_socket (#1554)
Fixes resource leak problem detected by Coverity Scan.
2023-04-09 12:18:44 -04:00
yhirose
7aba2938d3 Fix #1548 2023-04-08 15:36:13 -04:00
yhirose
d587548250 Fix #1545 2023-04-08 14:53:55 -04:00
Sergey Kazmin
e62a4b02e5
fix (#1525)
Co-authored-by: Sergey Kazmin <sergey.kazmin@kaspersky.com>
2023-04-04 07:12:15 -07:00
Octavio Valle
ff34749572
Initialize sockaddr_un to fix valgrind uninitialised byte message. (#1547) 2023-04-03 08:28:01 -07:00
Jiwoo Park
e5804d4a50
Don't loading system certs from Keychain on iOS (#1546) 2023-04-01 06:26:30 -07:00
yhirose
76230db97f Simplified scope_exit 2023-03-25 21:52:39 -04:00
yhirose
a66a013ed7 Release v0.12.2 2023-03-25 21:47:14 -04:00
yhirose
f4b02dfdc1 Fix #1533 2023-03-25 21:13:07 -04:00
yhirose
4cf218643e Code format 2023-03-25 21:12:40 -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
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 2023-03-10 17:53: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
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
yhirose
75053bf855
Fix #1498 (#1501)
* Fix #1498

* Fixed build error
2023-02-22 13:19:36 -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 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
c4ba43ca6f Removed incorrect comment 2023-01-24 09:07:42 -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 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
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 2022-11-29 19:26:10 -05:00