Browse Source

WinTLS: Check return value

Tatsuhiro Tsujikawa 7 years ago
parent
commit
4bd6b68d59
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/WinTLSSession.cc

+ 4 - 2
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;
       }
     }