diff options
author | Mark D. Roth <roth@google.com> | 2016-11-29 11:34:20 -0800 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2016-11-29 11:34:20 -0800 |
commit | 09ee8d0284a04de2ca981dbf5435f4fa798ad136 (patch) | |
tree | 9a017e6358eb3423d6f7fe0c4800112186d8559a /src/core/lib/surface/server.c | |
parent | d4d4ce5faca698551ec4bb2c52adc69433fe53c6 (diff) | |
parent | 3b04e7e3795f9f5e339ae7dfc40babb19485cfaf (diff) |
Merge remote-tracking branch 'upstream/master' into security_handshaker1
Diffstat (limited to 'src/core/lib/surface/server.c')
-rw-r--r-- | src/core/lib/surface/server.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index 89dd825460..fe73aa375c 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -195,6 +195,7 @@ struct grpc_server { grpc_completion_queue **cqs; grpc_pollset **pollsets; size_t cq_count; + size_t pollset_count; bool started; /* The two following mutexes control access to server-state @@ -1085,7 +1086,7 @@ void grpc_server_start(grpc_server *server) { GRPC_API_TRACE("grpc_server_start(server=%p)", 1, (server)); server->started = true; - size_t pollset_count = 0; + server->pollset_count = 0; server->pollsets = gpr_malloc(sizeof(grpc_pollset *) * server->cq_count); server->request_freelist_per_cq = gpr_malloc(sizeof(*server->request_freelist_per_cq) * server->cq_count); @@ -1093,7 +1094,8 @@ void grpc_server_start(grpc_server *server) { gpr_malloc(sizeof(*server->requested_calls_per_cq) * server->cq_count); for (i = 0; i < server->cq_count; i++) { if (!grpc_cq_is_non_listening_server_cq(server->cqs[i])) { - server->pollsets[pollset_count++] = grpc_cq_pollset(server->cqs[i]); + server->pollsets[server->pollset_count++] = + grpc_cq_pollset(server->cqs[i]); } server->request_freelist_per_cq[i] = gpr_stack_lockfree_create((size_t)server->max_requested_calls_per_cq); @@ -1112,7 +1114,8 @@ void grpc_server_start(grpc_server *server) { } for (l = server->listeners; l; l = l->next) { - l->start(&exec_ctx, server, l->arg, server->pollsets, pollset_count); + l->start(&exec_ctx, server, l->arg, server->pollsets, + server->pollset_count); } grpc_exec_ctx_finish(&exec_ctx); @@ -1120,7 +1123,7 @@ void grpc_server_start(grpc_server *server) { void grpc_server_get_pollsets(grpc_server *server, grpc_pollset ***pollsets, size_t *pollset_count) { - *pollset_count = server->cq_count; + *pollset_count = server->pollset_count; *pollsets = server->pollsets; } |