mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
fixed some warnings in ssltest
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@79 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
parent
73dfbb7568
commit
efdf49ba76
@ -111,6 +111,7 @@ typedef UINT32 uint32_t;
|
|||||||
typedef INT32 int32_t;
|
typedef INT32 int32_t;
|
||||||
typedef UINT64 uint64_t;
|
typedef UINT64 uint64_t;
|
||||||
typedef INT64 int64_t;
|
typedef INT64 int64_t;
|
||||||
|
typedef int socklen_t;
|
||||||
|
|
||||||
EXP_FUNC void STDCALL gettimeofday(struct timeval* t,void* timezone);
|
EXP_FUNC void STDCALL gettimeofday(struct timeval* t,void* timezone);
|
||||||
EXP_FUNC int STDCALL strcasecmp(const char *s1, const char *s2);
|
EXP_FUNC int STDCALL strcasecmp(const char *s1, const char *s2);
|
||||||
|
@ -731,7 +731,7 @@ static int SSL_server_test(
|
|||||||
SSL_CTX *ssl_ctx = NULL;
|
SSL_CTX *ssl_ctx = NULL;
|
||||||
struct sockaddr_in client_addr;
|
struct sockaddr_in client_addr;
|
||||||
uint8_t *read_buf;
|
uint8_t *read_buf;
|
||||||
int clnt_len = sizeof(client_addr);
|
socklen_t clnt_len = sizeof(client_addr);
|
||||||
client_t client_data;
|
client_t client_data;
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
@ -808,7 +808,7 @@ static int SSL_server_test(
|
|||||||
|
|
||||||
/* Wait for a client to connect */
|
/* Wait for a client to connect */
|
||||||
if ((client_fd = accept(server_fd,
|
if ((client_fd = accept(server_fd,
|
||||||
(struct sockaddr *) &client_addr, &clnt_len)) < 0)
|
(struct sockaddr *)&client_addr, &clnt_len)) < 0)
|
||||||
{
|
{
|
||||||
ret = SSL_ERROR_SOCK_SETUP_FAILURE;
|
ret = SSL_ERROR_SOCK_SETUP_FAILURE;
|
||||||
goto error;
|
goto error;
|
||||||
@ -833,7 +833,7 @@ static int SSL_server_test(
|
|||||||
}
|
}
|
||||||
else /* looks more promising */
|
else /* looks more promising */
|
||||||
{
|
{
|
||||||
if (strstr("hello client", read_buf) == NULL)
|
if (strstr("hello client", (char *)read_buf) == NULL)
|
||||||
{
|
{
|
||||||
printf("SSL server test \"%s\" passed\n", testname);
|
printf("SSL server test \"%s\" passed\n", testname);
|
||||||
TTY_FLUSH();
|
TTY_FLUSH();
|
||||||
@ -1471,7 +1471,7 @@ static int SSL_basic_test(void)
|
|||||||
SSL_CTX *ssl_svr_ctx = NULL;
|
SSL_CTX *ssl_svr_ctx = NULL;
|
||||||
struct sockaddr_in client_addr;
|
struct sockaddr_in client_addr;
|
||||||
uint8_t *read_buf;
|
uint8_t *read_buf;
|
||||||
int clnt_len = sizeof(client_addr);
|
socklen_t clnt_len = sizeof(client_addr);
|
||||||
SSL *ssl_svr;
|
SSL *ssl_svr;
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
@ -1545,7 +1545,7 @@ error:
|
|||||||
* Multi-Threading Tests
|
* Multi-Threading Tests
|
||||||
*
|
*
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#define NUM_THREADS 200
|
#define NUM_THREADS 100
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -1630,7 +1630,7 @@ int multi_thread_test(void)
|
|||||||
pthread_t svr_threads[NUM_THREADS];
|
pthread_t svr_threads[NUM_THREADS];
|
||||||
int i, res = 0;
|
int i, res = 0;
|
||||||
struct sockaddr_in client_addr;
|
struct sockaddr_in client_addr;
|
||||||
int clnt_len = sizeof(client_addr);
|
socklen_t clnt_len = sizeof(client_addr);
|
||||||
|
|
||||||
printf("Do multi-threading test (takes a minute)\n");
|
printf("Do multi-threading test (takes a minute)\n");
|
||||||
|
|
||||||
@ -1675,8 +1675,10 @@ int multi_thread_test(void)
|
|||||||
{
|
{
|
||||||
void *thread_res;
|
void *thread_res;
|
||||||
pthread_join(svr_threads[i], &thread_res);
|
pthread_join(svr_threads[i], &thread_res);
|
||||||
|
|
||||||
if (*((int *)thread_res) != 0)
|
if (*((int *)thread_res) != 0)
|
||||||
res = 1;
|
res = 1;
|
||||||
|
|
||||||
free(thread_res);
|
free(thread_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1794,12 +1796,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
system("sh ../ssl/test/killopenssl.sh");
|
system("sh ../ssl/test/killopenssl.sh");
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (multi_thread_test())
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = 0; /* all ok */
|
ret = 0; /* all ok */
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user