diff --git a/src/factory/WFTaskFactory.inl b/src/factory/WFTaskFactory.inl index b4f7aec9..9fe7fe2a 100644 --- a/src/factory/WFTaskFactory.inl +++ b/src/factory/WFTaskFactory.inl @@ -403,20 +403,26 @@ void WFComplexClientTask::router_callback(WFRouterTask *task) template void WFComplexClientTask::dispatch() { - if (this->state == WFT_STATE_UNDEFINED) + switch (this->state) { + case WFT_STATE_UNDEFINED: if (this->check_request()) { + if (this->route_result_.request_object) + { + case WFT_STATE_SUCCESS: + this->set_request_object(route_result_.request_object); + this->WFClientTask::dispatch(); + return; + } + router_task_ = this->route(); series_of(this)->push_front(this); series_of(this)->push_front(router_task_); } - } - else if (this->state == WFT_STATE_SUCCESS) - { - this->set_request_object(route_result_.request_object); - this->WFClientTask::dispatch(); - return; + + default: + break; } this->subtask_done();