Skip to content

Commit

Permalink
Change order of query responses
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsa committed Jul 24, 2017
1 parent 884de4e commit f4b348a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions irohad/torii/processor/impl/query_processor_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ namespace iroha {
response.query = query;
response.passed = false;

if (validator_.validate(query)) {
// if not valid send wrong response
if (!validator_.validate(query)) {
subject_.get_subscriber().on_next(
std::make_shared<model::QueryStatelessResponse>(response));
} else { // else send positive response on stateless validation
response.passed = true;
auto qpf_response = qpf_.execute(query);
subject_.get_subscriber().on_next(qpf_response);
subject_.get_subscriber().on_next(
std::make_shared<model::QueryStatelessResponse>(response));
}

subject_.get_subscriber().on_next(
std::make_shared<model::QueryStatelessResponse>(response));
auto qpf_response = qpf_.execute(query);
subject_.get_subscriber().on_next(qpf_response);
}

rxcpp::observable<std::shared_ptr<model::QueryResponse>>
Expand Down

0 comments on commit f4b348a

Please sign in to comment.