bug fix
Status: Alpha
Brought to you by:
coroberti
From: Val S. <va...@nv...> - 2009-09-10 20:37:57
|
diff -rupN curl-loader.567/trunk/curl-loader/batch.h curl-loader.567+vs4/batch.h --- curl-loader.567/trunk/curl-loader/batch.h 2009-09-10 12:33:14.000000000 -0700 +++ curl-loader.567+vs4/batch.h 2009-09-07 21:33:26.000000000 -0700 @@ -220,6 +220,9 @@ typedef struct batch_context /* List of clients free to send fixed rate requests */ int* free_clients; + /* Indicates that request scheduling is over */ + int requests_completed; + /* Request rate timer invocation sequence number within a second */ int req_rate_timer_invocation; diff -rupN curl-loader.567/trunk/curl-loader/loader_fsm.c curl-loader.567+vs4/loader_fsm.c --- curl-loader.567/trunk/curl-loader/loader_fsm.c 2009-09-10 12:33:14.000000000 -0700 +++ curl-loader.567+vs4/loader_fsm.c 2009-09-08 17:30:13.000000000 -0700 @@ -363,7 +363,10 @@ int load_next_step (client_context* cctx */ int recoverable_error_state = cctx->client_state; if (bctx->run_time && (now_time - bctx->start_time >= bctx->run_time)) + { rval_load = CSTATE_FINISHED_OK; + bctx->requests_completed = 1; + } else /* Initialize virtual client's CURL handle for the next step of loading by calling @@ -1028,6 +1031,8 @@ static int handle_req_rate_timer (timer_ ****************************************************************************************/ int pending_active_and_waiting_clients_num (batch_context* bctx) { + if (bctx->req_rate && (bctx->cycling_completed || bctx->requests_completed)) + return 0; int total = bctx->waiting_queue ? (bctx->active_clients_count + bctx->sleeping_clients_count) : bctx->active_clients_count; |