Move ws::WebSocket's chrono set_read_timeout into the header half

Defined next to its non-template overload, it landed in the part of the header
that test_split compiles into httplib.cc, leaving a user TU's instantiation
with nothing to link against. The WebSocketClient overload of the same name has
always sat up with the class definitions; this one belongs there too.

Only test_split sees it -- a header-only build instantiates the template
wherever it is written, which is why the regular test target stayed green.
This commit is contained in:
yhirose
2026-09-03 15:00:02 -04:00
parent 199d7ee248
commit d5f8858731
+7 -7
View File
@@ -4602,6 +4602,13 @@ private:
#endif #endif
}; };
template <class Rep, class Period>
inline void
WebSocket::set_read_timeout(const std::chrono::duration<Rep, Period> &duration) {
detail::duration_to_sec_and_usec(
duration, [&](time_t sec, time_t usec) { set_read_timeout(sec, usec); });
}
template <class Rep, class Period> template <class Rep, class Period>
inline void WebSocketClient::set_read_timeout( inline void WebSocketClient::set_read_timeout(
const std::chrono::duration<Rep, Period> &duration) { const std::chrono::duration<Rep, Period> &duration) {
@@ -22457,13 +22464,6 @@ inline void WebSocket::set_read_timeout(time_t sec, time_t usec) {
strm_.set_read_timeout(sec, usec); strm_.set_read_timeout(sec, usec);
} }
template <class Rep, class Period>
inline void WebSocket::set_read_timeout(
const std::chrono::duration<Rep, Period> &duration) {
detail::duration_to_sec_and_usec(
duration, [&](time_t sec, time_t usec) { set_read_timeout(sec, usec); });
}
// WebSocketClient implementation // WebSocketClient implementation
inline WebSocketClient::WebSocketClient( inline WebSocketClient::WebSocketClient(
const std::string &scheme_host_port_path, const Headers &headers) const std::string &scheme_host_port_path, const Headers &headers)