This is an automated email from the ASF dual-hosted git repository. lserris 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 dcc83d3a70 Fix slice head request memory issue (#10285) dcc83d3a70 is described below commit dcc83d3a70277998c0437750beec585fccfcd4a6 Author: Serris Lew <serrisn...@gmail.com> 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 <lser...@apple.com> --- 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 f1c5ae7570..98c5cb8ad6 100644 --- a/plugins/experimental/slice/server.cc +++ b/plugins/experimental/slice/server.cc @@ -668,8 +668,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 @@ -682,13 +684,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)) {