1
0
mirror of synced 2025-06-10 20:21:41 +03:00
Commit Graph

1288 Commits

Author SHA1 Message Date
07288888ad Code cleanup 2024-04-11 22:26:30 -04:00
34d392cf3d Merge branch 'fix' of github.com:HerrCai0907/cpp-httplib into HerrCai0907-fix 2024-04-11 22:22:58 -04:00
825c3fbbb1 Removed excess usage of std::move 2024-04-11 21:21:27 -04:00
00bdf73ec6 fix: increase default receive buffer to 16kb (#1814)
Since TLS packets have a maximum size of 16kb it makes
sense to fully accommodate them on reads.

Co-authored-by: Rusty Conover <rusty@Juno.local>
2024-04-09 16:59:07 -04:00
f44ab9b3da Fix range parser when parsing too many ranges (#1812)
* Implement range parser without std::regex

* Add test cases for invalid ranges
2024-04-07 10:06:16 -04:00
a61f2b89be build(meson): generate new test PEMs (#1813)
Follow-up to commits 548dfff0ae and
b8bafbc291
2024-04-07 10:05:07 -04:00
b8bafbc291 Generate missing PEMs for CTest (#1811)
* Generate missing PEMs

* Fix typo

* Copy files using simpler command
2024-04-05 13:50:21 -04:00
548dfff0ae Fix #1793 2024-03-09 22:26:17 -05:00
4dd2f3d03d fix ambiguous for HandlerWithResponse and Handler in set_error_handler
using lambda expression as Handler in set_error_handler will cause ambiguous.
Template forwarding can forward HandlerWithResponse to the correct overloading function
2024-03-07 19:07:39 +08:00
6791a8364d FindBrotli cleanup & fixes (#1786)
* Unimportant cleanup of FindBrotli

Some whitespace, removal of an unused var, and add a comment about
the missing version support

* Fix incorrect var in FindBrotli

Not much to say, it was just the wrong one. Not sure how that happened,
maybe a holdover from when I did an overhaul at some point..

* Tiny useless edit to FindBrotli

Just a little tweak to how I was postfixing those -static strings to the
lib names. Mostly pointless..

* Simplify some FindBrotli code

Nothing much, just reducing redundant stuff & a cleanup of a comment.

* Ignore PkgConf in FindBrotli if looking for static

As per the issue mentioned in this comment, static PkgConf support
is broken upstream. After testing, I found it'll just accept shared
even if you try to find static, so I'm merely disabling that feature
for this FindBrotli module.

That said, you can still get the static libs if you have them installed,
but PkgConf will be ignored even if found in favor of a regular
find_library call. Otherwise you'd end up with shared libs even if you
ask for static (with PkgConf installed).

TLDR: actually fail correctly when static libs aren't found when PkgConf
thought they were.
2024-02-27 19:25:02 -05:00
d1a1c8a158 Add description & URL to Cmake (#1785)
Doesn't do much, but some packages/builders might find a use for these
vars it provides...
2024-02-27 19:22:44 -05:00
b4d26badf2 Update github actions 2024-02-17 09:17:51 -05:00
c5a0673c93 Use final keyword for devirtualization (#1779) 2024-02-17 09:17:15 -05:00
ad40bd6a00 Implement file mapping for UWP apps (#1775)
Fixes #1773.
2024-02-08 22:59:34 -05:00
5c00bbf36b Release v0.15.3 v0.15.3 2024-02-05 22:12:43 -05:00
9d6f5372a3 Fix #1772 2024-02-05 22:11:53 -05:00
f06fd934f6 Fix typo in gtest-all.cc (#1770)
synthetic -> synthetic
2024-02-05 15:35:33 -05:00
80c0cc445e Release v0.15.2 v0.15.2 2024-02-02 23:29:30 -05:00
762024b890 Fix #1768 2024-02-02 23:17:32 -05:00
82a90a2325 Update year 2024-01-29 08:53:01 -05:00
b7cac4f4b8 Release v0.15.1 v0.15.1 2024-01-29 07:40:56 -05:00
e323374d2a Fix #1766 2024-01-28 17:43:51 -05:00
ffc294d37e Reduce object copy (#1767) 2024-01-28 08:18:29 -05:00
fceada9ef4 Changed to return 416 for a request with an invalid range 2024-01-28 08:13:19 -05:00
5f0f73fad9 Reduce duplicate computation for ranges 2024-01-27 19:07:52 -05:00
530d6ee098 Release v0.15.0 v0.15.0 2024-01-27 17:39:58 -05:00
420c9759c6 Fix #1694 2024-01-27 16:13:54 -05:00
2ce7c22218 Fix #1747 2024-01-27 12:56:39 -05:00
4ef9ed80cd Treat paths with embedded NUL bytes as invalid (#1765)
Fixes #1763.
2024-01-27 08:22:00 -05:00
44b3fe6277 Support move semantics for Response::set_content() (#1764) 2024-01-27 07:53:19 -05:00
449801990f Add a getter for a bearer token from a request (#1755)
* Add a getter for a bearer token from a request

* Replace a method for bearer token getter with a free function
2024-01-15 08:57:22 -05:00
af2928d316 Fix select() return code for fd >= 1024 (#1757) 2024-01-15 08:27:31 -05:00
d948e38820 Minor cmake fix & cleanup (#1754)
* Reorder cmake docs a bit

Just wanted to group the more related build options together.

Also removed a pointless reference to the old reasoning for the required
min ver since it's 3.14 now anyways.

* Fix outdated cmake comment

We don't use Git to find the version string anymore.
Just updated to match what it's actually used for now.

* Group options and build-tree vars in Cmake

Doesn't really change anything, I just wanted to clean these up a bit.

* Fix how we set HTTPLIB_IS_USING_XXX vars in Cmake

Prevents us acidentally using libs when the user didn't want them
actually used. This could happen if they set the option to OFF but their
own project itself is using the lib, thus we'd find and use it anyways.

Ref #1602 to see an example of this already happening before.
This is merely apply that kind of fix to all 3 of our deps, instead of
just OpenSSL.

* Minor formatting/comment change to Cmake

Pointless, but these things were bothering me..
2024-01-04 18:20:37 -05:00
65218ce222 added missing include of exception (#1752) 2023-12-31 18:59:43 -05:00
55e99c4030 Fix -Wold-style-cast warning (#1751) 2023-12-31 18:43:31 -05:00
b63d50671d Fixes Windows std::max macro problems (#1750) 2023-12-30 11:37:58 -05:00
eba980846b Fix #1628 (OpenSSL 1.1.1 End of Life on September 11, 2023) (#1745) 2023-12-24 08:20:58 -05:00
374d058de7 ThreadPool: optional limit for jobs queue (#1741)
For very busy servers, the internal jobs queue where accepted
sockets are enqueued can grow without limit.
This is a problem for two reasons:
 - queueing too much work causes the server to respond with huge latency,
   resulting in repetead timeouts on the clients; it is definitely
   better to reject the connection early, so that the client
   receives the backpressure signal as soon as the queue is
   becoming too large
 - the jobs list can eventually cause an out of memory condition
2023-12-24 08:20:22 -05:00
31cdcc3c3a Update README about MSYS2 and MinGW 2023-12-23 21:37:34 -05:00
ad9f6423e2 Fix #1744 2023-12-23 11:45:08 -05:00
cbca63f091 Release v0.14.3 v0.14.3 2023-12-21 19:55:25 -05:00
b4748a226c Fix #1738 2023-12-21 13:33:52 -05:00
5b943d9bb8 Use StatusCode in tests and examples (#1743)
* Use StatusCode in tests and examples

* Use StatusCode in README
2023-12-20 17:28:57 -05:00
c86f69a105 Use StatusCode in httplib code (#1742) 2023-12-19 22:17:24 -05:00
d39fda0657 Add StatusCode enum (#1739)
* Add StatusCode enum

* Remove changes on RFC 9110

* Add number suffixes to StatusCode constants

* Remove docs for StatusCode constants
2023-12-19 17:57:30 -05:00
37f8dc4382 Change some of status messages based on RFC 9110 (#1740) 2023-12-19 09:22:58 -05:00
3a8adda381 Fix #1737 2023-12-17 22:04:36 -05:00
8aa38aecaf Fix #1665 2023-12-17 22:03:02 -05:00
f1dec77f46 Code format 2023-12-17 22:00:33 -05:00
cddaedaff8 Fix #1736 2023-12-15 19:29:54 -05:00