update tcp_connect arguments and cleanup uninitialized warnings in examples

pull/25/head
kaleb-himes 2016-09-01 11:09:17 -06:00
parent 3079a10e0b
commit 85f6cc95fc
6 changed files with 6 additions and 6 deletions

View File

@ -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");

View File

@ -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");

View File

@ -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 */

View File

@ -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));

View File

@ -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));

View File

@ -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();