mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
net.c now depends on select() unconditionally
This commit is contained in:
@@ -65,9 +65,7 @@ static int wsa_init_done = 0;
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#if defined(MBEDTLS_HAVE_TIME)
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <fcntl.h>
|
||||
@@ -84,9 +82,7 @@ static int wsa_init_done = 0;
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_HAVE_TIME)
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
|
||||
#include <basetsd.h>
|
||||
@@ -396,7 +392,6 @@ int mbedtls_net_set_nonblock( int fd )
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_HAVE_TIME)
|
||||
/*
|
||||
* Portable usleep helper
|
||||
*/
|
||||
@@ -412,7 +407,6 @@ void mbedtls_net_usleep( unsigned long usec )
|
||||
#endif
|
||||
select( 0, NULL, NULL, NULL, &tv );
|
||||
}
|
||||
#endif /* MBEDTLS_HAVE_TIME */
|
||||
|
||||
/*
|
||||
* Read at most 'len' characters
|
||||
@@ -445,7 +439,6 @@ int mbedtls_net_recv( void *ctx, unsigned char *buf, size_t len )
|
||||
return( ret );
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_HAVE_TIME)
|
||||
/*
|
||||
* Read at most 'len' characters, blocking for at most 'timeout' ms
|
||||
*/
|
||||
@@ -486,7 +479,6 @@ int mbedtls_net_recv_timeout( void *ctx, unsigned char *buf, size_t len,
|
||||
/* This call will not block */
|
||||
return( mbedtls_net_recv( ctx, buf, len ) );
|
||||
}
|
||||
#endif /* MBEDTLS_HAVE_TIME */
|
||||
|
||||
/*
|
||||
* Write at most 'len' characters
|
||||
|
@@ -352,7 +352,7 @@ int mbedtls_timing_get_delay( void *data )
|
||||
#if defined(MBEDTLS_SELF_TEST)
|
||||
|
||||
/* To test mbedtls_net_usleep against our functions */
|
||||
#if defined(MBEDTLS_NET_C) && defined(MBEDTLS_HAVE_TIME)
|
||||
#if defined(MBEDTLS_NET_C)
|
||||
#include "mbedtls/net.h"
|
||||
#endif
|
||||
|
||||
@@ -507,7 +507,7 @@ hard_test:
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( "passed\n" );
|
||||
|
||||
#if defined(MBEDTLS_NET_C) && defined(MBEDTLS_HAVE_TIME)
|
||||
#if defined(MBEDTLS_NET_C)
|
||||
if( verbose != 0 )
|
||||
mbedtls_printf( " TIMING test #4 (net_usleep/ get_timer): " );
|
||||
|
||||
|
Reference in New Issue
Block a user