Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions httplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand Down Expand Up @@ -5803,4 +5820,3 @@ inline bool SSLClient::check_host_name(const char *pattern,

#endif // CPPHTTPLIB_HTTPLIB_H