1
0
mirror of synced 2025-04-20 11:47:43 +03:00

Fix problems in #1154

This commit is contained in:
yhirose 2021-12-31 14:55:40 -05:00
parent 070f9bec58
commit 27d128bbb4

View File

@ -2709,8 +2709,8 @@ inline socket_t create_client_socket(
sizeof(timeout)); sizeof(timeout));
#else #else
timeval tv; timeval tv;
tv.tv_sec = static_cast<long>(read_timeout_sec); tv.tv_sec = static_cast<long>(write_timeout_sec);
tv.tv_usec = static_cast<decltype(tv.tv_usec)>(read_timeout_usec); tv.tv_usec = static_cast<decltype(tv.tv_usec)>(write_timeout_usec);
setsockopt(sock2, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(tv)); setsockopt(sock2, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(tv));
#endif #endif
} }
@ -5281,8 +5281,8 @@ inline bool Server::listen_internal() {
sizeof(timeout)); sizeof(timeout));
#else #else
timeval tv; timeval tv;
tv.tv_sec = static_cast<long>(read_timeout_sec_); tv.tv_sec = static_cast<long>(write_timeout_sec_);
tv.tv_usec = static_cast<decltype(tv.tv_usec)>(read_timeout_usec_); tv.tv_usec = static_cast<decltype(tv.tv_usec)>(write_timeout_usec_);
setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(tv)); setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(tv));
#endif #endif
} }