mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
PR: 1990
Update from 0.9.8-stable
This commit is contained in:
parent
3fa39ed723
commit
6aa220c935
@ -250,17 +250,22 @@ static void dgram_reset_rcv_timeout(BIO *b)
|
||||
{
|
||||
#if defined(SO_RCVTIMEO)
|
||||
bio_dgram_data *data = (bio_dgram_data *)b->ptr;
|
||||
|
||||
/* Is a timer active? */
|
||||
if (data->next_timeout.tv_sec > 0 || data->next_timeout.tv_usec > 0)
|
||||
{
|
||||
#ifdef OPENSSL_SYS_WINDOWS
|
||||
int timeout = data->socket_timeout.tv_sec * 1000 +
|
||||
data->socket_timeout.tv_usec / 1000;
|
||||
if (setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO,
|
||||
(void*)&timeout, sizeof(timeout)) < 0)
|
||||
{ perror("setsockopt"); }
|
||||
int timeout = data->socket_timeout.tv_sec * 1000 +
|
||||
data->socket_timeout.tv_usec / 1000;
|
||||
if (setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO,
|
||||
(void*)&timeout, sizeof(timeout)) < 0)
|
||||
{ perror("setsockopt"); }
|
||||
#else
|
||||
if ( setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, &(data->socket_timeout),
|
||||
sizeof(struct timeval)) < 0)
|
||||
{ perror("setsockopt"); }
|
||||
if ( setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, &(data->socket_timeout),
|
||||
sizeof(struct timeval)) < 0)
|
||||
{ perror("setsockopt"); }
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user