This is an automated email from the ASF dual-hosted git repository.

masaori pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new b3c5909  Fix handling read errors in TLS Handshake
b3c5909 is described below

commit b3c59095fa9cd1503ab552b72283b52c32dfb577
Author: Masaori Koshiba <masa...@apache.org>
AuthorDate: Wed Jun 7 12:39:54 2017 +0900

    Fix handling read errors in TLS Handshake
---
 iocore/net/SSLNetVConnection.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index da5af65..b0cc8fd 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -351,10 +351,12 @@ SSLNetVConnection::read_raw_data()
   // If we have already moved some bytes successfully, adjust total_read to 
reflect reality
   // If any read succeeded, we should return success
   if (r != rattempted) {
-    if (r <= 0)
+    // If the first read failds, we should return error
+    if (r <= 0 && total_read > rattempted) {
       r = total_read - rattempted;
-    else
+    } else {
       r = total_read - rattempted + r;
+    }
   }
   NET_SUM_DYN_STAT(net_read_bytes_stat, r);
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Reply via email to