mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 14:29:10 -07:00
parent
7de743c962
commit
6e1297cab0
1 changed files with 18 additions and 2 deletions
20
httplib.h
20
httplib.h
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue