From 4bd6b68d59a5ef9add2c79f8cefb15d520bfce49 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 4 Jan 2018 19:58:01 +0900 Subject: WinTLS: Check return value --- src/WinTLSSession.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/WinTLSSession.cc b/src/WinTLSSession.cc index 3ea20e41..7c51cfa7 100644 --- a/src/WinTLSSession.cc +++ b/src/WinTLSSession.cc @@ -213,8 +213,10 @@ int WinTLSSession::closeConnection() return rv; } - // Alright data is sent or buffered - if (rv - len != 0) { + // Ignore error here because we probably don't handle those + // errors gracefully. Just shutdown connection. If rv is + // positive, then data is sent or buffered + if (rv > 0 && rv - len != 0) { return TLS_ERR_WOULDBLOCK; } } -- cgit