Skip to content

Commit

Permalink
libflux: flux_rpc_then should requeue cached resp
Browse files Browse the repository at this point in the history
If a response is cached in the rpc handle before flux_rpc_then()
is called, push the response back into the handle to make the
reactor ready, so the continuation will be called.
  • Loading branch information
garlick committed Jun 5, 2015
1 parent e640d9f commit 2fe6044
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/common/libflux/rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ int flux_rpc_then (flux_rpc_t rpc, flux_then_f cb, void *arg)
if (cb && !rpc->then_cb) {
if (flux_msghandler_add_match (rpc->h, rpc->m, rpc_cb, rpc) < 0)
goto done;
if (rpc->rx_msg && !rpc->rx_msg_consumed) {
if (flux_pushmsg (rpc->h, &rpc->rx_msg) < 0)
goto done;
}
} else if (!cb && rpc->then_cb) {
flux_msghandler_remove_match (rpc->h, rpc->m);
}
Expand Down

0 comments on commit 2fe6044

Please sign in to comment.