You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2020/07/22 17:46:28 UTC

[trafficserver] 02/02: slice: fix throttle not work (#7008)

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

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

commit a297d76ce0d279f52537aa5c3c3aadad8f57a8a6
Author: Tomato <24...@qq.com>
AuthorDate: Fri Jul 17 02:49:23 2020 +0800

    slice: fix throttle not work (#7008)
    
    (cherry picked from commit 6bdf1beedba76b7598e5bd1942521ed266993eb8)
---
 plugins/experimental/slice/client.cc | 4 ++--
 plugins/experimental/slice/server.cc | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/experimental/slice/client.cc b/plugins/experimental/slice/client.cc
index 5d4bde5..6d8d44c 100644
--- a/plugins/experimental/slice/client.cc
+++ b/plugins/experimental/slice/client.cc
@@ -136,9 +136,9 @@ handle_client_resp(TSCont contp, TSEvent event, Data *const data)
         int64_t const output_sent = data->m_bytessent;
         int64_t const threshout   = data->m_config->m_blockbytes;
 
-        if (threshout < (output_done - output_sent)) {
+        if (threshout < (output_sent - output_done)) {
           start_next_block = false;
-          DEBUG_LOG("%p handle_client_resp: throttling %" PRId64, data, (output_done - output_sent));
+          DEBUG_LOG("%p handle_client_resp: throttling %" PRId64, data, (output_sent - output_done));
         }
       }
 
diff --git a/plugins/experimental/slice/server.cc b/plugins/experimental/slice/server.cc
index 5356806..25d2147 100644
--- a/plugins/experimental/slice/server.cc
+++ b/plugins/experimental/slice/server.cc
@@ -442,9 +442,9 @@ handle_server_resp(TSCont contp, TSEvent event, Data *const data)
         int64_t const output_sent = data->m_bytessent;
         int64_t const threshout   = data->m_config->m_blockbytes;
 
-        if (threshout < (output_done - output_sent)) {
+        if (threshout < (output_sent - output_done)) {
           start_next_block = false;
-          DEBUG_LOG("%p handle_server_resp: throttling %" PRId64, data, (output_done - output_sent));
+          DEBUG_LOG("%p handle_server_resp: throttling %" PRId64, data, (output_sent - output_done));
         }
       }