clang-format
diff --git a/src/core/surface/lame_client.c b/src/core/surface/lame_client.c
index 718d9b1..7817080 100644
--- a/src/core/surface/lame_client.c
+++ b/src/core/surface/lame_client.c
@@ -53,7 +53,8 @@
switch (op->type) {
case GRPC_SEND_METADATA:
grpc_metadata_batch_destroy(&op->data.metadata);
- grpc_call_recv_synthetic_status(elem, GRPC_STATUS_UNKNOWN, "Rpc sent on a lame channel.");
+ grpc_call_recv_synthetic_status(elem, GRPC_STATUS_UNKNOWN,
+ "Rpc sent on a lame channel.");
grpc_call_stream_closed(elem);
break;
default:
diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c
index 80b1027..f53c5fa 100644
--- a/src/core/transport/chttp2_transport.c
+++ b/src/core/transport/chttp2_transport.c
@@ -68,10 +68,10 @@
typedef struct transport transport;
typedef struct stream stream;
-#define IF_TRACING(stmt) \
- if (!(grpc_http_trace)) \
- ; \
- else \
+#define IF_TRACING(stmt) \
+ if (!(grpc_http_trace)) \
+ ; \
+ else \
stmt
/* streams are kept in various linked lists depending on what things need to
@@ -583,7 +583,7 @@
lock(t);
s->id = 0;
} else {
- s->id = (gpr_uint32)(gpr_uintptr) server_data;
+ s->id = (gpr_uint32)(gpr_uintptr)server_data;
t->incoming_stream = s;
grpc_chttp2_stream_map_add(&t->stream_map, s->id, s);
}
@@ -708,7 +708,8 @@
}
static void stream_list_join(transport *t, stream *s, stream_list_id id) {
- if (id == PENDING_CALLBACKS) GPR_ASSERT(t->cb != NULL || t->error_state == ERROR_STATE_NONE);
+ if (id == PENDING_CALLBACKS)
+ GPR_ASSERT(t->cb != NULL || t->error_state == ERROR_STATE_NONE);
if (s->included[id]) {
return;
}
@@ -770,7 +771,7 @@
if (t->error_state == ERROR_STATE_SEEN && !t->writing) {
call_closed = 1;
t->calling_back = 1;
- t->cb = NULL; /* no more callbacks */
+ t->cb = NULL; /* no more callbacks */
t->error_state = ERROR_STATE_NOTIFIED;
}
if (t->num_pending_goaways) {
@@ -792,8 +793,7 @@
/* perform some callbacks if necessary */
for (i = 0; i < num_goaways; i++) {
- cb->goaway(t->cb_user_data, &t->base, goaways[i].status,
- goaways[i].debug);
+ cb->goaway(t->cb_user_data, &t->base, goaways[i].status, goaways[i].debug);
}
if (perform_callbacks) {
@@ -1069,8 +1069,11 @@
static void add_incoming_metadata(transport *t, stream *s, grpc_mdelem *elem) {
if (s->incoming_metadata_capacity == s->incoming_metadata_count) {
- s->incoming_metadata_capacity = GPR_MAX(8, 2 * s->incoming_metadata_capacity);
- s->incoming_metadata = gpr_realloc(s->incoming_metadata, sizeof(*s->incoming_metadata) * s->incoming_metadata_capacity);
+ s->incoming_metadata_capacity =
+ GPR_MAX(8, 2 * s->incoming_metadata_capacity);
+ s->incoming_metadata =
+ gpr_realloc(s->incoming_metadata, sizeof(*s->incoming_metadata) *
+ s->incoming_metadata_capacity);
}
s->incoming_metadata[s->incoming_metadata_count++].md = elem;
}
@@ -1094,10 +1097,14 @@
stream_list_join(t, s, CANCELLED);
gpr_ltoa(local_status, buffer);
- add_incoming_metadata(t, s, grpc_mdelem_from_strings(t->metadata_context, "grpc-status", buffer));
+ add_incoming_metadata(
+ t, s,
+ grpc_mdelem_from_strings(t->metadata_context, "grpc-status", buffer));
switch (local_status) {
case GRPC_STATUS_CANCELLED:
- add_incoming_metadata(t, s, grpc_mdelem_from_strings(t->metadata_context, "grpc-message", "Cancelled"));
+ add_incoming_metadata(
+ t, s, grpc_mdelem_from_strings(t->metadata_context,
+ "grpc-message", "Cancelled"));
break;
default:
break;
@@ -1325,7 +1332,7 @@
t->incoming_stream = NULL;
/* if stream is accepted, we set incoming_stream in init_stream */
t->cb->accept_stream(t->cb_user_data, &t->base,
- (void *)(gpr_uintptr) t->incoming_stream_id);
+ (void *)(gpr_uintptr)t->incoming_stream_id);
s = t->incoming_stream;
if (!s) {
gpr_log(GPR_ERROR, "stream not accepted");
@@ -1456,9 +1463,7 @@
return window_update < MAX_WINDOW - window;
}
-static void free_md(void *p, grpc_op_error result) {
- gpr_free(p);
-}
+static void free_md(void *p, grpc_op_error result) { gpr_free(p); }
static void add_metadata_batch(transport *t, stream *s) {
grpc_metadata_batch b;
@@ -1477,7 +1482,8 @@
s->incoming_metadata[s->incoming_metadata_count - 1].next = NULL;
grpc_sopb_add_metadata(&s->parser.incoming_sopb, b);
- grpc_sopb_add_flow_ctl_cb(&s->parser.incoming_sopb, free_md, s->incoming_metadata);
+ grpc_sopb_add_flow_ctl_cb(&s->parser.incoming_sopb, free_md,
+ s->incoming_metadata);
/* reset */
s->incoming_deadline = gpr_inf_future;
@@ -1619,8 +1625,8 @@
"Connect string mismatch: expected '%c' (%d) got '%c' (%d) "
"at byte %d",
CLIENT_CONNECT_STRING[t->deframe_state],
- (int)(gpr_uint8) CLIENT_CONNECT_STRING[t->deframe_state],
- *cur, (int)*cur, t->deframe_state);
+ (int)(gpr_uint8)CLIENT_CONNECT_STRING[t->deframe_state], *cur,
+ (int)*cur, t->deframe_state);
drop_connection(t);
return 0;
}
@@ -1867,9 +1873,9 @@
*/
static const grpc_transport_vtable vtable = {
- sizeof(stream), init_stream, send_batch, set_allow_window_updates,
- add_to_pollset, destroy_stream, abort_stream, goaway,
- close_transport, send_ping, destroy_transport};
+ sizeof(stream), init_stream, send_batch, set_allow_window_updates,
+ add_to_pollset, destroy_stream, abort_stream, goaway, close_transport,
+ send_ping, destroy_transport};
void grpc_create_chttp2_transport(grpc_transport_setup_callback setup,
void *arg,
diff --git a/test/core/end2end/tests/cancel_before_invoke_legacy.c b/test/core/end2end/tests/cancel_before_invoke_legacy.c
index a75cf16..3614e53 100644
--- a/test/core/end2end/tests/cancel_before_invoke_legacy.c
+++ b/test/core/end2end/tests/cancel_before_invoke_legacy.c
@@ -118,8 +118,8 @@
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_invoke_old(c, f.client_cq, tag(2), tag(3), 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
- cq_expect_finished_with_status(v_client, tag(3), GRPC_STATUS_CANCELLED, "Cancelled",
- NULL);
+ cq_expect_finished_with_status(v_client, tag(3), GRPC_STATUS_CANCELLED,
+ "Cancelled", NULL);
cq_verify(v_client);
grpc_call_destroy(c);
diff --git a/test/core/transport/chttp2/stream_encoder_test.c b/test/core/transport/chttp2/stream_encoder_test.c
index fe73fb7..bda8298 100644
--- a/test/core/transport/chttp2/stream_encoder_test.c
+++ b/test/core/transport/chttp2/stream_encoder_test.c
@@ -147,20 +147,20 @@
char *key = va_arg(l, char *);
char *value = va_arg(l, char *);
if (i) {
- e[i-1].next = &e[i];
- e[i].prev = &e[i-1];
+ e[i - 1].next = &e[i];
+ e[i].prev = &e[i - 1];
}
e[i].md = grpc_mdelem_from_strings(g_mdctx, key, value);
}
e[0].prev = NULL;
- e[n-1].next = NULL;
+ e[n - 1].next = NULL;
va_end(l);
b.list.head = &e[0];
- b.list.tail = &e[n-1];
+ b.list.tail = &e[n - 1];
if (cap_to_delete == num_to_delete) {
- cap_to_delete = GPR_MAX(2*cap_to_delete, 1000);
+ cap_to_delete = GPR_MAX(2 * cap_to_delete, 1000);
to_delete = gpr_realloc(to_delete, sizeof(*to_delete) * cap_to_delete);
}
to_delete[num_to_delete++] = e;
@@ -226,11 +226,13 @@
if (i + 61 >= 127) {
gpr_asprintf(&expect,
- "000002 0104 deadbeef ff%02x 000007 0104 deadbeef 40 02%02x%02x 02%02x%02x",
+ "000002 0104 deadbeef ff%02x 000007 0104 deadbeef 40 "
+ "02%02x%02x 02%02x%02x",
i + 61 - 127, key[0], key[1], value[0], value[1]);
} else if (i > 0) {
gpr_asprintf(&expect,
- "000001 0104 deadbeef %02x 000007 0104 deadbeef 40 02%02x%02x 02%02x%02x",
+ "000001 0104 deadbeef %02x 000007 0104 deadbeef 40 "
+ "02%02x%02x 02%02x%02x",
0x80 + 61 + i, key[0], key[1], value[0], value[1]);
} else {
gpr_asprintf(&expect, "000007 0104 deadbeef 40 02%02x%02x 02%02x%02x",