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

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


The following commit(s) were added to refs/heads/9.2.x by this push:
     new dc30582c34 Fix slice head request memory issue (#10285)
dc30582c34 is described below

commit dc30582c34255433672ffa7610f61ca6f11f9763
Author: Serris Lew <[email protected]>
AuthorDate: Wed Sep 6 11:50:44 2023 -0700

    Fix slice head request memory issue (#10285)
    
    * Fix slice head request memory issue
    
    * conditional syntax
    
    ---------
    
    Co-authored-by: Serris Lew <[email protected]>
    (cherry picked from commit dcc83d3a70277998c0437750beec585fccfcd4a6)
---
 plugins/experimental/slice/server.cc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/plugins/experimental/slice/server.cc 
b/plugins/experimental/slice/server.cc
index 6a2533b7a1..ba342d862e 100644
--- a/plugins/experimental/slice/server.cc
+++ b/plugins/experimental/slice/server.cc
@@ -670,8 +670,10 @@ handle_server_resp(TSCont contp, TSEvent event, Data 
*const data)
       data->m_blocknum = firstblock;
     }
 
-    // continue processing blocks?
-    if (data->m_req_range.blockIsInside(data->m_config->m_blockbytes, 
data->m_blocknum)) {
+    // continue processing blocks if more requests need to be made
+    // HEAD requests only has one slice block
+    if (data->m_req_range.blockIsInside(data->m_config->m_blockbytes, 
data->m_blocknum) &&
+        data->m_config->m_method_type != TS_HTTP_METHOD_HEAD) {
       // Don't immediately request the next slice if the client
       // isn't keeping up
 
@@ -684,13 +686,11 @@ handle_server_resp(TSCont contp, TSEvent event, Data 
*const data)
         int64_t const threshout   = data->m_config->m_blockbytes;
         int64_t const buffered    = output_sent - output_done;
 
+        // for PURGE requests, clients won't request more data (no body 
content)
         if (threshout < buffered && !data->m_config->onlyHeader()) {
           start_next_block = false;
           DEBUG_LOG("%p handle_server_resp: throttling %" PRId64, data, 
buffered);
         }
-      } else if (!data->m_config->onlyHeader()) {
-        // client doesn't need to accept server response for PURGE requests
-        start_next_block = false;
       }
       if (start_next_block) {
         if (!request_block(contp, data)) {

Reply via email to