This is an automated email from the ASF dual-hosted git repository.

cmcfarlen pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 7ae3ac6c76e4def6b2614bd15a2b6dffa31455c3
Author: Masakazu Kitajo <mas...@apache.org>
AuthorDate: Thu Mar 7 09:35:17 2024 -0700

    http3: Fix a crash on READ_READY event for QPACK (#11136)
    
    * http3: Fix a crash on READ_READY event for QPACK
    
    * Fix a warning
    
    (cherry picked from commit e0aaf4bc168d1a455bfe2302088a95c6fd6c3614)
---
 src/proxy/http3/QPACK.cc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/proxy/http3/QPACK.cc b/src/proxy/http3/QPACK.cc
index 00f02e77a6..03e7446ee1 100644
--- a/src/proxy/http3/QPACK.cc
+++ b/src/proxy/http3/QPACK.cc
@@ -188,20 +188,29 @@ QPACK::on_stream_close(QUICStream &stream)
 int
 QPACK::event_handler(int event, Event *data)
 {
-  VIO *vio = reinterpret_cast<VIO *>(data);
+  VIO *vio                     = reinterpret_cast<VIO *>(data->cookie);
+  QUICStreamVCAdapter *adapter = static_cast<QUICStreamVCAdapter 
*>(vio->vc_server);
   int ret;
 
   switch (event) {
   case VC_EVENT_READ_READY:
+    adapter->clear_read_ready_event(data);
     ret = this->_on_read_ready(vio);
     break;
   case VC_EVENT_READ_COMPLETE:
+    adapter->clear_read_complete_event(data);
     ret = EVENT_DONE;
     break;
   case VC_EVENT_WRITE_READY:
+    adapter->clear_write_ready_event(data);
     ret = this->_on_write_ready(vio);
     break;
   case VC_EVENT_WRITE_COMPLETE:
+    adapter->clear_write_complete_event(data);
+    ret = EVENT_DONE;
+    break;
+  case VC_EVENT_EOS:
+    adapter->clear_eos_event(data);
     ret = EVENT_DONE;
     break;
   default:

Reply via email to