From 2137ccc3db68c21440f0689dceb94e37cc429c0e Mon Sep 17 00:00:00 2001 From: Vic Lee Date: Thu, 19 Mar 2015 12:48:04 +0800 Subject: [PATCH] tls: retry for all SSL_ERROR_SYSCALL errors. --- libfreerdp/crypto/tls.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index bb189eb7c..b75cca2df 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -92,16 +92,7 @@ static int bio_rdp_tls_write(BIO* bio, const char* buf, int size) break; case SSL_ERROR_SYSCALL: - error = WSAGetLastError(); - if ((error == WSAEWOULDBLOCK) || (error == WSAEINTR) || - (error == WSAEINPROGRESS) || (error == WSAEALREADY)) - { - BIO_set_flags(bio, (BIO_FLAGS_WRITE | BIO_FLAGS_SHOULD_RETRY)); - } - else - { - BIO_clear_flags(bio, BIO_FLAGS_SHOULD_RETRY); - } + BIO_set_flags(bio, (BIO_FLAGS_WRITE | BIO_FLAGS_SHOULD_RETRY)); break; case SSL_ERROR_SSL: @@ -166,16 +157,7 @@ static int bio_rdp_tls_read(BIO* bio, char* buf, int size) break; case SSL_ERROR_SYSCALL: - error = WSAGetLastError(); - if ((error == WSAEWOULDBLOCK) || (error == WSAEINTR) || - (error == WSAEINPROGRESS) || (error == WSAEALREADY)) - { - BIO_set_flags(bio, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY)); - } - else - { - BIO_clear_flags(bio, BIO_FLAGS_SHOULD_RETRY); - } + BIO_set_flags(bio, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY)); break; } }