Fix typo and stop WIN32 warnings.
This commit is contained in:
parent
aab790a656
commit
10acacb3bf
1 changed files with 13 additions and 8 deletions
|
@ -66,6 +66,10 @@
|
||||||
|
|
||||||
#include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
|
|
||||||
|
#ifdef OPENSSL_SYS_WIN32
|
||||||
|
#include <sys/timeb.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define IP_MTU 14 /* linux is lame */
|
#define IP_MTU 14 /* linux is lame */
|
||||||
|
|
||||||
#ifdef WATT32
|
#ifdef WATT32
|
||||||
|
@ -204,11 +208,12 @@ static int dgram_read(BIO *b, char *out, int outl)
|
||||||
{
|
{
|
||||||
if (data->hstimeout.tv_sec > 0 || data->hstimeout.tv_usec > 0)
|
if (data->hstimeout.tv_sec > 0 || data->hstimeout.tv_usec > 0)
|
||||||
{
|
{
|
||||||
|
struct timeval curtime;
|
||||||
#ifdef OPENSSL_SYS_WIN32
|
#ifdef OPENSSL_SYS_WIN32
|
||||||
struct timeb tb;
|
struct _timeb tb;
|
||||||
ftime(&tb);
|
_ftime(&tb);
|
||||||
curtime.tv_sec = tb.time;
|
curtime.tv_sec = (long)tb.time;
|
||||||
curtime.tv_usec = tb.millitm * 1000;
|
curtime.tv_usec = (long)tb.millitm * 1000;
|
||||||
#else
|
#else
|
||||||
gettimeofday(&curtime, NULL);
|
gettimeofday(&curtime, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
@ -374,10 +379,10 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||||
if (num > 0)
|
if (num > 0)
|
||||||
{
|
{
|
||||||
#ifdef OPENSSL_SYS_WIN32
|
#ifdef OPENSSL_SYS_WIN32
|
||||||
struct timeb tb;
|
struct _timeb tb;
|
||||||
ftime(&tb);
|
_ftime(&tb);
|
||||||
data->hstimeout.tv_sec = tb.time;
|
data->hstimeout.tv_sec = (long)tb.time;
|
||||||
data->hstimeout.tv_usec = tb.millitm * 1000;
|
data->hstimeout.tv_usec = (long)tb.millitm * 1000;
|
||||||
#else
|
#else
|
||||||
gettimeofday(&(data->hstimeout), NULL);
|
gettimeofday(&(data->hstimeout), NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue