Repository: trafficserver
Updated Branches:
  refs/heads/master 25084ea64 -> 4a86672f9


[TS-2503] : updated per James Peach's review comments


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4a86672f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4a86672f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4a86672f

Branch: refs/heads/master
Commit: 4a86672f9b7b38e1aac39c2d352031cefe004fd9
Parents: 25084ea
Author: Sudheer Vinukonda <[email protected]>
Authored: Fri Oct 17 15:56:20 2014 +0000
Committer: Sudheer Vinukonda <[email protected]>
Committed: Fri Oct 17 15:56:20 2014 +0000

----------------------------------------------------------------------
 iocore/net/SSLNetVConnection.cc | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4a86672f/iocore/net/SSLNetVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 01d9eae..d4e5f0d 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -628,7 +628,7 @@ SSLNetVConnection::load_buffer_and_write(int64_t towrite, 
int64_t &wattempted, i
   ink_hrtime now = 0;
   if (SSLConfigParams::ssl_maxrecord == -1) {
     now = ink_get_hrtime_internal();
-    int msec_since_last_write = ink_hrtime_to_msec(now - sslLastWriteTime);
+    int msec_since_last_write = ink_hrtime_diff_msec(now, sslLastWriteTime);
 
     if (msec_since_last_write > SSL_DEF_TLS_RECORD_MSEC_THRESHOLD) {
       // reset sslTotalBytesSent upon inactivity for 
SSL_DEF_TLS_RECORD_MSEC_THRESHOLD
@@ -663,13 +663,6 @@ SSLNetVConnection::load_buffer_and_write(int64_t towrite, 
int64_t &wattempted, i
     int64_t orig_l = l;
     if (SSLConfigParams::ssl_maxrecord > 0 && l > 
SSLConfigParams::ssl_maxrecord) {
       l = SSLConfigParams::ssl_maxrecord;
-
-      // if ssl_maxrecord is configured higher than SSL_MAX_TLS_RECORD_SIZE
-      // round off the SSL_write at multiples of SSL_MAX_TLS_RECORD_SIZE to
-      // ensure openSSL can flush at TLS record boundary
-      if (l > SSL_MAX_TLS_RECORD_SIZE) {
-         l -= (l % SSL_MAX_TLS_RECORD_SIZE);
-      }
     } else if (SSLConfigParams::ssl_maxrecord == -1) {
       if (sslTotalBytesSent < SSL_DEF_TLS_RECORD_BYTE_THRESHOLD) {
         dynamic_tls_record_size = SSL_DEF_TLS_RECORD_SIZE;
@@ -777,10 +770,10 @@ SSLNetVConnection::SSLNetVConnection():
   sslPreAcceptHookState(SSL_HOOKS_INIT),
   sslSNIHookState(SNI_HOOKS_INIT),
   npnSet(NULL),
-  npnEndpoint(NULL)
+  npnEndpoint(NULL),
+  sslLastWriteTime(0),
+  sslTotalBytesSent(0)
 {
-  sslLastWriteTime = 0;
-  sslTotalBytesSent = 0;
 }
 
 void
@@ -807,6 +800,8 @@ SSLNetVConnection::free(EThread * t) {
   }
   sslHandShakeComplete = false;
   sslClientConnection = false;
+  sslLastWriteTime = 0;
+  sslTotalBytesSent = 0;
   sslClientRenegotiationAbort = false;
   if (SSL_HOOKS_ACTIVE == sslPreAcceptHookState) {
     Error("SSLNetVconnection freed with outstanding hook");
@@ -973,8 +968,6 @@ SSLNetVConnection::sslServerHandShakeEvent(int &err)
     }
 
     sslHandShakeComplete = true;
-    sslLastWriteTime = 0;
-    sslTotalBytesSent = 0;
 
     if (sslHandshakeBeginTime) {
       const ink_hrtime ssl_handshake_time = ink_get_hrtime() - 
sslHandshakeBeginTime;
@@ -1097,8 +1090,6 @@ SSLNetVConnection::sslClientHandShakeEvent(int &err)
     }
 
     sslHandShakeComplete = true;
-    sslLastWriteTime = 0;
-    sslTotalBytesSent = 0;
     return EVENT_DONE;
 
   case SSL_ERROR_WANT_WRITE:

Reply via email to