PR comments

pull/6190/head
David Garcia Quintas 9 years ago
parent 178ebc92ba
commit 879b3b9efa
  1. 15
      src/core/ext/client_config/client_channel.c
  2. 12
      src/core/lib/channel/channel_stack.c
  3. 6
      src/core/lib/channel/channel_stack.h
  4. 15
      src/core/lib/channel/connected_channel.c
  5. 15
      src/core/lib/security/client_auth_filter.c
  6. 15
      src/core/lib/surface/call.c
  7. 2
      src/core/lib/surface/call.h
  8. 8
      src/core/lib/surface/channel.c

@ -446,21 +446,20 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
gpr_mu_destroy(&chand->mu_config);
}
static void cc_set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_pollset *pollset,
grpc_pollset_set *or_pollset_set) {
GPR_ASSERT(!(pollset != NULL && or_pollset_set != NULL));
GPR_ASSERT(pollset != NULL || or_pollset_set != NULL);
static void cc_set_pollset_or_pollset_set(
grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_pollset *pollset,
grpc_pollset_set *pollset_set_alternative) {
GPR_ASSERT((pollset == NULL) + (pollset_set_alternative == NULL) == 1);
GPR_ASSERT(pollset != NULL || pollset_set_alternative != NULL);
call_data *calld = elem->call_data;
if (pollset != NULL) {
calld->pollset = pollset;
grpc_pollset_set_add_pollset(exec_ctx, calld->pollset_set, pollset);
} else if (or_pollset_set != NULL) {
} else if (pollset_set_alternative != NULL) {
calld->pollset = NULL;
grpc_pollset_set_add_pollset_set(exec_ctx, calld->pollset_set,
or_pollset_set);
pollset_set_alternative);
}
}

@ -191,22 +191,22 @@ void grpc_call_stack_init(grpc_exec_ctx *exec_ctx,
void grpc_call_stack_set_pollset_or_pollset_set(
grpc_exec_ctx *exec_ctx, grpc_call_stack *call_stack, grpc_pollset *pollset,
grpc_pollset_set *or_pollset_set) {
grpc_pollset_set *pollset_set_alternative) {
size_t count = call_stack->count;
grpc_call_element *call_elems;
char *user_data;
size_t i;
GPR_ASSERT(!(pollset != NULL && or_pollset_set != NULL));
GPR_ASSERT(pollset != NULL || or_pollset_set != NULL);
GPR_ASSERT((pollset == NULL) + (pollset_set_alternative == NULL) == 1);
GPR_ASSERT(pollset != NULL || pollset_set_alternative != NULL);
call_elems = CALL_ELEMS_FROM_STACK(call_stack);
user_data = ((char *)call_elems) +
ROUND_UP_TO_ALIGNMENT_SIZE(count * sizeof(grpc_call_element));
/* init per-filter data */
for (i = 0; i < count; i++) {
call_elems[i].filter->set_pollset_or_pollset_set(exec_ctx, &call_elems[i],
pollset, or_pollset_set);
call_elems[i].filter->set_pollset_or_pollset_set(
exec_ctx, &call_elems[i], pollset, pollset_set_alternative);
user_data +=
ROUND_UP_TO_ALIGNMENT_SIZE(call_elems[i].filter->sizeof_call_data);
}
@ -214,7 +214,7 @@ void grpc_call_stack_set_pollset_or_pollset_set(
void grpc_call_stack_ignore_set_pollset_or_pollset_set(
grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_pollset *pollset,
grpc_pollset_set *or_pollset_set) {}
grpc_pollset_set *pollset_set_alternative) {}
void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack) {
grpc_call_element *elems = CALL_ELEMS_FROM_STACK(stack);

@ -104,7 +104,7 @@ typedef struct {
void (*set_pollset_or_pollset_set)(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_pollset *pollset,
grpc_pollset_set *or_pollset_set);
grpc_pollset_set *pollset_set_alternative);
/* Destroy per call data.
The filter does not need to do any chaining */
void (*destroy_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem);
@ -203,7 +203,7 @@ void grpc_call_stack_init(grpc_exec_ctx *exec_ctx,
* op is started */
void grpc_call_stack_set_pollset_or_pollset_set(
grpc_exec_ctx *exec_ctx, grpc_call_stack *call_stack, grpc_pollset *pollset,
grpc_pollset_set *or_pollset_set);
grpc_pollset_set *pollset_set_alternative);
#ifdef GRPC_STREAM_REFCOUNT_DEBUG
#define GRPC_CALL_STACK_REF(call_stack, reason) \
@ -233,7 +233,7 @@ void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack);
* Does nothing. */
void grpc_call_stack_ignore_set_pollset_or_pollset_set(
grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_pollset *pollset,
grpc_pollset_set *or_pollset_set);
grpc_pollset_set *pollset_set_alternative);
/* Call the next operation in a call stack */
void grpc_call_next_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_transport_stream_op *op);

@ -93,22 +93,21 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
GPR_ASSERT(r == 0);
}
static void set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_pollset *pollset,
grpc_pollset_set *or_pollset_set) {
GPR_ASSERT(!(pollset != NULL && or_pollset_set != NULL));
GPR_ASSERT(pollset != NULL || or_pollset_set != NULL);
static void set_pollset_or_pollset_set(
grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_pollset *pollset,
grpc_pollset_set *pollset_set_alternative) {
GPR_ASSERT((pollset == NULL) + (pollset_set_alternative == NULL) == 1);
GPR_ASSERT(pollset != NULL || pollset_set_alternative != NULL);
call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data;
if (pollset != NULL) {
grpc_transport_set_pollset(exec_ctx, chand->transport,
TRANSPORT_STREAM_FROM_CALL_DATA(calld), pollset);
} else if (or_pollset_set != NULL) {
} else if (pollset_set_alternative != NULL) {
grpc_transport_set_pollset_set(exec_ctx, chand->transport,
TRANSPORT_STREAM_FROM_CALL_DATA(calld),
or_pollset_set);
pollset_set_alternative);
}
}

@ -271,19 +271,18 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
calld->pollset_set = grpc_pollset_set_create();
}
static void set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_pollset *pollset,
grpc_pollset_set *or_pollset_set) {
GPR_ASSERT(!(pollset != NULL && or_pollset_set != NULL));
GPR_ASSERT(pollset != NULL || or_pollset_set != NULL);
static void set_pollset_or_pollset_set(
grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_pollset *pollset,
grpc_pollset_set *pollset_set_alternative) {
GPR_ASSERT((pollset == NULL) + (pollset_set_alternative == NULL) == 1);
GPR_ASSERT(pollset != NULL || pollset_set_alternative != NULL);
call_data *calld = elem->call_data;
if (pollset != NULL) {
grpc_pollset_set_add_pollset(exec_ctx, calld->pollset_set, pollset);
} else if (or_pollset_set != NULL) {
} else if (pollset_set_alternative != NULL) {
grpc_pollset_set_add_pollset_set(exec_ctx, calld->pollset_set,
or_pollset_set);
pollset_set_alternative);
}
}

@ -248,7 +248,7 @@ static void receiving_slice_ready(grpc_exec_ctx *exec_ctx, void *bctlp,
grpc_call *grpc_call_create(
grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
grpc_completion_queue *cq, grpc_pollset_set *or_pollset_set,
grpc_completion_queue *cq, grpc_pollset_set *pollset_set_alternative,
const void *server_transport_data, grpc_mdelem **add_initial_metadata,
size_t add_initial_metadata_count, gpr_timespec send_deadline) {
size_t i, j;
@ -261,12 +261,13 @@ grpc_call *grpc_call_create(
gpr_mu_init(&call->mu);
call->channel = channel;
call->cq = cq;
if (cq != NULL && or_pollset_set != NULL) {
gpr_log(GPR_ERROR,
"Only one of 'cq' and 'or_pollset_set' should be non-NULL.");
if (cq != NULL && pollset_set_alternative != NULL) {
gpr_log(
GPR_ERROR,
"Only one of 'cq' and 'pollset_set_alternative' should be non-NULL.");
abort();
}
call->pollset_set = or_pollset_set;
call->pollset_set = pollset_set_alternative;
call->parent = parent_call;
call->is_client = server_transport_data == NULL;
if (call->is_client) {
@ -295,10 +296,10 @@ grpc_call *grpc_call_create(
grpc_call_stack_set_pollset_or_pollset_set(
&exec_ctx, CALL_STACK_FROM_CALL(call), grpc_cq_pollset(cq), NULL);
}
if (or_pollset_set != NULL) {
if (pollset_set_alternative != NULL) {
GPR_ASSERT(cq == NULL);
grpc_call_stack_set_pollset_or_pollset_set(
&exec_ctx, CALL_STACK_FROM_CALL(call), NULL, or_pollset_set);
&exec_ctx, CALL_STACK_FROM_CALL(call), NULL, pollset_set_alternative);
}
if (parent_call != NULL) {
GRPC_CALL_INTERNAL_REF(parent_call, "child");

@ -54,7 +54,7 @@ grpc_call *grpc_call_create(grpc_channel *channel, grpc_call *parent_call,
uint32_t propagation_mask,
grpc_completion_queue *cq,
/* if not NULL, it'll be used in lieu of \a cq */
grpc_pollset_set *or_pollset_set,
grpc_pollset_set *pollset_set_alternative,
const void *server_transport_data,
grpc_mdelem **add_initial_metadata,
size_t add_initial_metadata_count,

@ -166,14 +166,14 @@ char *grpc_channel_get_target(grpc_channel *channel) {
static grpc_call *grpc_channel_create_call_internal(
grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
grpc_completion_queue *cq, grpc_pollset_set *or_pollset_set,
grpc_completion_queue *cq, grpc_pollset_set *pollset_set_alternative,
grpc_mdelem *path_mdelem, grpc_mdelem *authority_mdelem,
gpr_timespec deadline) {
grpc_mdelem *send_metadata[2];
size_t num_metadata = 0;
GPR_ASSERT(channel->is_client);
GPR_ASSERT(!(cq != NULL && or_pollset_set != NULL));
GPR_ASSERT(!(cq != NULL && pollset_set_alternative != NULL));
send_metadata[num_metadata++] = path_mdelem;
if (authority_mdelem != NULL) {
@ -183,8 +183,8 @@ static grpc_call *grpc_channel_create_call_internal(
}
return grpc_call_create(channel, parent_call, propagation_mask, cq,
or_pollset_set, NULL, send_metadata, num_metadata,
deadline);
pollset_set_alternative, NULL, send_metadata,
num_metadata, deadline);
}
grpc_call *grpc_channel_create_call(grpc_channel *channel,

Loading…
Cancel
Save