Skip to content

Commit

Permalink
slice: fix throttle not work (#7008) (#7195)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6bdf1be)

Co-authored-by: Tomato <245304590@qq.com>
  • Loading branch information
traeak and zds05 committed Oct 3, 2020
1 parent f972a70 commit 6ec727f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/experimental/slice/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/experimental/slice/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down

0 comments on commit 6ec727f

Please sign in to comment.