mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-11-22 20:11:46 +00:00
Compare commits
base: wt/cpp-httplib:master
wt/cpp-httplib:v0.67.0
wt/cpp-httplib:latest
wt/cpp-httplib:v0.66.0
wt/cpp-httplib:v0.65.0
wt/cpp-httplib:v0.64.0
wt/cpp-httplib:v0.63.0
wt/cpp-httplib:v0.62.0
wt/cpp-httplib:v0.61.0
wt/cpp-httplib:v0.60.1
wt/cpp-httplib:v0.60.0
wt/cpp-httplib:v0.59.0
wt/cpp-httplib:v0.58.0
wt/cpp-httplib:v0.57.1
wt/cpp-httplib:v0.57.0
wt/cpp-httplib:v0.56.0
wt/cpp-httplib:v0.54.1
wt/cpp-httplib:v0.54.0
wt/cpp-httplib:v0.53.1
wt/cpp-httplib:v0.53.0
wt/cpp-httplib:v0.52.0
wt/cpp-httplib:v0.51.0
wt/cpp-httplib:v0.50.1
wt/cpp-httplib:v0.50.0
wt/cpp-httplib:v0.49.0
wt/cpp-httplib:v0.48.0
wt/cpp-httplib:v0.47.0
wt/cpp-httplib:v0.46.1
wt/cpp-httplib:v0.46.0
wt/cpp-httplib:v0.45.1
wt/cpp-httplib:v0.45.0
wt/cpp-httplib:v0.44.0
wt/cpp-httplib:v0.43.4
wt/cpp-httplib:v0.43.3
wt/cpp-httplib:v0.43.2
wt/cpp-httplib:v0.43.1
wt/cpp-httplib:v0.43.0
wt/cpp-httplib:v0.42.0
wt/cpp-httplib:v0.41.0
wt/cpp-httplib:v0.40.0
wt/cpp-httplib:v0.39.0
wt/cpp-httplib:v0.38.0
wt/cpp-httplib:v0.37.2
wt/cpp-httplib:v0.37.1
wt/cpp-httplib:v0.37.0
wt/cpp-httplib:v0.36.0
wt/cpp-httplib:v0.35.0
wt/cpp-httplib:v0.34.0
wt/cpp-httplib:v0.33.1
wt/cpp-httplib:v0.33.0
wt/cpp-httplib:v0.32.0
wt/cpp-httplib:v0.31.0
wt/cpp-httplib:v0.30.2
wt/cpp-httplib:v0.30.1
wt/cpp-httplib:v0.30.0
wt/cpp-httplib:v0.29.0
wt/cpp-httplib:v0.28.0
wt/cpp-httplib:v0.27.0
wt/cpp-httplib:v0.26.0
wt/cpp-httplib:v0.25.0
wt/cpp-httplib:v0.24.0
wt/cpp-httplib:v0.23.1
wt/cpp-httplib:v0.23.0
wt/cpp-httplib:v0.22.0
wt/cpp-httplib:v0.21.0
wt/cpp-httplib:v0.20.1
wt/cpp-httplib:v0.20.0
wt/cpp-httplib:v0.19.0
wt/cpp-httplib:v0.18.7
wt/cpp-httplib:v0.18.6
wt/cpp-httplib:v0.18.5
wt/cpp-httplib:v0.18.4
wt/cpp-httplib:v0.18.3
wt/cpp-httplib:v0.18.2
wt/cpp-httplib:v0.18.1
wt/cpp-httplib:v0.18.0
wt/cpp-httplib:v0.17.3
wt/cpp-httplib:v0.17.2
wt/cpp-httplib:v0.17.1
wt/cpp-httplib:v0.17.0
wt/cpp-httplib:v0.16.3
wt/cpp-httplib:v0.16.2
wt/cpp-httplib:v0.16.1
wt/cpp-httplib:v0.16.0
wt/cpp-httplib:v0.15.3
wt/cpp-httplib:v0.15.2
wt/cpp-httplib:v0.15.1
wt/cpp-httplib:v0.15.0
wt/cpp-httplib:v0.14.3
wt/cpp-httplib:v0.14.2
wt/cpp-httplib:v0.14.1
wt/cpp-httplib:v0.14.0
wt/cpp-httplib:v0.13.3
wt/cpp-httplib:v0.13.2
wt/cpp-httplib:v0.13.1
wt/cpp-httplib:v0.13.0
wt/cpp-httplib:v0.12.6
wt/cpp-httplib:v0.12.5
wt/cpp-httplib:v0.12.4
wt/cpp-httplib:v0.12.3
wt/cpp-httplib:v0.12.2
wt/cpp-httplib:v0.12.1
wt/cpp-httplib:v0.12.0
wt/cpp-httplib:v0.11.4
wt/cpp-httplib:v0.11.3
wt/cpp-httplib:v0.11.2
wt/cpp-httplib:v0.11.1
wt/cpp-httplib:v0.11.0
wt/cpp-httplib:v0.10.9
wt/cpp-httplib:v0.10.8
wt/cpp-httplib:v0.10.7
wt/cpp-httplib:v0.10.6
wt/cpp-httplib:v0.10.5
wt/cpp-httplib:v0.10.4
wt/cpp-httplib:v0.10.3
wt/cpp-httplib:v0.10.2
wt/cpp-httplib:v0.10.1
wt/cpp-httplib:v0.10.0
wt/cpp-httplib:v0.9.10
wt/cpp-httplib:v0.9.9
wt/cpp-httplib:v0.9.8
wt/cpp-httplib:v0.9.7
wt/cpp-httplib:v0.9.6
wt/cpp-httplib:v0.9.5
wt/cpp-httplib:v0.9.4
wt/cpp-httplib:v0.9.3
wt/cpp-httplib:v0.9.2
wt/cpp-httplib:v0.9.1
wt/cpp-httplib:v0.9.0
wt/cpp-httplib:v0.8.9
wt/cpp-httplib:v0.8.8
wt/cpp-httplib:v0.8.7
wt/cpp-httplib:v0.8.6
wt/cpp-httplib:v0.8.5
wt/cpp-httplib:v0.8.4
wt/cpp-httplib:v0.8.3
wt/cpp-httplib:v0.8.2
wt/cpp-httplib:v0.8.1
wt/cpp-httplib:v0.8.0
wt/cpp-httplib:v0.7.18
wt/cpp-httplib:v0.7.17
wt/cpp-httplib:v0.7.16
wt/cpp-httplib:v0.7.15
wt/cpp-httplib:v0.7.14
wt/cpp-httplib:v0.7.13
wt/cpp-httplib:v0.7.12
wt/cpp-httplib:v0.7.11
wt/cpp-httplib:v0.7.10
wt/cpp-httplib:v0.7.9
wt/cpp-httplib:v0.7.8
wt/cpp-httplib:v0.7.7
wt/cpp-httplib:v0.7.6
wt/cpp-httplib:v0.7.5
wt/cpp-httplib:v0.7.4
wt/cpp-httplib:v0.7.3
wt/cpp-httplib:v0.7.2
wt/cpp-httplib:v0.7.1
wt/cpp-httplib:v0.7.0
wt/cpp-httplib:v0.6.7
wt/cpp-httplib:v0.6.6
wt/cpp-httplib:v0.6.5
wt/cpp-httplib:v0.6.4
wt/cpp-httplib:v0.6.3
wt/cpp-httplib:v0.6.2
wt/cpp-httplib:v0.6.1
wt/cpp-httplib:v0.6.0
wt/cpp-httplib:v0.5.13
wt/cpp-httplib:v0.5.12
wt/cpp-httplib:v0.5.11
wt/cpp-httplib:v0.5.10
wt/cpp-httplib:v0.5.9
wt/cpp-httplib:v0.5.8
wt/cpp-httplib:v0.5.7
wt/cpp-httplib:v0.5.6
wt/cpp-httplib:v0.5.5
wt/cpp-httplib:v0.5.4
wt/cpp-httplib:v0.5.3
wt/cpp-httplib:v0.5.2
wt/cpp-httplib:v0.5.1
wt/cpp-httplib:v0.5.0
wt/cpp-httplib:v0.4.2
wt/cpp-httplib:v0.4.1
wt/cpp-httplib:v0.4.0
wt/cpp-httplib:v0.3.3
wt/cpp-httplib:v0.3.2
wt/cpp-httplib:v0.3.1
wt/cpp-httplib:v0.3.0
wt/cpp-httplib:v0.2.6
wt/cpp-httplib:v0.2.5
wt/cpp-httplib:v0.2.4
wt/cpp-httplib:v0.2.3
wt/cpp-httplib:v0.2.2
wt/cpp-httplib:v0.2.1
wt/cpp-httplib:v0.2.0
..
compare: wt/cpp-httplib:keep-alive-parking-pr
wt/cpp-httplib:v0.67.0
wt/cpp-httplib:latest
wt/cpp-httplib:v0.66.0
wt/cpp-httplib:v0.65.0
wt/cpp-httplib:v0.64.0
wt/cpp-httplib:v0.63.0
wt/cpp-httplib:v0.62.0
wt/cpp-httplib:v0.61.0
wt/cpp-httplib:v0.60.1
wt/cpp-httplib:v0.60.0
wt/cpp-httplib:v0.59.0
wt/cpp-httplib:v0.58.0
wt/cpp-httplib:v0.57.1
wt/cpp-httplib:v0.57.0
wt/cpp-httplib:v0.56.0
wt/cpp-httplib:v0.54.1
wt/cpp-httplib:v0.54.0
wt/cpp-httplib:v0.53.1
wt/cpp-httplib:v0.53.0
wt/cpp-httplib:v0.52.0
wt/cpp-httplib:v0.51.0
wt/cpp-httplib:v0.50.1
wt/cpp-httplib:v0.50.0
wt/cpp-httplib:v0.49.0
wt/cpp-httplib:v0.48.0
wt/cpp-httplib:v0.47.0
wt/cpp-httplib:v0.46.1
wt/cpp-httplib:v0.46.0
wt/cpp-httplib:v0.45.1
wt/cpp-httplib:v0.45.0
wt/cpp-httplib:v0.44.0
wt/cpp-httplib:v0.43.4
wt/cpp-httplib:v0.43.3
wt/cpp-httplib:v0.43.2
wt/cpp-httplib:v0.43.1
wt/cpp-httplib:v0.43.0
wt/cpp-httplib:v0.42.0
wt/cpp-httplib:v0.41.0
wt/cpp-httplib:v0.40.0
wt/cpp-httplib:v0.39.0
wt/cpp-httplib:v0.38.0
wt/cpp-httplib:v0.37.2
wt/cpp-httplib:v0.37.1
wt/cpp-httplib:v0.37.0
wt/cpp-httplib:v0.36.0
wt/cpp-httplib:v0.35.0
wt/cpp-httplib:v0.34.0
wt/cpp-httplib:v0.33.1
wt/cpp-httplib:v0.33.0
wt/cpp-httplib:v0.32.0
wt/cpp-httplib:v0.31.0
wt/cpp-httplib:v0.30.2
wt/cpp-httplib:v0.30.1
wt/cpp-httplib:v0.30.0
wt/cpp-httplib:v0.29.0
wt/cpp-httplib:v0.28.0
wt/cpp-httplib:v0.27.0
wt/cpp-httplib:v0.26.0
wt/cpp-httplib:v0.25.0
wt/cpp-httplib:v0.24.0
wt/cpp-httplib:v0.23.1
wt/cpp-httplib:v0.23.0
wt/cpp-httplib:v0.22.0
wt/cpp-httplib:v0.21.0
wt/cpp-httplib:v0.20.1
wt/cpp-httplib:v0.20.0
wt/cpp-httplib:v0.19.0
wt/cpp-httplib:v0.18.7
wt/cpp-httplib:v0.18.6
wt/cpp-httplib:v0.18.5
wt/cpp-httplib:v0.18.4
wt/cpp-httplib:v0.18.3
wt/cpp-httplib:v0.18.2
wt/cpp-httplib:v0.18.1
wt/cpp-httplib:v0.18.0
wt/cpp-httplib:v0.17.3
wt/cpp-httplib:v0.17.2
wt/cpp-httplib:v0.17.1
wt/cpp-httplib:v0.17.0
wt/cpp-httplib:v0.16.3
wt/cpp-httplib:v0.16.2
wt/cpp-httplib:v0.16.1
wt/cpp-httplib:v0.16.0
wt/cpp-httplib:v0.15.3
wt/cpp-httplib:v0.15.2
wt/cpp-httplib:v0.15.1
wt/cpp-httplib:v0.15.0
wt/cpp-httplib:v0.14.3
wt/cpp-httplib:v0.14.2
wt/cpp-httplib:v0.14.1
wt/cpp-httplib:v0.14.0
wt/cpp-httplib:v0.13.3
wt/cpp-httplib:v0.13.2
wt/cpp-httplib:v0.13.1
wt/cpp-httplib:v0.13.0
wt/cpp-httplib:v0.12.6
wt/cpp-httplib:v0.12.5
wt/cpp-httplib:v0.12.4
wt/cpp-httplib:v0.12.3
wt/cpp-httplib:v0.12.2
wt/cpp-httplib:v0.12.1
wt/cpp-httplib:v0.12.0
wt/cpp-httplib:v0.11.4
wt/cpp-httplib:v0.11.3
wt/cpp-httplib:v0.11.2
wt/cpp-httplib:v0.11.1
wt/cpp-httplib:v0.11.0
wt/cpp-httplib:v0.10.9
wt/cpp-httplib:v0.10.8
wt/cpp-httplib:v0.10.7
wt/cpp-httplib:v0.10.6
wt/cpp-httplib:v0.10.5
wt/cpp-httplib:v0.10.4
wt/cpp-httplib:v0.10.3
wt/cpp-httplib:v0.10.2
wt/cpp-httplib:v0.10.1
wt/cpp-httplib:v0.10.0
wt/cpp-httplib:v0.9.10
wt/cpp-httplib:v0.9.9
wt/cpp-httplib:v0.9.8
wt/cpp-httplib:v0.9.7
wt/cpp-httplib:v0.9.6
wt/cpp-httplib:v0.9.5
wt/cpp-httplib:v0.9.4
wt/cpp-httplib:v0.9.3
wt/cpp-httplib:v0.9.2
wt/cpp-httplib:v0.9.1
wt/cpp-httplib:v0.9.0
wt/cpp-httplib:v0.8.9
wt/cpp-httplib:v0.8.8
wt/cpp-httplib:v0.8.7
wt/cpp-httplib:v0.8.6
wt/cpp-httplib:v0.8.5
wt/cpp-httplib:v0.8.4
wt/cpp-httplib:v0.8.3
wt/cpp-httplib:v0.8.2
wt/cpp-httplib:v0.8.1
wt/cpp-httplib:v0.8.0
wt/cpp-httplib:v0.7.18
wt/cpp-httplib:v0.7.17
wt/cpp-httplib:v0.7.16
wt/cpp-httplib:v0.7.15
wt/cpp-httplib:v0.7.14
wt/cpp-httplib:v0.7.13
wt/cpp-httplib:v0.7.12
wt/cpp-httplib:v0.7.11
wt/cpp-httplib:v0.7.10
wt/cpp-httplib:v0.7.9
wt/cpp-httplib:v0.7.8
wt/cpp-httplib:v0.7.7
wt/cpp-httplib:v0.7.6
wt/cpp-httplib:v0.7.5
wt/cpp-httplib:v0.7.4
wt/cpp-httplib:v0.7.3
wt/cpp-httplib:v0.7.2
wt/cpp-httplib:v0.7.1
wt/cpp-httplib:v0.7.0
wt/cpp-httplib:v0.6.7
wt/cpp-httplib:v0.6.6
wt/cpp-httplib:v0.6.5
wt/cpp-httplib:v0.6.4
wt/cpp-httplib:v0.6.3
wt/cpp-httplib:v0.6.2
wt/cpp-httplib:v0.6.1
wt/cpp-httplib:v0.6.0
wt/cpp-httplib:v0.5.13
wt/cpp-httplib:v0.5.12
wt/cpp-httplib:v0.5.11
wt/cpp-httplib:v0.5.10
wt/cpp-httplib:v0.5.9
wt/cpp-httplib:v0.5.8
wt/cpp-httplib:v0.5.7
wt/cpp-httplib:v0.5.6
wt/cpp-httplib:v0.5.5
wt/cpp-httplib:v0.5.4
wt/cpp-httplib:v0.5.3
wt/cpp-httplib:v0.5.2
wt/cpp-httplib:v0.5.1
wt/cpp-httplib:v0.5.0
wt/cpp-httplib:v0.4.2
wt/cpp-httplib:v0.4.1
wt/cpp-httplib:v0.4.0
wt/cpp-httplib:v0.3.3
wt/cpp-httplib:v0.3.2
wt/cpp-httplib:v0.3.1
wt/cpp-httplib:v0.3.0
wt/cpp-httplib:v0.2.6
wt/cpp-httplib:v0.2.5
wt/cpp-httplib:v0.2.4
wt/cpp-httplib:v0.2.3
wt/cpp-httplib:v0.2.2
wt/cpp-httplib:v0.2.1
wt/cpp-httplib:v0.2.0
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a8d58085cb |
Run the test suite with keep-alive parking on in CI, and mark it experimental
CPPHTTPLIB_KEEPALIVE_PARKING makes every Server start with parking on. The OpenSSL jobs on Ubuntu (epoll) and macOS (kqueue) now also run the whole suite built with it, which used to be done only locally. The two tests that check the blocking path turn parking off explicitly. README and the cookbook call the feature experimental and say that a server whose event loop cannot be set up serves as it does without it. |
||
|
|
00e2fd89e8 | Describe keep-alive parking in the Keep-Alive cookbook page | ||
|
|
530afcc12e |
Add keep-alive parking (Server::set_keep_alive_parking())
A kept-alive connection holds a worker thread while it waits for its next request, so connections beyond the thread count wait for one to be closed, and some clients get nothing until another connection ends. With keep-alive parking, listen() runs an event loop on the detail::Poller instead of the blocking accept loop. A connection waiting for its next request is parked there and goes back to a worker through the TaskQueue when the request arrives. The handlers, content providers and WebSocket keep their blocking API and still hold a thread while they run. SSLServer supports it too: a worker runs the TLS handshake once the client starts it, and the session stays with the parked connection. It is opt-in and off by default. With it on: - consecutive requests on a connection may run on different threads; - when the queue is full, a connection that has not been served (or has not finished its TLS handshake) is closed as before, while an established one waits in a backlog instead of losing its request; - a parked connection frees its read buffer, and with OpenSSL 3.0.14, 3.1.6, 3.2.2, 3.3.1 or later also its TLS record buffers; - handing a connection over adds roughly 10-20 us to a request; - a subclass that overrides the private process_and_close_socket() is bypassed. On two CPUs with two workers, 50 keep-alive clients of a 2.7 ms handler were all served evenly (the slowest response took about 70 ms instead of 5 s, with 10 clients getting nothing), light requests from 50 clients went from 79k to about 240k per second, and with 10000 idle connections parked, 10 active clients got 95k requests per second where the old loop served none. An idle connection costs under 1 KB, or about 15 KB with TLS. The old accept loop moved unchanged into accept_loop(). KeepAliveConnection holds a parked connection, PlainConnection and SSLServer::TlsConnection add the transport, and SSLServer::start_session() holds the session setup and handshake that both paths use. |
||
|
|
da42c375ca |
Pass the keep-alive wait and the served count into the server loop
process_server_socket_core() now takes the function that waits for the next request and the number of requests served so far, instead of calling keep_alive() and counting on its own stack. Both callers pass keep_alive() and a fresh counter, so nothing changes yet; this lets a caller stop waiting and resume the same connection later without losing track of keep_alive_max_count. |
||
|
|
a694b8c306 |
Add a one-shot Poller with poll, epoll and kqueue backends
Groundwork for keep-alive parking, an opt-in event loop that parks idle keep-alive connections instead of blocking a worker thread on each. detail::Poller delivers readiness once per arm(), so a descriptor is either armed (owned by the poller) or owned by whoever got the event. wake() ends a wait() from any thread, and an armed descriptor must be disarmed before it is closed. - PollPoller (poll() / WSAPoll()) works everywhere. - EpollPoller (Linux) uses EPOLLONESHOT. - KqueuePoller (macOS, FreeBSD) uses EV_ONESHOT. - PollerWaker carries wake() for all three: an eventfd on Linux, a socket pair elsewhere. detail::create_socket_pair() emulates socketpair() on Windows with sockets that child processes do not inherit. make_poller() picks the best one and falls back to poll(). The contract tests run on every backend that builds. Nothing uses the poller yet. |