update tcp_connect arguments and cleanup uninitialized warnings in examples
parent
3079a10e0b
commit
85f6cc95fc
|
@ -185,7 +185,7 @@ int Client(const char* ip, word16 port)
|
|||
if ((ssl = wolfSSL_new(ctx)) == NULL)
|
||||
err_sys("issue when creating ssl");
|
||||
|
||||
tcp_connect(&fd, ip, port, 0, ssl);
|
||||
tcp_connect(&fd, ip, port, 0, 0, ssl);
|
||||
wolfSSL_set_fd(ssl, fd);
|
||||
if (wolfSSL_connect(ssl) != SSL_SUCCESS)
|
||||
err_sys("client connect failed");
|
||||
|
|
|
@ -179,7 +179,7 @@ int Server(word16 port)
|
|||
wolfSSL_SetIORecv(ctx, CbIORecv);
|
||||
wolfSSL_SetIOSend(ctx, CbIOSend);
|
||||
|
||||
tcp_accept(&listenfd, &connfd, NULL, port, 1, 0, 0, 1);
|
||||
tcp_accept(&listenfd, &connfd, NULL, 0, port, 1, 0, 0, 1);
|
||||
|
||||
if (connfd < 0) {
|
||||
err_sys("Fatal error : accept error");
|
||||
|
|
|
@ -125,7 +125,7 @@ int main()
|
|||
int loopExit = 0; /* 0 = False, 1 = True */
|
||||
int ret = 0; /* Return value */
|
||||
/* Server and client socket address structures */
|
||||
struct sockaddr_in serverAddr, clientAddr;
|
||||
struct sockaddr_in serverAddr = {0}, clientAddr = {0};
|
||||
char* cipherList = "ECDHE-ECDSA-CHACHA20-POLY1305";
|
||||
|
||||
/* Initialize wolfSSL */
|
||||
|
|
|
@ -207,7 +207,7 @@ int main()
|
|||
WOLFSSL_CTX* ctx;
|
||||
|
||||
/* Server and Client socket address structures */
|
||||
struct sockaddr_in serverAddr, clientAddr;
|
||||
struct sockaddr_in serverAddr = {0}, clientAddr = {0};
|
||||
|
||||
/* Initialize the server address struct to zero */
|
||||
memset((char *)&serverAddr, 0, sizeof(serverAddr));
|
||||
|
|
|
@ -135,7 +135,7 @@ int main()
|
|||
int loopExit = 0; /* 0 = False, 1 = True */
|
||||
|
||||
/* Server and Client socket address structures */
|
||||
struct sockaddr_in serverAddr, clientAddr;
|
||||
struct sockaddr_in serverAddr = {0}, clientAddr = {0};
|
||||
|
||||
/* Initialize the server address struct to zero */
|
||||
memset((char *)&serverAddr, 0, sizeof(serverAddr));
|
||||
|
|
|
@ -123,7 +123,7 @@ int main()
|
|||
int loopExit = 0; /* 0 = False, 1 = True */
|
||||
int ret = 0; /* Return value */
|
||||
/* Server and client socket address structures */
|
||||
struct sockaddr_in serverAddr, clientAddr;
|
||||
struct sockaddr_in serverAddr = {0}, clientAddr = {0};
|
||||
|
||||
/* Initialize wolfSSL */
|
||||
wolfSSL_Init();
|
||||
|
|
Loading…
Reference in New Issue