zwoop commented on code in PR #13202:
URL: https://github.com/apache/trafficserver/pull/13202#discussion_r3376588670


##########
src/iocore/net/SSLNetVConnection.cc:
##########
@@ -737,18 +737,17 @@ SSLNetVConnection::load_buffer_and_write(int64_t towrite, 
MIOBufferAccessor &buf
 
   Dbg(dbg_ctl_ssl, "towrite=%" PRId64, towrite);
 
+  // Per-thread scratch to coalesce fragmented blocks into one SSL_write. 
Reuse across
+  // connections is safe: a WANT_WRITE retry flushes SSL's own record buffer, 
not this.

Review Comment:
   Done — rephrased the comment as suggested.



##########
src/iocore/net/SSLNetVConnection.cc:
##########
@@ -737,18 +737,17 @@ SSLNetVConnection::load_buffer_and_write(int64_t towrite, 
MIOBufferAccessor &buf
 
   Dbg(dbg_ctl_ssl, "towrite=%" PRId64, towrite);
 
+  // Per-thread scratch to coalesce fragmented blocks into one SSL_write. 
Reuse across
+  // connections is safe: a WANT_WRITE retry flushes SSL's own record buffer, 
not this.
+  static thread_local char gather_buf[SSL_MAX_TLS_RECORD_SIZE];
+
   ERR_clear_error();
   do {
-    // What is remaining left in the next block?
-    l                   = buf.reader()->block_read_avail();
-    char *current_block = buf.reader()->start();
-
-    // check if to amount to write exceeds that in this buffer
-    int64_t wavail = towrite - total_written;
+    IOBufferReader *reader = buf.reader();
 
-    if (l > wavail) {
-      l = wavail;
-    }
+    // towrite is already bounded by read_avail() in the caller, so this never 
exceeds

Review Comment:
   Done — added `ink_assert(towrite <= buf.reader()->read_avail())` at the top 
of the function.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to