Hi, just wondering if use of uv_timeval64_t instead of strut timeval
could generate portability issues.
I'm basically creating a uv_timeval64_t with both tv_sec and tv_usec
set to 0, and passing it to openssl lib to fill it. However when the
host is a Raspberry Pi 3B+ the filled values do not make any sense
(they are extremely high, which means there is some kind of overflow).
------------------------------------------------
struct timeval dtlsTimeout;
dtlsTimeout.tv_sec = 0;
dtlsTimeout.tv_usec = 0;
int64_t ret = DTLSv1_get_timeout(this->ssl, (void*)&dtlsTimeout);
if (ret == 0)
return true;
uint64_t timeoutMs =
(dtlsTimeout.tv_sec * static_cast<uint64_t>(1000)) +
(dtlsTimeout.tv_usec / 1000);
-------------------------------------------------
The computed timeoutMs is (sometimes) 428358563266560000 (ms), which
is 100% crazy (it cannot be more than a few ms typically). So I think
the OpenSSL DTLSv1_get_timeout() function is filling the struct
wrongly.
I assume I should not pass a uv_timeval64_t to OpenSSL when it expects
a struct timeval, am I right?
--
Iñaki Baz Castillo
<
i...@aliax.net>