aboutsummaryrefslogtreecommitdiff
path: root/lib/jsonrpc.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-01-11 13:06:42 -0800
committerBen Pfaff <blp@nicira.com>2010-01-11 13:06:42 -0800
commitf3d00a23ad9537df1e8852595d7c3737782e014c (patch)
treee4a8b16c59005f3d232670eef305982e7bc6e42a /lib/jsonrpc.c
parent03b1f24ebf7663f5695950f4586e259be9012174 (diff)
jsonrpc: Check RPC status after trying to send, not before.
This usually prevented JSON-RPC over SSL from working. Reported-by: Jeremy Stribling <strib@nicira.com>
Diffstat (limited to 'lib/jsonrpc.c')
-rw-r--r--lib/jsonrpc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index aeb1dd82..f648f6b1 100644
--- a/lib/jsonrpc.c
+++ b/lib/jsonrpc.c
@@ -278,12 +278,14 @@ jsonrpc_send_block(struct jsonrpc *rpc, struct jsonrpc_msg *msg)
return error;
}
- while (!queue_is_empty(&rpc->output) && !rpc->status) {
+ for (;;) {
jsonrpc_run(rpc);
+ if (queue_is_empty(&rpc->output) || rpc->status) {
+ return rpc->status;
+ }
jsonrpc_wait(rpc);
poll_block();
}
- return rpc->status;
}
int