diff options
author | 2015-07-01 14:52:44 -0700 | |
---|---|---|
committer | 2015-07-01 14:52:44 -0700 | |
commit | 8a187099ec8accf4f4b9c1bcea0a71d023f6389b (patch) | |
tree | ae197d56afaf80aff6a1cb6dba715dba665572bf /src/core/surface/server.c | |
parent | d7d9ce27c523798384051246e18e3f00b29dd8c9 (diff) | |
parent | f8c63562c1388262c5588e381c05cb0c02e5b406 (diff) |
Merge branch 'master' of github.com:grpc/grpc into decompression
# Conflicts:
# Makefile
# gRPC.podspec
# src/core/surface/call.c
# src/core/transport/chttp2/frame_data.c
# tools/doxygen/Doxyfile.core.internal
# vsprojects/Grpc.mak
Diffstat (limited to 'src/core/surface/server.c')
-rw-r--r-- | src/core/surface/server.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 076301777b..278ea95488 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -191,9 +191,9 @@ struct call_data { grpc_stream_op_buffer *recv_ops; grpc_stream_state *recv_state; - void (*on_done_recv)(void *user_data, int success); - void *recv_user_data; + grpc_iomgr_closure *on_done_recv; + grpc_iomgr_closure server_on_recv; grpc_iomgr_closure kill_zombie_closure; call_data **root[CALL_LIST_COUNT]; @@ -523,7 +523,7 @@ static void server_on_recv(void *ptr, int success) { break; } - calld->on_done_recv(calld->recv_user_data, success); + calld->on_done_recv->cb(calld->on_done_recv->cb_arg, success); } static void server_mutate_op(grpc_call_element *elem, grpc_transport_op *op) { @@ -534,9 +534,7 @@ static void server_mutate_op(grpc_call_element *elem, grpc_transport_op *op) { calld->recv_ops = op->recv_ops; calld->recv_state = op->recv_state; calld->on_done_recv = op->on_done_recv; - calld->recv_user_data = op->recv_user_data; - op->on_done_recv = server_on_recv; - op->recv_user_data = elem; + op->on_done_recv = &calld->server_on_recv; } } @@ -632,6 +630,8 @@ static void init_call_elem(grpc_call_element *elem, calld->deadline = gpr_inf_future; calld->call = grpc_call_from_top_element(elem); + grpc_iomgr_closure_init(&calld->server_on_recv, server_on_recv, elem); + gpr_mu_lock(&chand->server->mu_call); call_list_join(&chand->server->lists[ALL_CALLS], calld, ALL_CALLS); gpr_mu_unlock(&chand->server->mu_call); |