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

maskit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 599212a86e Record the amount of early data correctly (#11883)
599212a86e is described below

commit 599212a86e4d5c7adc766cd0d39403249e5acdef
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Mon Dec 9 19:15:39 2024 -0700

    Record the amount of early data correctly (#11883)
    
    * Use ALPN on autest tls_0rtt_server
    
    * Record the amount of early data correctly
    
    The amount was incremented only after TLS handshake is completed
---
 src/iocore/net/SSLNetVConnection.cc        | 1 +
 src/proxy/http2/Http2CommonSession.cc      | 5 +++--
 tests/gold_tests/tls/test-0rtt-s_client.py | 9 +++++++--
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/iocore/net/SSLNetVConnection.cc 
b/src/iocore/net/SSLNetVConnection.cc
index 88805cf32e..12055c6ca7 100644
--- a/src/iocore/net/SSLNetVConnection.cc
+++ b/src/iocore/net/SSLNetVConnection.cc
@@ -2062,6 +2062,7 @@ SSLNetVConnection::_ssl_accept()
           }
           block->fill(nread);
           this->_early_data_buf->append_block(block);
+          this->_increment_early_data_len(nread);
           Metrics::Counter::increment(ssl_rsb.early_data_received_count);
 
           if (dbg_ctl_ssl_early_data_show_received.on()) {
diff --git a/src/proxy/http2/Http2CommonSession.cc 
b/src/proxy/http2/Http2CommonSession.cc
index 37480bfb99..b05fcfb35c 100644
--- a/src/proxy/http2/Http2CommonSession.cc
+++ b/src/proxy/http2/Http2CommonSession.cc
@@ -274,8 +274,9 @@ Http2CommonSession::do_start_frame_read(Http2ErrorCode 
&ret_error)
     this->cur_frame_from_early_data  = true;
   }
 
-  Http2SsnDebug("frame header length=%u, type=%u, flags=0x%x, streamid=%u", 
(unsigned)this->current_hdr.length,
-                (unsigned)this->current_hdr.type, 
(unsigned)this->current_hdr.flags, this->current_hdr.streamid);
+  Http2SsnDebug("frame header length=%u, type=%u, flags=0x%x, streamid=%u, 
early_data=%d", (unsigned)this->current_hdr.length,
+                (unsigned)this->current_hdr.type, 
(unsigned)this->current_hdr.flags, this->current_hdr.streamid,
+                this->cur_frame_from_early_data);
 
   this->_read_buffer_reader->consume(nbytes);
 
diff --git a/tests/gold_tests/tls/test-0rtt-s_client.py 
b/tests/gold_tests/tls/test-0rtt-s_client.py
index 2983abcf58..4df61186de 100644
--- a/tests/gold_tests/tls/test-0rtt-s_client.py
+++ b/tests/gold_tests/tls/test-0rtt-s_client.py
@@ -42,10 +42,15 @@ def main():
     else:
         sni_str = ''
 
+    if args.http_ver == 'h2':
+        alpn_str = '-alpn h2'
+    else:
+        alpn_str = ''
+
     s_client_cmd_1 = shlex.split(
-        f'openssl s_client -connect 127.0.0.1:{args.ats_port} -tls1_3 -quiet 
-sess_out {sess_file_path} {sni_str}')
+        f'openssl s_client -connect 127.0.0.1:{args.ats_port} -tls1_3 -quiet 
-sess_out {sess_file_path} {sni_str} {alpn_str}')
     s_client_cmd_2 = shlex.split(
-        f'openssl s_client -connect 127.0.0.1:{args.ats_port} -tls1_3 -quiet 
-sess_in {sess_file_path} -early_data {early_data_file_path} {sni_str}'
+        f'openssl s_client -connect 127.0.0.1:{args.ats_port} -tls1_3 -quiet 
-sess_in {sess_file_path} -early_data {early_data_file_path} {sni_str} 
{alpn_str}'
     )
 
     create_sess_proc = subprocess.Popen(

Reply via email to