This commit is contained in:
yhirose 2020-07-07 18:55:46 -04:00 committed by GitHub
parent 7de743c962
commit 6e1297cab0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5321,7 +5321,24 @@ inline SSLSocketStream::SSLSocketStream(socket_t sock, SSL *ssl,
: sock_(sock), ssl_(ssl), read_timeout_sec_(read_timeout_sec),
read_timeout_usec_(read_timeout_usec),
write_timeout_sec_(write_timeout_sec),
write_timeout_usec_(write_timeout_usec) {}
write_timeout_usec_(write_timeout_usec) {
{
timeval tv;
tv.tv_sec = static_cast<long>(read_timeout_sec);
tv.tv_usec = static_cast<decltype(tv.tv_usec)>(read_timeout_usec);
setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast<char *>(&tv),
sizeof(tv));
}
{
timeval tv;
tv.tv_sec = static_cast<long>(write_timeout_sec);
tv.tv_usec = static_cast<decltype(tv.tv_usec)>(write_timeout_usec);
setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, reinterpret_cast<char *>(&tv),
sizeof(tv));
}
}
inline SSLSocketStream::~SSLSocketStream() {}
@ -5803,4 +5820,3 @@ inline bool SSLClient::check_host_name(const char *pattern,
#endif // CPPHTTPLIB_HTTPLIB_H