Copilot commented on code in PR #13213:
URL: https://github.com/apache/trafficserver/pull/13213#discussion_r3327303867
##########
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:
`is_writable()` is used by
`Http3App::_handle_bidi_stream_on_read_complete()` to decide whether a
bidirectional request stream can be deleted. With the new `op == VIO::WRITE &&
nbytes != ndone` check, a normal server-side stream whose request has completed
but whose response write has not been installed yet reports false, so
`delete_stream()` closes the transaction before ATS can send the response. Keep
this helper tied to the QUIC stream direction rather than the current VIO
progress, or use a separate helper for pending write data.
##########
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:
This gate checks the OpenSSL library linked into `traffic_server` via
`traffic_layout`, but the test actually runs the `openssl` command from `PATH`
and requires that CLI to support `s_client -quic`. If the build links against
OpenSSL 3.5 while the executable on `PATH` is older or lacks QUIC, the test
will run and fail before validating ATS. Please gate on the OpenSSL CLI
capability/version used by `h3_session_ticket.sh` as well.
--
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]