summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2018-01-04 19:58:01 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2018-01-04 19:58:01 +0900
commit4bd6b68d59a5ef9add2c79f8cefb15d520bfce49 (patch)
treed4ef36f0d3ab671fdcff827fe03143a385539e83
parentc882ae3d9caf1a0f01e195d0fff49607e034cc18 (diff)
WinTLS: Check return value
-rw-r--r--src/WinTLSSession.cc6
1 files changed, 4 insertions, 2 deletions
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;
}
}