Commit a6a561af authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Fix bug that timing script stalls with -m1

parent 09c468a4
...@@ -309,8 +309,7 @@ void conn_timeout_cb(EV_P_ ev_timer *w, int revents) { ...@@ -309,8 +309,7 @@ void conn_timeout_cb(EV_P_ ev_timer *w, int revents) {
namespace { namespace {
bool check_stop_client_request_timeout(Client *client, ev_timer *w) { bool check_stop_client_request_timeout(Client *client, ev_timer *w) {
if (client->req_left == 0 || if (client->req_left == 0) {
client->streams.size() >= client->session->max_concurrent_streams()) {
// no more requests to make, stop timer // no more requests to make, stop timer
ev_timer_stop(client->worker->loop, w); ev_timer_stop(client->worker->loop, w);
return true; return true;
...@@ -324,6 +323,11 @@ namespace { ...@@ -324,6 +323,11 @@ namespace {
void client_request_timeout_cb(struct ev_loop *loop, ev_timer *w, int revents) { void client_request_timeout_cb(struct ev_loop *loop, ev_timer *w, int revents) {
auto client = static_cast<Client *>(w->data); auto client = static_cast<Client *>(w->data);
if (client->streams.size() >= (size_t)config.max_concurrent_streams) {
ev_timer_stop(client->worker->loop, w);
return;
}
if (client->submit_request() != 0) { if (client->submit_request() != 0) {
ev_timer_stop(client->worker->loop, w); ev_timer_stop(client->worker->loop, w);
client->process_request_failure(); client->process_request_failure();
...@@ -833,10 +837,14 @@ void Client::on_stream_close(int32_t stream_id, bool success, bool final) { ...@@ -833,10 +837,14 @@ void Client::on_stream_close(int32_t stream_id, bool success, bool final) {
return; return;
} }
if (!config.timing_script && !final && req_left > 0 && if (!final && req_left > 0) {
submit_request() != 0) { if (config.timing_script) {
if (!ev_is_active(&request_timeout_watcher)) {
ev_feed_event(worker->loop, &request_timeout_watcher, EV_TIMER);
}
} else if (submit_request() != 0) {
process_request_failure(); process_request_failure();
return; }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment