aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface/call.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-30 11:11:05 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-30 11:11:05 -0700
commitf29a6c107df0aded7dac1a32bb2cbf10f98b08dd (patch)
treeef86fbb4c08e98e0c7690e01447d6b16a96d5988 /src/core/surface/call.c
parent1ffb864053d7e124411559295a2567a8aad7411a (diff)
parenta2779c122ec3b2c3b6a475afa2ed18145d1f1b61 (diff)
Merge branch 'but-maybe-i-want-to-poll' into we-dont-need-no-backup
Conflicts: Makefile build.json src/core/security/credentials.c src/core/security/credentials.h src/core/surface/call.c test/core/end2end/tests/request_response_with_payload_and_call_creds.c tools/doxygen/Doxyfile.c++ tools/doxygen/Doxyfile.core
Diffstat (limited to 'src/core/surface/call.c')
-rw-r--r--src/core/surface/call.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 31c304e556..138cd084c5 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -207,8 +207,8 @@ struct grpc_call {
/* Received call statuses from various sources */
received_status status[STATUS_SOURCE_COUNT];
- void *context[GRPC_CONTEXT_COUNT];
- void (*destroy_context[GRPC_CONTEXT_COUNT])(void *);
+ /* Contexts for various subsystems (security, tracing, ...). */
+ grpc_call_context_element context[GRPC_CONTEXT_COUNT];
/* Deadline alarm - if have_alarm is non-zero */
grpc_alarm alarm;
@@ -351,8 +351,8 @@ static void destroy_call(void *call, int ignored_success) {
grpc_mdelem_unref(c->send_initial_metadata[i].md);
}
for (i = 0; i < GRPC_CONTEXT_COUNT; i++) {
- if (c->destroy_context[i]) {
- c->destroy_context[i](c->context[i]);
+ if (c->context[i].destroy) {
+ c->context[i].destroy(c->context[i].value);
}
}
grpc_sopb_destroy(&c->send_ops);
@@ -1309,17 +1309,17 @@ grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops,
return grpc_call_start_ioreq_and_call_back(call, reqs, out, finish_func, tag);
}
-void grpc_call_context_set(grpc_call *call, grpc_context_index elem,
- void *value, void (*destroy)(void *value)) {
- if (call->destroy_context[elem]) {
- call->destroy_context[elem](value);
+void grpc_call_context_set(grpc_call *call, grpc_context_index elem, void *value,
+ void (*destroy)(void *value)) {
+ if (call->context[elem].destroy) {
+ call->context[elem].destroy(call->context[elem].value);
}
- call->context[elem] = value;
- call->destroy_context[elem] = destroy;
+ call->context[elem].value = value;
+ call->context[elem].destroy = destroy;
}
void *grpc_call_context_get(grpc_call *call, grpc_context_index elem) {
- return call->context[elem];
+ return call->context[elem].value;
}
gpr_uint8 grpc_call_is_client(grpc_call *call) { return call->is_client; }