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


##########
src/iocore/net/quic/QUICStreamAdapter.cc:
##########
@@ -26,7 +26,12 @@
 Ptr<IOBufferBlock>
 QUICStreamAdapter::read(size_t len)
 {
-  auto ret = this->_read(len);
+  return this->_read(len);
+}
+
+void
+QUICStreamAdapter::consume(size_t len)
+{
+  this->_consume(len);

Review Comment:
   Changing `read()` to only peek leaves existing direct callers that drain a 
`QUICStreamAdapter` without calling `consume()` stuck reading the same bytes 
repeatedly; for example `src/proxy/http3/test/test_QPACK.cc` loops on 
`adapter->read()` until it returns 0, but `MockQUICStreamAdapter::_read()` no 
longer decreases `_sending_data_len`. Update those callers/tests to consume the 
returned length (or keep the old consuming API and add a separate peek API for 
`send_data()`).



##########
src/proxy/http3/Http3Session.cc:
##########
@@ -162,9 +162,16 @@ HQSession::main_event_handler(int event, void *edata)
   case VC_EVENT_ERROR:
   case VC_EVENT_EOS:
     this->do_io_close();
-    for (HQTransaction *t = this->_transaction_list.head; t; t = 
static_cast<HQTransaction *>(t->link.next)) {
+    while (true) {
+      HQTransaction *t = this->_transaction_list.head;
+      if (t == nullptr) {
+        break;
+      }
       SCOPED_MUTEX_LOCK(lock, t->mutex, this_ethread());
       t->handleEvent(event, edata);
+      if (this->_transaction_list.head == t) {
+        break;
+      }

Review Comment:
   This loop stops after notifying only the head transaction whenever that 
transaction survives the close/error event, so later HTTP/3 streams on the same 
session never receive the EOS/error cleanup event. Iterate over the list using 
a saved `next` pointer instead of breaking when the head is unchanged.



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