65 #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS)
66 #include <sys/timeb.h>
69 static void get_current_time(
struct timeval *
t);
101 memset(d1,0,
sizeof *d1);
133 static void dtls1_clear_queues(
SSL *s)
190 dtls1_clear_queues(s);
219 dtls1_clear_queues(s);
221 memset(s->
d1, 0,
sizeof(*(s->
d1)));
295 #ifndef OPENSSL_NO_SCTP
320 struct timeval timenow;
329 get_current_time(&timenow);
336 memset(timeleft, 0,
sizeof(
struct timeval));
342 timeleft->tv_sec -= timenow.tv_sec;
343 timeleft->tv_usec -= timenow.tv_usec;
344 if (timeleft->tv_usec < 0)
347 timeleft->tv_usec += 1000000;
354 if (timeleft->tv_sec == 0 && timeleft->tv_usec < 15000)
356 memset(timeleft, 0,
sizeof(
struct timeval));
365 struct timeval timeleft;
374 if (timeleft.tv_sec > 0 || timeleft.tv_usec > 0)
441 #ifndef OPENSSL_NO_HEARTBEATS
453 static void get_current_time(
struct timeval *
t)
455 #ifdef OPENSSL_SYS_WIN32
458 t->tv_sec = (long)tb.time;
459 t->tv_usec = (
long)tb.millitm * 1000;
460 #elif defined(OPENSSL_SYS_VMS)
463 t->tv_sec = (long)tb.time;
464 t->tv_usec = (
long)tb.millitm * 1000;
466 gettimeofday(t, NULL);
478 if (ret <= 0)
return ret;