don't treat peer closed / zero return as hard error in example servers

This commit is contained in:
toddouska
2017-07-12 14:15:16 -06:00
parent 43ad30d364
commit 19787e6d4f
2 changed files with 3 additions and 2 deletions

View File

@ -337,7 +337,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args)
} }
} while (err == WC_PENDING_E); } while (err == WC_PENDING_E);
if (ret <= 0) { if (ret <= 0) {
if (err != SSL_ERROR_WANT_READ) { if (err != SSL_ERROR_WANT_READ && err != SSL_ERROR_ZERO_RETURN){
printf("SSL_read echo error %d, %s!\n", err, printf("SSL_read echo error %d, %s!\n", err,
CyaSSL_ERR_error_string(err, buffer)); CyaSSL_ERR_error_string(err, buffer));
} }

View File

@ -219,7 +219,8 @@ int ServerEchoData(SSL* ssl, int clientfd, int echoData, int throughput)
} }
else else
#endif #endif
if (err != SSL_ERROR_WANT_READ) { if (err != SSL_ERROR_WANT_READ &&
err != SSL_ERROR_ZERO_RETURN) {
printf("SSL_read echo error %d\n", err); printf("SSL_read echo error %d\n", err);
err_sys_ex(runWithErrors, "SSL_read failed"); err_sys_ex(runWithErrors, "SSL_read failed");
} }