bneradt commented on code in PR #13213:
URL: https://github.com/apache/trafficserver/pull/13213#discussion_r3327326695


##########
src/iocore/net/quic/QUICStreamVCAdapter.cc:
##########
@@ -321,23 +345,34 @@ QUICStreamVCAdapter::do_io_shutdown(ShutdownHowTo_t /* 
howto ATS_UNUSED */)
 }
 
 void
-QUICStreamVCAdapter::reenable(VIO * /* vio ATS_UNUSED */)
+QUICStreamVCAdapter::reenable(VIO *vio)
 {
-  // TODO We probably need to tell QUICStream that the application consumed 
received data
-  // to update receive window here. In other words, we should not update 
receive window
-  // until the application consume data.
+  if (vio == nullptr || vio->op != VIO::WRITE) {
+    // TODO We probably need to tell QUICStream that the application consumed 
received data
+    // to update receive window here. In other words, we should not update 
receive window
+    // until the application consume data.
+    return;
+  }
+
+  const bool has_buffered_data = vio->get_reader() != nullptr && 
vio->get_reader()->read_avail() > 0;
+  const bool needs_fin         = vio->nbytes != INT64_MAX && vio->ntodo() == 0;
+  if (has_buffered_data || needs_fin) {
+    this->stream().on_write();
+  }
 }
 
 bool
 QUICStreamVCAdapter::is_readable()
 {
-  return this->stream().direction() != QUICStreamDirection::SEND && 
_read_vio.nbytes != _read_vio.ndone;
+  return this->stream().direction() != QUICStreamDirection::SEND && 
this->_read_vio.op == VIO::READ &&
+         this->_read_vio.nbytes != this->_read_vio.ndone;
 }
 
 bool
 QUICStreamVCAdapter::is_writable()
 {
-  return this->stream().direction() != QUICStreamDirection::RECEIVE && 
_write_vio.nbytes != _read_vio.ndone;
+  return this->stream().direction() != QUICStreamDirection::RECEIVE && 
this->_write_vio.op == VIO::WRITE &&
+         this->_write_vio.nbytes != this->_write_vio.ndone;

Review Comment:
   Fixed. QUICStreamVCAdapter::is_writable() now stays tied to QUIC stream 
direction, so a normal bidirectional request stream is not deleted before the 
response write VIO is installed. Pending write/FIN scheduling remains handled 
separately by reenable() and the stream send path.
   
   



##########
tests/gold_tests/h3/h3_session_ticket.test.py:
##########
@@ -0,0 +1,108 @@
+'''
+Verify HTTP/3 QUIC TLS session ticket handling.
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information regarding
+#  copyright ownership.  The ASF licenses this file to you under
+#  the Apache License, Version 2.0 (the "License"); you may not
+#  use this file except in compliance with the License.  You may
+#  obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+import os
+import shlex
+
+Test.Summary = '''
+Verify that HTTP/3 QUIC connections can receive and offer TLS session tickets.
+'''
+
+Test.SkipUnless(
+    Condition.HasATSFeature('TS_USE_QUIC'),
+    Condition.HasOpenSSLVersion('3.5.0'),

Review Comment:
   Fixed. I added Condition.HasOpenSSLQuicClient(), which checks that the 
openssl command on PATH supports s_client -quic, and added it to 
h3_session_ticket alongside the ATS-linked OpenSSL 3.5 gate.
   
   



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