Attempted indentation/spacing fixes
parent
1eb08e7cb6
commit
9bda8f05fc
|
@ -62,10 +62,15 @@ int main (int argc, char** argv)
|
||||||
char* certs = cert_array;
|
char* certs = cert_array;
|
||||||
char* srTest = "testing session resume";
|
char* srTest = "testing session resume";
|
||||||
/* variables used for non-blocking DTLS connect */
|
/* variables used for non-blocking DTLS connect */
|
||||||
int ret = wolfSSL_connect(ssl);
|
int ret = wolfSSL_connect(ssl);
|
||||||
int error = wolfSSL_get_error(ssl, 0);
|
int error = wolfSSL_get_error(ssl, 0);
|
||||||
int nb_sockfd = (int) wolfSSL_get_fd(ssl);
|
int nb_sockfd = (int) wolfSSL_get_fd(ssl);
|
||||||
int select_ret;
|
int select_ret;
|
||||||
|
int currTimeout;
|
||||||
|
int nfds;
|
||||||
|
int result;
|
||||||
|
fd_set recvfds, errfds;
|
||||||
|
struct timeval timeout;
|
||||||
|
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
printf("usage: udpcli <IP address>\n");
|
printf("usage: udpcli <IP address>\n");
|
||||||
|
@ -115,14 +120,15 @@ int main (int argc, char** argv)
|
||||||
/* Non-blocking code for DTLS connect */
|
/* Non-blocking code for DTLS connect */
|
||||||
|
|
||||||
while (ret != SSL_SUCCESS && (error == SSL_ERROR_WANT_READ ||
|
while (ret != SSL_SUCCESS && (error == SSL_ERROR_WANT_READ ||
|
||||||
error == SSL_ERROR_WANT_WRITE)) {
|
error == SSL_ERROR_WANT_WRITE)) {
|
||||||
|
|
||||||
/* Variables that will reset upon every iteration */
|
/* Variables that will reset upon every iteration */
|
||||||
int currTimeout = 1;
|
currTimeout = 1;
|
||||||
int nfds = nb_sockfd +1;
|
nfds = nb_sockfd + 1;
|
||||||
int result;
|
result = NULL;
|
||||||
fd_set recvfds, errfds;
|
recvfds = NULL;
|
||||||
struct timeval timeout = { (currTimeout > 0) ? currTimeout : 0, 0};
|
errfds = NULL;
|
||||||
|
timeout = { (currTimeout > 0) ? currTimeout : 0, 0};
|
||||||
|
|
||||||
if (error == SSL_ERROR_WANT_READ) {
|
if (error == SSL_ERROR_WANT_READ) {
|
||||||
printf("... client would read block\n");
|
printf("... client would read block\n");
|
||||||
|
@ -144,7 +150,7 @@ int main (int argc, char** argv)
|
||||||
select_ret = TEST_SELECT_FAIL;
|
select_ret = TEST_SELECT_FAIL;
|
||||||
|
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
select_ret = TEST_TIMEOUT;
|
select_ret = TEST_TIMEOUT;
|
||||||
}
|
}
|
||||||
else if (result > 0) {
|
else if (result > 0) {
|
||||||
if (FD_ISSET(nb_sockfd, &recvfds)) {
|
if (FD_ISSET(nb_sockfd, &recvfds)) {
|
||||||
|
@ -156,11 +162,11 @@ int main (int argc, char** argv)
|
||||||
}
|
}
|
||||||
/* End "Tcp select ..." code */
|
/* End "Tcp select ..." code */
|
||||||
|
|
||||||
if ( ( select_ret == TEST_RECV_READY) ||
|
if ( select_ret == TEST_RECV_READY ||
|
||||||
( select_ret == TEST_ERROR_READY)) {
|
select_ret == TEST_ERROR_READY ) {
|
||||||
ret = wolfSSL_connect(ssl);
|
ret = wolfSSL_connect(ssl);
|
||||||
error = wolfSSL_get_error(ssl, 0);
|
error = wolfSSL_get_error(ssl, 0);
|
||||||
}
|
}
|
||||||
else if (select_ret == TEST_TIMEOUT && !wolfSSL_dtls(ssl)) {
|
else if (select_ret == TEST_TIMEOUT && !wolfSSL_dtls(ssl)) {
|
||||||
error = 2;
|
error = 2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue