diff options
author | Craig Tiller <ctiller@google.com> | 2015-02-10 16:28:30 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-02-10 16:28:30 -0800 |
commit | 70a761b3f03916cc93e63c6706571ea0d5c89318 (patch) | |
tree | 15bb025a51384c202ed3f37c1641e81a40f9178c | |
parent | 85326964b017f1c9a211ec407e2b8002a7314705 (diff) |
Make sure new rpcs always come in on server cq
-rw-r--r-- | src/core/surface/server.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 972ac28cd2..8455ccf5c9 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -771,7 +771,7 @@ grpc_call_error grpc_server_request_call(grpc_server *server, grpc_call **call, grpc_metadata_array *initial_metadata, grpc_completion_queue *cq, void *tag) { requested_call rc; - grpc_cq_begin_op(cq, NULL, GRPC_OP_COMPLETE); + grpc_cq_begin_op(server->cq, NULL, GRPC_OP_COMPLETE); rc.type = BATCH_CALL; rc.tag = tag; rc.data.batch.cq = cq; @@ -786,7 +786,7 @@ grpc_call_error grpc_server_request_registered_call( gpr_timespec *deadline, grpc_metadata_array *initial_metadata, grpc_byte_buffer **optional_payload, grpc_completion_queue *cq, void *tag) { requested_call rc; - grpc_cq_begin_op(cq, NULL, GRPC_OP_COMPLETE); + grpc_cq_begin_op(server->cq, NULL, GRPC_OP_COMPLETE); rc.type = REGISTERED_CALL; rc.tag = tag; rc.data.registered.cq = cq; @@ -918,8 +918,11 @@ static void publish_legacy(grpc_call *call, grpc_op_error status, void *tag) { static void publish_registered_or_batch(grpc_call *call, grpc_op_error status, void *tag) { - grpc_cq_end_op_complete(grpc_call_get_completion_queue(call), tag, call, - do_nothing, NULL, status); + grpc_call_element *elem = + grpc_call_stack_element(grpc_call_get_call_stack(call), 0); + channel_data *chand = elem->channel_data; + grpc_server *server = chand->server; + grpc_cq_end_op_complete(server->cq, tag, call, do_nothing, NULL, status); } const grpc_channel_args *grpc_server_get_channel_args(grpc_server *server) { |