mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-11-26 20:48:24 +00:00
Both callers of close_served() worked out from the same connection whether to close gracefully, so pass what resume() returned and let the connection check turn.websocket_upgraded once. Also wait for the keep-alive timeout in both modes at once, which halves the test to about a second, and describe include_httplib.cc for what it now does.
19 lines
818 B
C++
19 lines
818 B
C++
// Includes httplib.h in a separate compilation unit, thus verifying that
|
|
// inline keywords have not been forgotten when linked together with test.cc.
|
|
|
|
#include <httplib.h>
|
|
|
|
// Nothing in the library calls these, but subclasses that override
|
|
// process_and_close_socket() do. Instantiating them here, where the split build
|
|
// does not reach, keeps a change to process_server_socket_core() from breaking
|
|
// them unnoticed.
|
|
struct IncludeHttplibServeNothing {
|
|
bool operator()(httplib::Stream &, bool, bool &) const { return false; }
|
|
};
|
|
auto include_httplib_process_server_socket =
|
|
&httplib::detail::process_server_socket<IncludeHttplibServeNothing>;
|
|
#ifdef CPPHTTPLIB_SSL_ENABLED
|
|
auto include_httplib_process_server_socket_ssl =
|
|
&httplib::detail::process_server_socket_ssl<IncludeHttplibServeNothing>;
|
|
#endif
|