From e5c04e70a7a1cbdb3f5c4e75b537d93fad3933c2 Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 28 Sep 2012 15:10:35 -0700 Subject: [PATCH] make sure existing nonblocking users still work --- examples/client/client.c | 1 + src/io.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/client/client.c b/examples/client/client.c index 6e9c23f95..6fc1023d8 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -51,6 +51,7 @@ int timeout_count = CyaSSL_dtls_get_current_timeout(ssl) * 10; while (ret != SSL_SUCCESS && (error == SSL_ERROR_WANT_READ || error == SSL_ERROR_WANT_WRITE)) { + (void)timeout_count; if (error == SSL_ERROR_WANT_READ) printf("... client would read block\n"); else diff --git a/src/io.c b/src/io.c index a956f4396..d80848210 100644 --- a/src/io.c +++ b/src/io.c @@ -167,7 +167,7 @@ int EmbedReceive(CYASSL *ssl, char *buf, int sz, void *ctx) CYASSL_MSG("Embed Receive error"); if (err == SOCKET_EWOULDBLOCK || err == SOCKET_EAGAIN) { - if (CyaSSL_get_using_nonblock(ssl)) { + if (!CyaSSL_dtls(ssl) || CyaSSL_get_using_nonblock(ssl)) { CYASSL_MSG(" Would block"); return IO_ERR_WANT_READ; }