You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2020/10/21 01:23:37 UTC

[GitHub] [trafficserver] maskit commented on a change in pull request #7282: Reduce the number of write operation on H2

maskit commented on a change in pull request #7282:
URL: https://github.com/apache/trafficserver/pull/7282#discussion_r508933688



##########
File path: proxy/http2/Http2ClientSession.cc
##########
@@ -299,18 +299,38 @@ Http2ClientSession::set_half_close_local_flag(bool flag)
 }
 
 int64_t
-Http2ClientSession::xmit(const Http2TxFrame &frame)
+Http2ClientSession::xmit(const Http2TxFrame &frame, bool flush)
 {
   int64_t len = frame.write_to(this->write_buffer);
+  this->_pending_sending_data_size += len;
+
+  // Force flush for some cases
+  if (!flush) {
+    // Flush if we already use half of the buffer to avoid adding a new block to the chain.

Review comment:
       You're right. There's no guarantee, and "flush" may be not a good name in that sense. Like the big frame case explained on next line, `write_buffer` may have multiple blocks, but it's just an unfortunate case (it always has been), so it doesn't affect the sending process.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org