Skip to content

Commit

Permalink
slice: fix throttle not work (apache#7008)
Browse files Browse the repository at this point in the history
  • Loading branch information
zds05 authored and Damian Meden committed Sep 2, 2020
1 parent b0ba314 commit 5b9e705
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 @@ -156,9 +156,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));
}

if (start_next_block) {
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 @@ -668,9 +668,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 5b9e705

Please sign in to comment.