clang-format

pull/1312/head
Craig Tiller 10 years ago
parent 8b282cbd0b
commit 76f5d46d1b
  1. 4
      src/core/channel/call_op_string.c
  2. 3
      src/core/channel/client_channel.c
  3. 3
      src/core/channel/connected_channel.c
  4. 2
      src/core/channel/http_server_filter.c
  5. 2
      src/core/security/auth.c
  6. 12
      src/core/surface/call.c
  7. 4
      src/core/surface/call.h
  8. 3
      src/core/surface/client.c
  9. 2
      src/core/transport/chttp2/stream_encoder.c
  10. 35
      src/core/transport/stream_op.c

@ -112,7 +112,9 @@ char *grpc_call_op_string(grpc_call_op *op) {
gpr_strvec_add(&b, gpr_strdup("RECV_FINISH"));
break;
case GRPC_RECV_SYNTHETIC_STATUS:
gpr_asprintf(&tmp, "RECV_SYNTHETIC_STATUS status=%d message='%s'", op->data.synthetic_status.status, op->data.synthetic_status.message);
gpr_asprintf(&tmp, "RECV_SYNTHETIC_STATUS status=%d message='%s'",
op->data.synthetic_status.status,
op->data.synthetic_status.message);
gpr_strvec_add(&b, tmp);
break;
case GRPC_CANCEL_OP:

@ -215,8 +215,7 @@ static void cancel_rpc(grpc_call_element *elem, grpc_call_op *op) {
calld->state = CALL_CANCELLED;
gpr_mu_unlock(&chand->mu);
send_up_cancelled_ops(elem);
calld->s.waiting_op.done_cb(calld->s.waiting_op.user_data,
GRPC_OP_ERROR);
calld->s.waiting_op.done_cb(calld->s.waiting_op.user_data, GRPC_OP_ERROR);
return; /* early out */
case CALL_CREATED:
calld->state = CALL_CANCELLED;

@ -311,7 +311,8 @@ static void finish_message(channel_data *chand, call_data *calld) {
grpc_call_next_op(elem, &call_op);
}
static void got_metadata(grpc_call_element *elem, grpc_metadata_batch metadata) {
static void got_metadata(grpc_call_element *elem,
grpc_metadata_batch metadata) {
grpc_call_op op;
op.type = GRPC_RECV_METADATA;
op.dir = GRPC_CALL_UP;

@ -191,7 +191,7 @@ static void call_op(grpc_call_element *elem, grpc_call_element *from_elem,
if (!calld->sent_status) {
calld->sent_status = 1;
grpc_metadata_batch_add_head(&op->data.metadata, &calld->status,
grpc_mdelem_ref(channeld->status_ok));
grpc_mdelem_ref(channeld->status_ok));
}
grpc_call_next_op(elem, op);
break;

@ -80,7 +80,7 @@ static void on_credentials_metadata(void *user_data, grpc_mdelem **md_elems,
GPR_ASSERT(num_md <= MAX_CREDENTIAL_METADATA_COUNT);
for (i = 0; i < num_md; i++) {
grpc_metadata_batch_add_tail(&op.data.metadata, &calld->md_links[i],
grpc_mdelem_ref(md_elems[i]));
grpc_mdelem_ref(md_elems[i]));
}
grpc_call_next_op(elem, &op);
}

@ -661,7 +661,7 @@ static void enact_send_action(grpc_call *call, send_action sa) {
op.data.metadata.deadline = call->send_deadline;
for (i = 0; i < call->send_initial_metadata_count; i++) {
grpc_metadata_batch_link_head(&op.data.metadata,
&call->send_initial_metadata[i]);
&call->send_initial_metadata[i]);
}
op.done_cb = finish_start_step;
op.user_data = call;
@ -984,16 +984,18 @@ void grpc_call_recv_message(grpc_call_element *elem,
unlock(call);
}
void grpc_call_recv_synthetic_status(grpc_call_element *elem, grpc_status_code status, const char *message) {
void grpc_call_recv_synthetic_status(grpc_call_element *elem,
grpc_status_code status,
const char *message) {
grpc_call *call = CALL_FROM_TOP_ELEM(elem);
lock(call);
set_status_code(call, STATUS_FROM_CORE, status);
set_status_details(call, STATUS_FROM_CORE, grpc_mdstr_from_string(call->metadata_context, message));
set_status_details(call, STATUS_FROM_CORE,
grpc_mdstr_from_string(call->metadata_context, message));
unlock(call);
}
int grpc_call_recv_metadata(grpc_call_element *elem,
grpc_metadata_batch *md) {
int grpc_call_recv_metadata(grpc_call_element *elem, grpc_metadata_batch *md) {
grpc_call *call = CALL_FROM_TOP_ELEM(elem);
grpc_linked_mdelem *l;
grpc_metadata_array *dest;

@ -113,7 +113,9 @@ grpc_call_error grpc_call_start_ioreq_and_call_back(
grpc_call_stack *grpc_call_get_call_stack(grpc_call *call);
void grpc_call_recv_synthetic_status(grpc_call_element *elem, grpc_status_code status, const char *message);
void grpc_call_recv_synthetic_status(grpc_call_element *elem,
grpc_status_code status,
const char *message);
/* Given the top call_element, get the call object. */
grpc_call *grpc_call_from_top_element(grpc_call_element *surface_element);

@ -62,7 +62,8 @@ static void call_op(grpc_call_element *elem, grpc_call_element *from_elem,
grpc_call_stream_closed(elem);
break;
case GRPC_RECV_SYNTHETIC_STATUS:
grpc_call_recv_synthetic_status(elem, op->data.synthetic_status.status, op->data.synthetic_status.message);
grpc_call_recv_synthetic_status(elem, op->data.synthetic_status.status,
op->data.synthetic_status.message);
break;
default:
GPR_ASSERT(op->dir == GRPC_CALL_DOWN);

@ -43,7 +43,7 @@
#include "src/core/transport/chttp2/timeout_encoding.h"
#include "src/core/transport/chttp2/varint.h"
#define HASH_FRAGMENT_1(x) ((x) & 255)
#define HASH_FRAGMENT_1(x) ((x)&255)
#define HASH_FRAGMENT_2(x) ((x >> 8) & 255)
#define HASH_FRAGMENT_3(x) ((x >> 16) & 255)
#define HASH_FRAGMENT_4(x) ((x >> 24) & 255)

@ -139,7 +139,8 @@ void grpc_sopb_add_begin_message(grpc_stream_op_buffer *sopb, gpr_uint32 length,
assert_contained_metadata_ok(sopb->ops, sopb->nops);
}
void grpc_sopb_add_metadata(grpc_stream_op_buffer *sopb, grpc_metadata_batch b) {
void grpc_sopb_add_metadata(grpc_stream_op_buffer *sopb,
grpc_metadata_batch b) {
grpc_stream_op *op = add(sopb);
grpc_metadata_batch_assert_ok(&b);
op->type = GRPC_OP_METADATA;
@ -181,7 +182,6 @@ void grpc_sopb_append(grpc_stream_op_buffer *sopb, grpc_stream_op *ops,
assert_contained_metadata_ok(sopb->ops, sopb->nops);
}
static void assert_valid_list(grpc_mdelem_list *list) {
grpc_linked_mdelem *l;
@ -205,12 +205,13 @@ void grpc_metadata_batch_assert_ok(grpc_metadata_batch *comd) {
assert_valid_list(&comd->garbage);
}
void grpc_metadata_batch_init(grpc_metadata_batch *comd) {
comd->list.head = comd->list.tail = comd->garbage.head = comd->garbage.tail = NULL;
void grpc_metadata_batch_init(grpc_metadata_batch *comd) {
comd->list.head = comd->list.tail = comd->garbage.head = comd->garbage.tail =
NULL;
comd->deadline = gpr_inf_future;
}
void grpc_metadata_batch_destroy(grpc_metadata_batch *comd) {
void grpc_metadata_batch_destroy(grpc_metadata_batch *comd) {
grpc_linked_mdelem *l;
for (l = comd->list.head; l; l = l->next) {
grpc_mdelem_unref(l->md);
@ -221,8 +222,8 @@ void grpc_metadata_batch_destroy(grpc_metadata_batch *comd) {
}
void grpc_metadata_batch_add_head(grpc_metadata_batch *comd,
grpc_linked_mdelem *storage,
grpc_mdelem *elem_to_add) {
grpc_linked_mdelem *storage,
grpc_mdelem *elem_to_add) {
GPR_ASSERT(elem_to_add);
storage->md = elem_to_add;
grpc_metadata_batch_link_head(comd, storage);
@ -243,13 +244,13 @@ static void link_head(grpc_mdelem_list *list, grpc_linked_mdelem *storage) {
}
void grpc_metadata_batch_link_head(grpc_metadata_batch *comd,
grpc_linked_mdelem *storage) {
grpc_linked_mdelem *storage) {
link_head(&comd->list, storage);
}
void grpc_metadata_batch_add_tail(grpc_metadata_batch *comd,
grpc_linked_mdelem *storage,
grpc_mdelem *elem_to_add) {
grpc_linked_mdelem *storage,
grpc_mdelem *elem_to_add) {
GPR_ASSERT(elem_to_add);
storage->md = elem_to_add;
grpc_metadata_batch_link_tail(comd, storage);
@ -270,28 +271,28 @@ static void link_tail(grpc_mdelem_list *list, grpc_linked_mdelem *storage) {
}
void grpc_metadata_batch_link_tail(grpc_metadata_batch *comd,
grpc_linked_mdelem *storage) {
grpc_linked_mdelem *storage) {
link_tail(&comd->list, storage);
}
void grpc_metadata_batch_merge(grpc_metadata_batch *target,
grpc_metadata_batch *add) {
grpc_metadata_batch *add) {
grpc_linked_mdelem *l;
grpc_linked_mdelem *next;
for (l = add->list.head; l; l = next) {
next = l->next;
link_tail(&target->list, l);
}
}
for (l = add->garbage.head; l; l = next) {
next = l->next;
link_tail(&target->garbage, l);
}
}
}
void grpc_metadata_batch_filter(grpc_metadata_batch *comd,
grpc_mdelem *(*filter)(void *user_data,
grpc_mdelem *elem),
void *user_data) {
grpc_mdelem *(*filter)(void *user_data,
grpc_mdelem *elem),
void *user_data) {
grpc_linked_mdelem *l;
grpc_linked_mdelem *next;

Loading…
Cancel
Save