aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/channel/channel_args.h2
-rw-r--r--src/core/channel/channel_stack.c11
-rw-r--r--src/core/channel/channel_stack.h2
-rw-r--r--src/core/channel/client_channel.h2
-rw-r--r--src/core/channel/client_setup.h2
-rw-r--r--src/core/channel/connected_channel.c6
-rw-r--r--src/core/channel/connected_channel.h2
-rw-r--r--src/core/channel/metadata_buffer.c2
-rw-r--r--src/core/channel/metadata_buffer.h2
-rw-r--r--src/core/channel/noop_filter.c4
-rw-r--r--src/core/channel/noop_filter.h2
-rw-r--r--src/core/compression/algorithm.h2
-rw-r--r--src/core/compression/message_compress.h2
-rw-r--r--src/core/httpcli/format_request.h2
-rw-r--r--src/core/httpcli/httpcli.h2
-rw-r--r--src/core/httpcli/httpcli_security_context.h2
-rw-r--r--src/core/httpcli/parser.h2
-rw-r--r--src/core/iomgr/pollset.h1
-rw-r--r--src/core/security/auth.c5
-rw-r--r--src/core/security/auth.h2
-rw-r--r--src/core/security/credentials.h2
-rw-r--r--src/core/security/google_root_certs.h2
-rw-r--r--src/core/security/secure_endpoint.h2
-rw-r--r--src/core/security/secure_transport_setup.h2
-rw-r--r--src/core/security/security_context.c13
-rw-r--r--src/core/security/security_context.h2
-rw-r--r--src/core/security/server_secure_chttp2.c3
-rw-r--r--src/core/statistics/census_interface.h2
-rw-r--r--src/core/statistics/census_rpc_stats.h2
-rw-r--r--src/core/support/alloc.c4
-rw-r--r--src/core/support/cpu.h2
-rw-r--r--src/core/support/murmur_hash.h2
-rw-r--r--src/core/support/thd_internal.h2
-rw-r--r--src/core/surface/call.c2
-rw-r--r--src/core/surface/call.h2
-rw-r--r--src/core/surface/channel.c2
-rw-r--r--src/core/surface/channel.h2
-rw-r--r--src/core/surface/client.c7
-rw-r--r--src/core/surface/client.h2
-rw-r--r--src/core/surface/completion_queue.h2
-rw-r--r--src/core/surface/event_string.h2
-rw-r--r--src/core/surface/server.c4
-rw-r--r--src/core/surface/server.h2
-rw-r--r--src/core/surface/surface_trace.h2
-rw-r--r--src/core/transport/chttp2/frame.h2
-rw-r--r--src/core/transport/chttp2/frame_data.c1
-rw-r--r--src/core/transport/chttp2/frame_data.h2
-rw-r--r--src/core/transport/chttp2/frame_ping.h2
-rw-r--r--src/core/transport/chttp2/frame_rst_stream.h2
-rw-r--r--src/core/transport/chttp2/frame_settings.h2
-rw-r--r--src/core/transport/chttp2/frame_window_update.h2
-rw-r--r--src/core/transport/chttp2/hpack_parser.h2
-rw-r--r--src/core/transport/chttp2/hpack_table.c124
-rw-r--r--src/core/transport/chttp2/hpack_table.h2
-rw-r--r--src/core/transport/chttp2/http2_errors.h2
-rw-r--r--src/core/transport/chttp2/status_conversion.h2
-rw-r--r--src/core/transport/chttp2/stream_encoder.h2
-rw-r--r--src/core/transport/chttp2/stream_map.h2
-rw-r--r--src/core/transport/chttp2/varint.h2
-rw-r--r--src/core/transport/chttp2_transport.h2
-rw-r--r--src/core/transport/metadata.h2
-rw-r--r--src/core/transport/stream_op.h2
-rw-r--r--src/core/transport/transport.h2
-rw-r--r--src/core/transport/transport_impl.h2
-rw-r--r--src/core/tsi/fake_transport_security.c24
-rw-r--r--src/core/tsi/fake_transport_security.h3
-rw-r--r--src/core/tsi/ssl_transport_security.c78
-rw-r--r--src/core/tsi/ssl_transport_security.h3
-rw-r--r--src/core/tsi/transport_security.c35
-rw-r--r--src/core/tsi/transport_security.h4
-rw-r--r--src/core/tsi/transport_security_interface.h31
71 files changed, 203 insertions, 262 deletions
diff --git a/src/core/channel/channel_args.h b/src/core/channel/channel_args.h
index cf38d5d01f..92280450a1 100644
--- a/src/core/channel/channel_args.h
+++ b/src/core/channel/channel_args.h
@@ -51,4 +51,4 @@ void grpc_channel_args_destroy(grpc_channel_args *a);
is specified in channel args, otherwise returns 0. */
int grpc_channel_args_is_census_enabled(const grpc_channel_args *a);
-#endif /* __GRPC_INTERNAL_CHANNEL_CHANNEL_ARGS_H__ */
+#endif /* __GRPC_INTERNAL_CHANNEL_CHANNEL_ARGS_H__ */
diff --git a/src/core/channel/channel_stack.c b/src/core/channel/channel_stack.c
index 5ee412bf7d..14fc800778 100644
--- a/src/core/channel/channel_stack.c
+++ b/src/core/channel/channel_stack.c
@@ -54,7 +54,7 @@
/* Given a size, round up to the next multiple of sizeof(void*) */
#define ROUND_UP_TO_ALIGNMENT_SIZE(x) \
- (((x)+GPR_MAX_ALIGNMENT - 1) & ~(GPR_MAX_ALIGNMENT - 1))
+ (((x) + GPR_MAX_ALIGNMENT - 1) & ~(GPR_MAX_ALIGNMENT - 1))
size_t grpc_channel_stack_size(const grpc_channel_filter **filters,
size_t filter_count) {
@@ -190,14 +190,13 @@ void grpc_channel_next_op(grpc_channel_element *elem, grpc_channel_op *op) {
grpc_channel_stack *grpc_channel_stack_from_top_element(
grpc_channel_element *elem) {
- return (grpc_channel_stack *)((char *)(elem) -
- ROUND_UP_TO_ALIGNMENT_SIZE(
- sizeof(grpc_channel_stack)));
+ return (grpc_channel_stack *)((char *)(elem)-ROUND_UP_TO_ALIGNMENT_SIZE(
+ sizeof(grpc_channel_stack)));
}
grpc_call_stack *grpc_call_stack_from_top_element(grpc_call_element *elem) {
- return (grpc_call_stack *)((char *)(elem) - ROUND_UP_TO_ALIGNMENT_SIZE(
- sizeof(grpc_call_stack)));
+ return (grpc_call_stack *)((char *)(elem)-ROUND_UP_TO_ALIGNMENT_SIZE(
+ sizeof(grpc_call_stack)));
}
static void do_nothing(void *user_data, grpc_op_error error) {}
diff --git a/src/core/channel/channel_stack.h b/src/core/channel/channel_stack.h
index 14e972f539..eb68102b43 100644
--- a/src/core/channel/channel_stack.h
+++ b/src/core/channel/channel_stack.h
@@ -302,4 +302,4 @@ void grpc_call_element_send_cancel(grpc_call_element *cur_elem);
} while (0)
#endif
-#endif /* __GRPC_INTERNAL_CHANNEL_CHANNEL_STACK_H__ */
+#endif /* __GRPC_INTERNAL_CHANNEL_CHANNEL_STACK_H__ */
diff --git a/src/core/channel/client_channel.h b/src/core/channel/client_channel.h
index 576af64ec7..6b8a7d95a8 100644
--- a/src/core/channel/client_channel.h
+++ b/src/core/channel/client_channel.h
@@ -59,4 +59,4 @@ grpc_transport_setup_result grpc_client_channel_transport_setup_complete(
grpc_channel_filter const **channel_filters, size_t num_channel_filters,
grpc_mdctx *mdctx);
-#endif /* __GRPC_INTERNAL_CHANNEL_CLIENT_CHANNEL_H__ */
+#endif /* __GRPC_INTERNAL_CHANNEL_CLIENT_CHANNEL_H__ */
diff --git a/src/core/channel/client_setup.h b/src/core/channel/client_setup.h
index a508785e60..155a9a5b1a 100644
--- a/src/core/channel/client_setup.h
+++ b/src/core/channel/client_setup.h
@@ -64,4 +64,4 @@ gpr_timespec grpc_client_setup_request_deadline(grpc_client_setup_request *r);
grpc_mdctx *grpc_client_setup_get_mdctx(grpc_client_setup_request *r);
-#endif /* __GRPC_INTERNAL_CHANNEL_CLIENT_SETUP_H__ */
+#endif /* __GRPC_INTERNAL_CHANNEL_CLIENT_SETUP_H__ */
diff --git a/src/core/channel/connected_channel.c b/src/core/channel/connected_channel.c
index e01cb81a89..30de10905c 100644
--- a/src/core/channel/connected_channel.c
+++ b/src/core/channel/connected_channel.c
@@ -69,7 +69,7 @@ typedef struct {
/* We perform a small hack to locate transport data alongside the connected
channel data in call allocations, to allow everything to be pulled in minimal
cache line requests */
-#define TRANSPORT_STREAM_FROM_CALL_DATA(calld) ((grpc_stream *)((calld)+1))
+#define TRANSPORT_STREAM_FROM_CALL_DATA(calld) ((grpc_stream *)((calld) + 1))
#define CALL_DATA_FROM_TRANSPORT_STREAM(transport_stream) \
(((call_data *)(transport_stream)) - 1)
@@ -257,9 +257,9 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_connected_channel_filter = {
- call_op, channel_op,
+ call_op, channel_op,
- sizeof(call_data), init_call_elem, destroy_call_elem,
+ sizeof(call_data), init_call_elem, destroy_call_elem,
sizeof(channel_data), init_channel_elem, destroy_channel_elem,
diff --git a/src/core/channel/connected_channel.h b/src/core/channel/connected_channel.h
index 660ea7ad89..9d143fc135 100644
--- a/src/core/channel/connected_channel.h
+++ b/src/core/channel/connected_channel.h
@@ -46,4 +46,4 @@ extern const grpc_channel_filter grpc_connected_channel_filter;
grpc_transport_setup_result grpc_connected_channel_bind_transport(
grpc_channel_stack *channel_stack, grpc_transport *transport);
-#endif /* __GRPC_INTERNAL_CHANNEL_CONNECTED_CHANNEL_H__ */
+#endif /* __GRPC_INTERNAL_CHANNEL_CONNECTED_CHANNEL_H__ */
diff --git a/src/core/channel/metadata_buffer.c b/src/core/channel/metadata_buffer.c
index 75fd90b707..d4de4ba576 100644
--- a/src/core/channel/metadata_buffer.c
+++ b/src/core/channel/metadata_buffer.c
@@ -61,7 +61,7 @@ struct grpc_metadata_buffer_impl {
size_t elem_cap;
};
-#define ELEMS(buffer) ((qelem *)((buffer)+1))
+#define ELEMS(buffer) ((qelem *)((buffer) + 1))
void grpc_metadata_buffer_init(grpc_metadata_buffer *buffer) {
/* start buffer as NULL, indicating no elements */
diff --git a/src/core/channel/metadata_buffer.h b/src/core/channel/metadata_buffer.h
index 818b290ce2..011dabed1b 100644
--- a/src/core/channel/metadata_buffer.h
+++ b/src/core/channel/metadata_buffer.h
@@ -67,4 +67,4 @@ grpc_metadata *grpc_metadata_buffer_extract_elements(
grpc_metadata_buffer *buffer);
void grpc_metadata_buffer_cleanup_elements(void *elements, grpc_op_error error);
-#endif /* __GRPC_INTERNAL_CHANNEL_METADATA_BUFFER_H__ */
+#endif /* __GRPC_INTERNAL_CHANNEL_METADATA_BUFFER_H__ */
diff --git a/src/core/channel/noop_filter.c b/src/core/channel/noop_filter.c
index b6b3f661f7..6f854a2b87 100644
--- a/src/core/channel/noop_filter.c
+++ b/src/core/channel/noop_filter.c
@@ -131,9 +131,9 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_no_op_filter = {
- call_op, channel_op,
+ call_op, channel_op,
- sizeof(call_data), init_call_elem, destroy_call_elem,
+ sizeof(call_data), init_call_elem, destroy_call_elem,
sizeof(channel_data), init_channel_elem, destroy_channel_elem,
diff --git a/src/core/channel/noop_filter.h b/src/core/channel/noop_filter.h
index 4057ff7ac9..269214f893 100644
--- a/src/core/channel/noop_filter.h
+++ b/src/core/channel/noop_filter.h
@@ -41,4 +41,4 @@
customize for their own filters */
extern const grpc_channel_filter grpc_no_op_filter;
-#endif /* __GRPC_INTERNAL_CHANNEL_NOOP_FILTER_H__ */
+#endif /* __GRPC_INTERNAL_CHANNEL_NOOP_FILTER_H__ */
diff --git a/src/core/compression/algorithm.h b/src/core/compression/algorithm.h
index 05895a889e..c5ec6d21b6 100644
--- a/src/core/compression/algorithm.h
+++ b/src/core/compression/algorithm.h
@@ -46,4 +46,4 @@ typedef enum {
const char *grpc_compression_algorithm_name(
grpc_compression_algorithm algorithm);
-#endif /* __GRPC_INTERNAL_COMPRESSION_ALGORITHM_H__ */
+#endif /* __GRPC_INTERNAL_COMPRESSION_ALGORITHM_H__ */
diff --git a/src/core/compression/message_compress.h b/src/core/compression/message_compress.h
index af8a0a5d75..564ca69a87 100644
--- a/src/core/compression/message_compress.h
+++ b/src/core/compression/message_compress.h
@@ -49,4 +49,4 @@ int grpc_msg_compress(grpc_compression_algorithm algorithm,
int grpc_msg_decompress(grpc_compression_algorithm algorithm,
gpr_slice_buffer *input, gpr_slice_buffer *output);
-#endif /* __GRPC_INTERNAL_COMPRESSION_MESSAGE_COMPRESS_H__ */
+#endif /* __GRPC_INTERNAL_COMPRESSION_MESSAGE_COMPRESS_H__ */
diff --git a/src/core/httpcli/format_request.h b/src/core/httpcli/format_request.h
index 988f872563..a82130cb93 100644
--- a/src/core/httpcli/format_request.h
+++ b/src/core/httpcli/format_request.h
@@ -42,4 +42,4 @@ gpr_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
const char *body_bytes,
size_t body_size);
-#endif /* __GRPC_INTERNAL_HTTPCLI_FORMAT_REQUEST_H__ */
+#endif /* __GRPC_INTERNAL_HTTPCLI_FORMAT_REQUEST_H__ */
diff --git a/src/core/httpcli/httpcli.h b/src/core/httpcli/httpcli.h
index ef8031354c..90f89a9366 100644
--- a/src/core/httpcli/httpcli.h
+++ b/src/core/httpcli/httpcli.h
@@ -115,4 +115,4 @@ typedef int (*grpc_httpcli_post_override)(const grpc_httpcli_request *request,
void grpc_httpcli_set_override(grpc_httpcli_get_override get,
grpc_httpcli_post_override post);
-#endif /* __GRPC_INTERNAL_HTTPCLI_HTTPCLI_H__ */
+#endif /* __GRPC_INTERNAL_HTTPCLI_HTTPCLI_H__ */
diff --git a/src/core/httpcli/httpcli_security_context.h b/src/core/httpcli/httpcli_security_context.h
index c267622e60..a73ecca0b3 100644
--- a/src/core/httpcli/httpcli_security_context.h
+++ b/src/core/httpcli/httpcli_security_context.h
@@ -40,4 +40,4 @@ grpc_security_status grpc_httpcli_ssl_channel_security_context_create(
const unsigned char *pem_root_certs, size_t pem_root_certs_size,
const char *secure_peer_name, grpc_channel_security_context **ctx);
-#endif /* __GRPC_INTERNAL_HTTPCLI_HTTPCLI_SECURITY_CONTEXT_H__ */
+#endif /* __GRPC_INTERNAL_HTTPCLI_HTTPCLI_SECURITY_CONTEXT_H__ */
diff --git a/src/core/httpcli/parser.h b/src/core/httpcli/parser.h
index e2c24a9993..520b16fd02 100644
--- a/src/core/httpcli/parser.h
+++ b/src/core/httpcli/parser.h
@@ -61,4 +61,4 @@ void grpc_httpcli_parser_destroy(grpc_httpcli_parser *parser);
int grpc_httpcli_parser_parse(grpc_httpcli_parser *parser, gpr_slice slice);
int grpc_httpcli_parser_eof(grpc_httpcli_parser *parser);
-#endif /* __GRPC_INTERNAL_HTTPCLI_PARSER_H__ */
+#endif /* __GRPC_INTERNAL_HTTPCLI_PARSER_H__ */
diff --git a/src/core/iomgr/pollset.h b/src/core/iomgr/pollset.h
index 7374a4ec13..36d80d5c29 100644
--- a/src/core/iomgr/pollset.h
+++ b/src/core/iomgr/pollset.h
@@ -35,6 +35,7 @@
#define __GRPC_INTERNAL_IOMGR_POLLSET_H_
#include <grpc/support/port_platform.h>
+#include <grpc/support/time.h>
/* A grpc_pollset is a set of file descriptors that a higher level item is
interested in. For example:
diff --git a/src/core/security/auth.c b/src/core/security/auth.c
index f743b25838..e36bf2382f 100644
--- a/src/core/security/auth.c
+++ b/src/core/security/auth.c
@@ -157,6 +157,5 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_client_auth_filter = {
- call_op, channel_op, sizeof(call_data),
- init_call_elem, destroy_call_elem, sizeof(channel_data),
- init_channel_elem, destroy_channel_elem, "auth"};
+ call_op, channel_op, sizeof(call_data), init_call_elem, destroy_call_elem,
+ sizeof(channel_data), init_channel_elem, destroy_channel_elem, "auth"};
diff --git a/src/core/security/auth.h b/src/core/security/auth.h
index 0b279f8740..94fa2aba7d 100644
--- a/src/core/security/auth.h
+++ b/src/core/security/auth.h
@@ -38,4 +38,4 @@
extern const grpc_channel_filter grpc_client_auth_filter;
-#endif /* __GRPC_INTERNAL_SECURITY_AUTH_H__ */
+#endif /* __GRPC_INTERNAL_SECURITY_AUTH_H__ */
diff --git a/src/core/security/credentials.h b/src/core/security/credentials.h
index 8559f239d5..4a2532d7c4 100644
--- a/src/core/security/credentials.h
+++ b/src/core/security/credentials.h
@@ -143,4 +143,4 @@ struct grpc_server_credentials {
const grpc_ssl_config *grpc_ssl_server_credentials_get_config(
const grpc_server_credentials *ssl_creds);
-#endif /* __GRPC_INTERNAL_SECURITY_CREDENTIALS_H__ */
+#endif /* __GRPC_INTERNAL_SECURITY_CREDENTIALS_H__ */
diff --git a/src/core/security/google_root_certs.h b/src/core/security/google_root_certs.h
index 4bcfaddcdb..30ed16c03b 100644
--- a/src/core/security/google_root_certs.h
+++ b/src/core/security/google_root_certs.h
@@ -37,4 +37,4 @@
extern unsigned char grpc_google_root_certs[];
extern unsigned int grpc_google_root_certs_size;
-#endif /* __GRPC_INTERNAL_SECURITY_GOOGLE_ROOT_CERTS_H__ */
+#endif /* __GRPC_INTERNAL_SECURITY_GOOGLE_ROOT_CERTS_H__ */
diff --git a/src/core/security/secure_endpoint.h b/src/core/security/secure_endpoint.h
index d0f0fa7d5b..20143150e0 100644
--- a/src/core/security/secure_endpoint.h
+++ b/src/core/security/secure_endpoint.h
@@ -44,4 +44,4 @@ grpc_endpoint *grpc_secure_endpoint_create(
struct tsi_frame_protector *protector, grpc_endpoint *to_wrap,
gpr_slice *leftover_slices, size_t leftover_nslices);
-#endif /* __GRPC_INTERNAL_ENDPOINT_SECURE_ENDPOINT_H__ */
+#endif /* __GRPC_INTERNAL_ENDPOINT_SECURE_ENDPOINT_H__ */
diff --git a/src/core/security/secure_transport_setup.h b/src/core/security/secure_transport_setup.h
index 50f2b08529..b13d065fbf 100644
--- a/src/core/security/secure_transport_setup.h
+++ b/src/core/security/secure_transport_setup.h
@@ -50,4 +50,4 @@ void grpc_setup_secure_transport(grpc_security_context *ctx,
grpc_secure_transport_setup_done_cb cb,
void *user_data);
-#endif /* __GRPC_INTERNAL_SECURITY_SECURE_TRANSPORT_SETUP_H__ */
+#endif /* __GRPC_INTERNAL_SECURITY_SECURE_TRANSPORT_SETUP_H__ */
diff --git a/src/core/security/security_context.c b/src/core/security/security_context.c
index a0c72e2d69..d519ecab87 100644
--- a/src/core/security/security_context.c
+++ b/src/core/security/security_context.c
@@ -100,8 +100,7 @@ grpc_arg grpc_security_context_to_arg(grpc_security_context *ctx) {
return result;
}
-grpc_security_context *grpc_security_context_from_arg(
- const grpc_arg *arg) {
+grpc_security_context *grpc_security_context_from_arg(const grpc_arg *arg) {
if (strcmp(arg->key, GRPC_SECURITY_CONTEXT_ARG)) return NULL;
if (arg->type != GRPC_ARG_POINTER) {
gpr_log(GPR_ERROR, "Invalid type %d for arg %s", arg->type,
@@ -140,9 +139,7 @@ static void fake_channel_destroy(grpc_security_context *ctx) {
gpr_free(ctx);
}
-static void fake_server_destroy(grpc_security_context *ctx) {
- gpr_free(ctx);
-}
+static void fake_server_destroy(grpc_security_context *ctx) { gpr_free(ctx); }
static grpc_security_status fake_channel_create_handshaker(
grpc_security_context *ctx, tsi_handshaker **handshaker) {
@@ -234,8 +231,7 @@ static void ssl_channel_destroy(grpc_security_context *ctx) {
}
static void ssl_server_destroy(grpc_security_context *ctx) {
- grpc_ssl_server_security_context *c =
- (grpc_ssl_server_security_context *)ctx;
+ grpc_ssl_server_security_context *c = (grpc_ssl_server_security_context *)ctx;
if (c->handshaker_factory != NULL) {
tsi_ssl_handshaker_factory_destroy(c->handshaker_factory);
}
@@ -267,8 +263,7 @@ static grpc_security_status ssl_channel_create_handshaker(
static grpc_security_status ssl_server_create_handshaker(
grpc_security_context *ctx, tsi_handshaker **handshaker) {
- grpc_ssl_server_security_context *c =
- (grpc_ssl_server_security_context *)ctx;
+ grpc_ssl_server_security_context *c = (grpc_ssl_server_security_context *)ctx;
return ssl_create_handshaker(c->handshaker_factory, 0, NULL, handshaker);
}
diff --git a/src/core/security/security_context.h b/src/core/security/security_context.h
index 65073abf0c..9ace7f1ccb 100644
--- a/src/core/security/security_context.h
+++ b/src/core/security/security_context.h
@@ -118,7 +118,7 @@ grpc_security_context *grpc_find_security_context_in_args(
typedef struct grpc_channel_security_context grpc_channel_security_context;
struct grpc_channel_security_context {
- grpc_security_context base; /* requires is_client_side to be non 0. */
+ grpc_security_context base; /* requires is_client_side to be non 0. */
grpc_credentials *request_metadata_creds;
};
diff --git a/src/core/security/server_secure_chttp2.c b/src/core/security/server_secure_chttp2.c
index 9d7c0e5e5a..931fa95651 100644
--- a/src/core/security/server_secure_chttp2.c
+++ b/src/core/security/server_secure_chttp2.c
@@ -70,8 +70,7 @@ static void on_accept(void *server, grpc_endpoint *tcp) {
const grpc_channel_args *args = grpc_server_get_channel_args(server);
grpc_security_context *ctx = grpc_find_security_context_in_args(args);
GPR_ASSERT(ctx);
- grpc_setup_secure_transport(ctx, tcp, on_secure_transport_setup_done,
- server);
+ grpc_setup_secure_transport(ctx, tcp, on_secure_transport_setup_done, server);
}
/* Note: the following code is the same with server_chttp2.c */
diff --git a/src/core/statistics/census_interface.h b/src/core/statistics/census_interface.h
index 7618387ee2..af9c70c4fb 100644
--- a/src/core/statistics/census_interface.h
+++ b/src/core/statistics/census_interface.h
@@ -73,4 +73,4 @@ census_op_id census_tracing_start_op();
/* Ends tracing. Calling this function will invalidate the input op_id. */
void census_tracing_end_op(census_op_id op_id);
-#endif /* __GRPC_INTERNAL_STATISTICS_CENSUS_INTERFACE_H__ */
+#endif /* __GRPC_INTERNAL_STATISTICS_CENSUS_INTERFACE_H__ */
diff --git a/src/core/statistics/census_rpc_stats.h b/src/core/statistics/census_rpc_stats.h
index e1ff3ac31b..a9c999aa5c 100644
--- a/src/core/statistics/census_rpc_stats.h
+++ b/src/core/statistics/census_rpc_stats.h
@@ -98,4 +98,4 @@ void census_stats_store_shutdown();
}
#endif
-#endif /* __GRPC_INTERNAL_STATISTICS_CENSUS_RPC_STATS_H__ */
+#endif /* __GRPC_INTERNAL_STATISTICS_CENSUS_RPC_STATS_H__ */
diff --git a/src/core/support/alloc.c b/src/core/support/alloc.c
index 658408f334..ddf6789773 100644
--- a/src/core/support/alloc.c
+++ b/src/core/support/alloc.c
@@ -62,6 +62,4 @@ void *gpr_malloc_aligned(size_t size, size_t alignment) {
return (void *)ret;
}
-void gpr_free_aligned(void *ptr) {
- free(((void **)ptr)[-1]);
-}
+void gpr_free_aligned(void *ptr) { free(((void **)ptr)[-1]); }
diff --git a/src/core/support/cpu.h b/src/core/support/cpu.h
index 6ac0db35e5..2435ec0353 100644
--- a/src/core/support/cpu.h
+++ b/src/core/support/cpu.h
@@ -46,4 +46,4 @@ int gpr_cpu_num_cores();
[0, gpr_cpu_num_cores() - 1] */
int gpr_cpu_current_cpu();
-#endif /* __GRPC_INTERNAL_SUPPORT_CPU_H__ */
+#endif /* __GRPC_INTERNAL_SUPPORT_CPU_H__ */
diff --git a/src/core/support/murmur_hash.h b/src/core/support/murmur_hash.h
index 5643717cd2..2ebf3e57b1 100644
--- a/src/core/support/murmur_hash.h
+++ b/src/core/support/murmur_hash.h
@@ -41,4 +41,4 @@
/* compute the hash of key (length len) */
gpr_uint32 gpr_murmur_hash3(const void *key, size_t len, gpr_uint32 seed);
-#endif /* __GRPC_INTERNAL_SUPPORT_MURMUR_HASH_H__ */
+#endif /* __GRPC_INTERNAL_SUPPORT_MURMUR_HASH_H__ */
diff --git a/src/core/support/thd_internal.h b/src/core/support/thd_internal.h
index 519177a555..190d4e3668 100644
--- a/src/core/support/thd_internal.h
+++ b/src/core/support/thd_internal.h
@@ -36,4 +36,4 @@
/* Internal interfaces between modules within the gpr support library. */
-#endif /* __GRPC_INTERNAL_SUPPORT_THD_INTERNAL_H__ */
+#endif /* __GRPC_INTERNAL_SUPPORT_THD_INTERNAL_H__ */
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 9c5f5064eb..4ea8378d96 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -197,7 +197,7 @@ struct grpc_call {
gpr_refcount internal_refcount;
};
-#define CALL_STACK_FROM_CALL(call) ((grpc_call_stack *)((call)+1))
+#define CALL_STACK_FROM_CALL(call) ((grpc_call_stack *)((call) + 1))
#define CALL_FROM_CALL_STACK(call_stack) (((grpc_call *)(call_stack)) - 1)
#define CALL_ELEM_FROM_CALL(call, idx) \
grpc_call_stack_element(CALL_STACK_FROM_CALL(call), idx)
diff --git a/src/core/surface/call.h b/src/core/surface/call.h
index 5c2ef3be18..01605bb38a 100644
--- a/src/core/surface/call.h
+++ b/src/core/surface/call.h
@@ -73,4 +73,4 @@ grpc_metadata_buffer *grpc_call_get_metadata_buffer(grpc_call *call);
void grpc_call_add_mdelem(grpc_call *call, grpc_mdelem *mdelem,
gpr_uint32 flags);
-#endif /* __GRPC_INTERNAL_SURFACE_CALL_H__ */
+#endif /* __GRPC_INTERNAL_SURFACE_CALL_H__ */
diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c
index 8ef13675fe..a1bcea58dd 100644
--- a/src/core/surface/channel.c
+++ b/src/core/surface/channel.c
@@ -51,7 +51,7 @@ struct grpc_channel {
grpc_mdstr *authority_string;
};
-#define CHANNEL_STACK_FROM_CHANNEL(c) ((grpc_channel_stack *)((c)+1))
+#define CHANNEL_STACK_FROM_CHANNEL(c) ((grpc_channel_stack *)((c) + 1))
grpc_channel *grpc_channel_create_from_filters(
const grpc_channel_filter **filters, size_t num_filters,
diff --git a/src/core/surface/channel.h b/src/core/surface/channel.h
index 11d4939916..b3ea2ede40 100644
--- a/src/core/surface/channel.h
+++ b/src/core/surface/channel.h
@@ -48,4 +48,4 @@ grpc_mdstr *grpc_channel_get_message_string(grpc_channel *channel);
void grpc_channel_internal_ref(grpc_channel *channel);
void grpc_channel_internal_unref(grpc_channel *channel);
-#endif /* __GRPC_INTERNAL_SURFACE_CHANNEL_H__ */
+#endif /* __GRPC_INTERNAL_SURFACE_CHANNEL_H__ */
diff --git a/src/core/surface/client.c b/src/core/surface/client.c
index 98cb460d63..524b0718a9 100644
--- a/src/core/surface/client.c
+++ b/src/core/surface/client.c
@@ -106,13 +106,12 @@ static void init_channel_elem(grpc_channel_element *elem,
GPR_ASSERT(!is_last);
}
-static void destroy_channel_elem(grpc_channel_element *elem) {
-}
+static void destroy_channel_elem(grpc_channel_element *elem) {}
const grpc_channel_filter grpc_client_surface_filter = {
- call_op, channel_op,
+ call_op, channel_op,
- sizeof(call_data), init_call_elem, destroy_call_elem,
+ sizeof(call_data), init_call_elem, destroy_call_elem,
sizeof(channel_data), init_channel_elem, destroy_channel_elem,
diff --git a/src/core/surface/client.h b/src/core/surface/client.h
index eb567276e2..cff3d401d9 100644
--- a/src/core/surface/client.h
+++ b/src/core/surface/client.h
@@ -38,4 +38,4 @@
extern const grpc_channel_filter grpc_client_surface_filter;
-#endif /* __GRPC_INTERNAL_SURFACE_CLIENT_H__ */
+#endif /* __GRPC_INTERNAL_SURFACE_CLIENT_H__ */
diff --git a/src/core/surface/completion_queue.h b/src/core/surface/completion_queue.h
index 2e752a3fe0..5e45749396 100644
--- a/src/core/surface/completion_queue.h
+++ b/src/core/surface/completion_queue.h
@@ -104,4 +104,4 @@ void grpc_cq_dump_pending_ops(grpc_completion_queue *cc);
grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc);
-#endif /* __GRPC_INTERNAL_SURFACE_COMPLETION_QUEUE_H__ */
+#endif /* __GRPC_INTERNAL_SURFACE_COMPLETION_QUEUE_H__ */
diff --git a/src/core/surface/event_string.h b/src/core/surface/event_string.h
index 30b693e95c..b34e2d152b 100644
--- a/src/core/surface/event_string.h
+++ b/src/core/surface/event_string.h
@@ -39,4 +39,4 @@
/* Returns a string describing an event. Must be later freed with gpr_free() */
char *grpc_event_string(grpc_event *ev);
-#endif /* __GRPC_INTERNAL_SURFACE_EVENT_STRING_H__ */
+#endif /* __GRPC_INTERNAL_SURFACE_EVENT_STRING_H__ */
diff --git a/src/core/surface/server.c b/src/core/surface/server.c
index aa544a97f2..167bfe97d1 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -405,9 +405,9 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
static const grpc_channel_filter server_surface_filter = {
- call_op, channel_op,
+ call_op, channel_op,
- sizeof(call_data), init_call_elem, destroy_call_elem,
+ sizeof(call_data), init_call_elem, destroy_call_elem,
sizeof(channel_data), init_channel_elem, destroy_channel_elem,
diff --git a/src/core/surface/server.h b/src/core/surface/server.h
index 61292ebe4e..50574d66a4 100644
--- a/src/core/surface/server.h
+++ b/src/core/surface/server.h
@@ -60,4 +60,4 @@ grpc_transport_setup_result grpc_server_setup_transport(
const grpc_channel_args *grpc_server_get_channel_args(grpc_server *server);
-#endif /* __GRPC_INTERNAL_SURFACE_SERVER_H__ */
+#endif /* __GRPC_INTERNAL_SURFACE_SERVER_H__ */
diff --git a/src/core/surface/surface_trace.h b/src/core/surface/surface_trace.h
index f6f9acfd9c..df1aea9669 100644
--- a/src/core/surface/surface_trace.h
+++ b/src/core/surface/surface_trace.h
@@ -51,4 +51,4 @@
} while (0)
#endif
-#endif /* __GRPC_INTERNAL_SURFACE_SURFACE_TRACE_H__ */
+#endif /* __GRPC_INTERNAL_SURFACE_SURFACE_TRACE_H__ */
diff --git a/src/core/transport/chttp2/frame.h b/src/core/transport/chttp2/frame.h
index a04e442ed6..6d28638309 100644
--- a/src/core/transport/chttp2/frame.h
+++ b/src/core/transport/chttp2/frame.h
@@ -77,4 +77,4 @@ typedef struct {
#define GRPC_CHTTP2_DATA_FLAG_PADDED 8
#define GRPC_CHTTP2_FLAG_HAS_PRIORITY 0x20
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_H__ */
diff --git a/src/core/transport/chttp2/frame_data.c b/src/core/transport/chttp2/frame_data.c
index fbd3b6cabf..c22a223737 100644
--- a/src/core/transport/chttp2/frame_data.c
+++ b/src/core/transport/chttp2/frame_data.c
@@ -161,4 +161,3 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_parse(
abort();
return GRPC_CHTTP2_CONNECTION_ERROR;
}
-
diff --git a/src/core/transport/chttp2/frame_data.h b/src/core/transport/chttp2/frame_data.h
index abe26dab76..c260059e8b 100644
--- a/src/core/transport/chttp2/frame_data.h
+++ b/src/core/transport/chttp2/frame_data.h
@@ -77,4 +77,4 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_parse(
/* create a slice with an empty data frame and is_last set */
gpr_slice grpc_chttp2_data_frame_create_empty_close(gpr_uint32 id);
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_DATA_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_DATA_H__ */
diff --git a/src/core/transport/chttp2/frame_ping.h b/src/core/transport/chttp2/frame_ping.h
index a64d53644b..fa778c51b2 100644
--- a/src/core/transport/chttp2/frame_ping.h
+++ b/src/core/transport/chttp2/frame_ping.h
@@ -50,4 +50,4 @@ grpc_chttp2_parse_error grpc_chttp2_ping_parser_begin_frame(
grpc_chttp2_parse_error grpc_chttp2_ping_parser_parse(
void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last);
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_PING_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_PING_H__ */
diff --git a/src/core/transport/chttp2/frame_rst_stream.h b/src/core/transport/chttp2/frame_rst_stream.h
index 78aea0f26a..dbb262971b 100644
--- a/src/core/transport/chttp2/frame_rst_stream.h
+++ b/src/core/transport/chttp2/frame_rst_stream.h
@@ -38,4 +38,4 @@
gpr_slice grpc_chttp2_rst_stream_create(gpr_uint32 stream_id, gpr_uint32 code);
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H__ */
diff --git a/src/core/transport/chttp2/frame_settings.h b/src/core/transport/chttp2/frame_settings.h
index dcb8b00ca1..855f9636bb 100644
--- a/src/core/transport/chttp2/frame_settings.h
+++ b/src/core/transport/chttp2/frame_settings.h
@@ -96,4 +96,4 @@ grpc_chttp2_parse_error grpc_chttp2_settings_parser_begin_frame(
grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse(
void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last);
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_SETTINGS_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_SETTINGS_H__ */
diff --git a/src/core/transport/chttp2/frame_window_update.h b/src/core/transport/chttp2/frame_window_update.h
index 4b789fcc4a..2d9e6c4dcb 100644
--- a/src/core/transport/chttp2/frame_window_update.h
+++ b/src/core/transport/chttp2/frame_window_update.h
@@ -52,4 +52,4 @@ grpc_chttp2_parse_error grpc_chttp2_window_update_parser_begin_frame(
grpc_chttp2_parse_error grpc_chttp2_window_update_parser_parse(
void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last);
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H__ */
diff --git a/src/core/transport/chttp2/hpack_parser.h b/src/core/transport/chttp2/hpack_parser.h
index 799513e7ff..b0a0d76713 100644
--- a/src/core/transport/chttp2/hpack_parser.h
+++ b/src/core/transport/chttp2/hpack_parser.h
@@ -108,4 +108,4 @@ grpc_chttp2_parse_error grpc_chttp2_header_parser_parse(
void *hpack_parser, grpc_chttp2_parse_state *state, gpr_slice slice,
int is_last);
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_PARSER_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_PARSER_H__ */
diff --git a/src/core/transport/chttp2/hpack_table.c b/src/core/transport/chttp2/hpack_table.c
index 8f2ebecfeb..ae8bfa8009 100644
--- a/src/core/transport/chttp2/hpack_table.c
+++ b/src/core/transport/chttp2/hpack_table.c
@@ -43,68 +43,68 @@ static struct {
const char *key;
const char *value;
} static_table[] = {
- /* 0: */ {NULL, NULL},
- /* 1: */ {":authority", ""},
- /* 2: */ {":method", "GET"},
- /* 3: */ {":method", "POST"},
- /* 4: */ {":path", "/"},
- /* 5: */ {":path", "/index.html"},
- /* 6: */ {":scheme", "http"},
- /* 7: */ {":scheme", "https"},
- /* 8: */ {":status", "200"},
- /* 9: */ {":status", "204"},
- /* 10: */ {":status", "206"},
- /* 11: */ {":status", "304"},
- /* 12: */ {":status", "400"},
- /* 13: */ {":status", "404"},
- /* 14: */ {":status", "500"},
- /* 15: */ {"accept-charset", ""},
- /* 16: */ {"accept-encoding", "gzip, deflate"},
- /* 17: */ {"accept-language", ""},
- /* 18: */ {"accept-ranges", ""},
- /* 19: */ {"accept", ""},
- /* 20: */ {"access-control-allow-origin", ""},
- /* 21: */ {"age", ""},
- /* 22: */ {"allow", ""},
- /* 23: */ {"authorization", ""},
- /* 24: */ {"cache-control", ""},
- /* 25: */ {"content-disposition", ""},
- /* 26: */ {"content-encoding", ""},
- /* 27: */ {"content-language", ""},
- /* 28: */ {"content-length", ""},
- /* 29: */ {"content-location", ""},
- /* 30: */ {"content-range", ""},
- /* 31: */ {"content-type", ""},
- /* 32: */ {"cookie", ""},
- /* 33: */ {"date", ""},
- /* 34: */ {"etag", ""},
- /* 35: */ {"expect", ""},
- /* 36: */ {"expires", ""},
- /* 37: */ {"from", ""},
- /* 38: */ {"host", ""},
- /* 39: */ {"if-match", ""},
- /* 40: */ {"if-modified-since", ""},
- /* 41: */ {"if-none-match", ""},
- /* 42: */ {"if-range", ""},
- /* 43: */ {"if-unmodified-since", ""},
- /* 44: */ {"last-modified", ""},
- /* 45: */ {"link", ""},
- /* 46: */ {"location", ""},
- /* 47: */ {"max-forwards", ""},
- /* 48: */ {"proxy-authenticate", ""},
- /* 49: */ {"proxy-authorization", ""},
- /* 50: */ {"range", ""},
- /* 51: */ {"referer", ""},
- /* 52: */ {"refresh", ""},
- /* 53: */ {"retry-after", ""},
- /* 54: */ {"server", ""},
- /* 55: */ {"set-cookie", ""},
- /* 56: */ {"strict-transport-security", ""},
- /* 57: */ {"transfer-encoding", ""},
- /* 58: */ {"user-agent", ""},
- /* 59: */ {"vary", ""},
- /* 60: */ {"via", ""},
- /* 61: */ {"www-authenticate", ""},
+ /* 0: */ {NULL, NULL},
+ /* 1: */ {":authority", ""},
+ /* 2: */ {":method", "GET"},
+ /* 3: */ {":method", "POST"},
+ /* 4: */ {":path", "/"},
+ /* 5: */ {":path", "/index.html"},
+ /* 6: */ {":scheme", "http"},
+ /* 7: */ {":scheme", "https"},
+ /* 8: */ {":status", "200"},
+ /* 9: */ {":status", "204"},
+ /* 10: */ {":status", "206"},
+ /* 11: */ {":status", "304"},
+ /* 12: */ {":status", "400"},
+ /* 13: */ {":status", "404"},
+ /* 14: */ {":status", "500"},
+ /* 15: */ {"accept-charset", ""},
+ /* 16: */ {"accept-encoding", "gzip, deflate"},
+ /* 17: */ {"accept-language", ""},
+ /* 18: */ {"accept-ranges", ""},
+ /* 19: */ {"accept", ""},
+ /* 20: */ {"access-control-allow-origin", ""},
+ /* 21: */ {"age", ""},
+ /* 22: */ {"allow", ""},
+ /* 23: */ {"authorization", ""},
+ /* 24: */ {"cache-control", ""},
+ /* 25: */ {"content-disposition", ""},
+ /* 26: */ {"content-encoding", ""},
+ /* 27: */ {"content-language", ""},
+ /* 28: */ {"content-length", ""},
+ /* 29: */ {"content-location", ""},
+ /* 30: */ {"content-range", ""},
+ /* 31: */ {"content-type", ""},
+ /* 32: */ {"cookie", ""},
+ /* 33: */ {"date", ""},
+ /* 34: */ {"etag", ""},
+ /* 35: */ {"expect", ""},
+ /* 36: */ {"expires", ""},
+ /* 37: */ {"from", ""},
+ /* 38: */ {"host", ""},
+ /* 39: */ {"if-match", ""},
+ /* 40: */ {"if-modified-since", ""},
+ /* 41: */ {"if-none-match", ""},
+ /* 42: */ {"if-range", ""},
+ /* 43: */ {"if-unmodified-since", ""},
+ /* 44: */ {"last-modified", ""},
+ /* 45: */ {"link", ""},
+ /* 46: */ {"location", ""},
+ /* 47: */ {"max-forwards", ""},
+ /* 48: */ {"proxy-authenticate", ""},
+ /* 49: */ {"proxy-authorization", ""},
+ /* 50: */ {"range", ""},
+ /* 51: */ {"referer", ""},
+ /* 52: */ {"refresh", ""},
+ /* 53: */ {"retry-after", ""},
+ /* 54: */ {"server", ""},
+ /* 55: */ {"set-cookie", ""},
+ /* 56: */ {"strict-transport-security", ""},
+ /* 57: */ {"transfer-encoding", ""},
+ /* 58: */ {"user-agent", ""},
+ /* 59: */ {"vary", ""},
+ /* 60: */ {"via", ""},
+ /* 61: */ {"www-authenticate", ""},
};
void grpc_chttp2_hptbl_init(grpc_chttp2_hptbl *tbl, grpc_mdctx *mdctx) {
diff --git a/src/core/transport/chttp2/hpack_table.h b/src/core/transport/chttp2/hpack_table.h
index a3a07ad014..84a8e2d1e0 100644
--- a/src/core/transport/chttp2/hpack_table.h
+++ b/src/core/transport/chttp2/hpack_table.h
@@ -94,4 +94,4 @@ typedef struct {
grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find(
const grpc_chttp2_hptbl *tbl, grpc_mdelem *md);
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_TABLE_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_TABLE_H__ */
diff --git a/src/core/transport/chttp2/http2_errors.h b/src/core/transport/chttp2/http2_errors.h
index d065422c6f..7791da6d5a 100644
--- a/src/core/transport/chttp2/http2_errors.h
+++ b/src/core/transport/chttp2/http2_errors.h
@@ -53,4 +53,4 @@ typedef enum {
GRPC_CHTTP2__ERROR_DO_NOT_USE = -1
} grpc_chttp2_error_code;
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HTTP2_ERRORS_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HTTP2_ERRORS_H__ */
diff --git a/src/core/transport/chttp2/status_conversion.h b/src/core/transport/chttp2/status_conversion.h
index ae9e7f2ca3..f78d81e0aa 100644
--- a/src/core/transport/chttp2/status_conversion.h
+++ b/src/core/transport/chttp2/status_conversion.h
@@ -47,4 +47,4 @@ grpc_status_code grpc_chttp2_http2_error_to_grpc_status(
grpc_status_code grpc_chttp2_http2_status_to_grpc_status(int status);
int grpc_chttp2_grpc_status_to_http2_status(grpc_status_code status);
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STATUS_CONVERSION_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STATUS_CONVERSION_H__ */
diff --git a/src/core/transport/chttp2/stream_encoder.h b/src/core/transport/chttp2/stream_encoder.h
index 4b093e8495..147b1d31ff 100644
--- a/src/core/transport/chttp2/stream_encoder.h
+++ b/src/core/transport/chttp2/stream_encoder.h
@@ -90,4 +90,4 @@ void grpc_chttp2_encode(grpc_stream_op *ops, size_t ops_count, int eof,
grpc_chttp2_hpack_compressor *compressor,
gpr_slice_buffer *output);
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_ENCODER_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_ENCODER_H__ */
diff --git a/src/core/transport/chttp2/stream_map.h b/src/core/transport/chttp2/stream_map.h
index caaee30676..03bf719f37 100644
--- a/src/core/transport/chttp2/stream_map.h
+++ b/src/core/transport/chttp2/stream_map.h
@@ -78,4 +78,4 @@ void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map *map,
void *value),
void *user_data);
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_MAP_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_MAP_H__ */
diff --git a/src/core/transport/chttp2/varint.h b/src/core/transport/chttp2/varint.h
index 780390238f..940df00a99 100644
--- a/src/core/transport/chttp2/varint.h
+++ b/src/core/transport/chttp2/varint.h
@@ -70,4 +70,4 @@ void grpc_chttp2_hpack_write_varint_tail(gpr_uint32 tail_value,
} \
} while (0)
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_VARINT_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_VARINT_H__ */
diff --git a/src/core/transport/chttp2_transport.h b/src/core/transport/chttp2_transport.h
index dd4419b98d..e12357ff5e 100644
--- a/src/core/transport/chttp2_transport.h
+++ b/src/core/transport/chttp2_transport.h
@@ -44,4 +44,4 @@ void grpc_create_chttp2_transport(grpc_transport_setup_callback setup,
size_t nslices, grpc_mdctx *metadata_context,
int is_client);
-#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_TRANSPORT_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_TRANSPORT_H__ */
diff --git a/src/core/transport/metadata.h b/src/core/transport/metadata.h
index 6c6dee5efd..943e65a981 100644
--- a/src/core/transport/metadata.h
+++ b/src/core/transport/metadata.h
@@ -136,4 +136,4 @@ const char *grpc_mdstr_as_c_string(grpc_mdstr *s);
#define GRPC_MDSTR_KV_HASH(k_hash, v_hash) (GPR_ROTL((k_hash), 2) ^ (v_hash))
-#endif /* __GRPC_INTERNAL_TRANSPORT_METADATA_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_METADATA_H__ */
diff --git a/src/core/transport/stream_op.h b/src/core/transport/stream_op.h
index be60bc2da6..20d609133f 100644
--- a/src/core/transport/stream_op.h
+++ b/src/core/transport/stream_op.h
@@ -125,4 +125,4 @@ void grpc_sopb_add_flow_ctl_cb(grpc_stream_op_buffer *sopb,
void grpc_sopb_append(grpc_stream_op_buffer *sopb, grpc_stream_op *ops,
size_t nops);
-#endif /* __GRPC_INTERNAL_TRANSPORT_STREAM_OP_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_STREAM_OP_H__ */
diff --git a/src/core/transport/transport.h b/src/core/transport/transport.h
index 00dacbf5b9..af12f4e700 100644
--- a/src/core/transport/transport.h
+++ b/src/core/transport/transport.h
@@ -254,4 +254,4 @@ void grpc_transport_setup_initiate(grpc_transport_setup *setup);
used as a destruction call by setup). */
void grpc_transport_setup_cancel(grpc_transport_setup *setup);
-#endif /* __GRPC_INTERNAL_TRANSPORT_TRANSPORT_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_TRANSPORT_H__ */
diff --git a/src/core/transport/transport_impl.h b/src/core/transport/transport_impl.h
index 9f497b9cba..31e80d36ed 100644
--- a/src/core/transport/transport_impl.h
+++ b/src/core/transport/transport_impl.h
@@ -84,4 +84,4 @@ struct grpc_transport {
const grpc_transport_vtable *vtable;
};
-#endif /* __GRPC_INTERNAL_TRANSPORT_TRANSPORT_IMPL_H__ */
+#endif /* __GRPC_INTERNAL_TRANSPORT_TRANSPORT_IMPL_H__ */
diff --git a/src/core/tsi/fake_transport_security.c b/src/core/tsi/fake_transport_security.c
index 7807e71949..63d0e1f788 100644
--- a/src/core/tsi/fake_transport_security.c
+++ b/src/core/tsi/fake_transport_security.c
@@ -83,7 +83,6 @@ typedef struct {
uint32_t max_frame_size;
} tsi_fake_frame_protector;
-
/* --- Utils. ---*/
static const char* tsi_fake_handshake_message_strings[] = {
@@ -120,7 +119,7 @@ static void store32_little_endian(uint32_t value, unsigned char* buf) {
buf[3] = (unsigned char)(value >> 24) & 0xFF;
buf[2] = (unsigned char)(value >> 16) & 0xFF;
buf[1] = (unsigned char)(value >> 8) & 0xFF;
- buf[0] = (unsigned char)(value) & 0xFF;
+ buf[0] = (unsigned char)(value)&0xFF;
}
static void tsi_fake_frame_reset(tsi_fake_frame* frame, int needs_draining) {
@@ -246,8 +245,8 @@ static tsi_result fake_protector_protect(
/* Try to drain first. */
if (frame->needs_draining) {
drained_size = saved_output_size - *num_bytes_written;
- result = drain_frame_to_bytes(protected_output_frames,
- &drained_size, frame);
+ result =
+ drain_frame_to_bytes(protected_output_frames, &drained_size, frame);
*num_bytes_written += drained_size;
protected_output_frames += drained_size;
if (result != TSI_OK) {
@@ -273,8 +272,8 @@ static tsi_result fake_protector_protect(
return result;
}
}
- result = fill_frame_from_bytes(unprotected_bytes, unprotected_bytes_size,
- frame);
+ result =
+ fill_frame_from_bytes(unprotected_bytes, unprotected_bytes_size, frame);
if (result != TSI_OK) {
if (result == TSI_INCOMPLETE_DATA) result = TSI_OK;
return result;
@@ -301,7 +300,7 @@ static tsi_result fake_protector_protect_flush(
frame->size = frame->offset;
frame->offset = 0;
frame->needs_draining = 1;
- store32_little_endian(frame->size, frame->data); /* Overwrite header. */
+ store32_little_endian(frame->size, frame->data); /* Overwrite header. */
}
result = drain_frame_to_bytes(protected_output_frames,
protected_output_frames_size, frame);
@@ -327,8 +326,7 @@ static tsi_result fake_protector_unprotect(
/* Go past the header if needed. */
if (frame->offset == 0) frame->offset = TSI_FAKE_FRAME_HEADER_SIZE;
drained_size = saved_output_size - *num_bytes_written;
- result = drain_frame_to_bytes(unprotected_bytes, &drained_size,
- frame);
+ result = drain_frame_to_bytes(unprotected_bytes, &drained_size, frame);
unprotected_bytes += drained_size;
*num_bytes_written += drained_size;
if (result != TSI_OK) {
@@ -352,7 +350,7 @@ static tsi_result fake_protector_unprotect(
/* Try to drain again. */
if (!frame->needs_draining) return TSI_INTERNAL_ERROR;
if (frame->offset != 0) return TSI_INTERNAL_ERROR;
- frame->offset = TSI_FAKE_FRAME_HEADER_SIZE; /* Go past the header. */
+ frame->offset = TSI_FAKE_FRAME_HEADER_SIZE; /* Go past the header. */
drained_size = saved_output_size - *num_bytes_written;
result = drain_frame_to_bytes(unprotected_bytes, &drained_size, frame);
*num_bytes_written += drained_size;
@@ -481,10 +479,8 @@ static void fake_handshaker_destroy(tsi_handshaker* self) {
static const tsi_handshaker_vtable handshaker_vtable = {
fake_handshaker_get_bytes_to_send_to_peer,
- fake_handshaker_process_bytes_from_peer,
- fake_handshaker_get_result,
- fake_handshaker_extract_peer,
- fake_handshaker_create_frame_protector,
+ fake_handshaker_process_bytes_from_peer, fake_handshaker_get_result,
+ fake_handshaker_extract_peer, fake_handshaker_create_frame_protector,
fake_handshaker_destroy,
};
diff --git a/src/core/tsi/fake_transport_security.h b/src/core/tsi/fake_transport_security.h
index 075d51871b..a62fe81c09 100644
--- a/src/core/tsi/fake_transport_security.h
+++ b/src/core/tsi/fake_transport_security.h
@@ -50,7 +50,6 @@ extern "C" {
cleartext data for the protector. */
tsi_handshaker* tsi_create_fake_handshaker(int is_client);
-
/* Creates a protector directly without going through the handshake phase. */
tsi_frame_protector* tsi_create_fake_protector(
uint32_t* max_protected_frame_size);
@@ -59,4 +58,4 @@ tsi_frame_protector* tsi_create_fake_protector(
}
#endif
-#endif /* __FAKE_TRANSPORT_SECURITY_H_ */
+#endif /* __FAKE_TRANSPORT_SECURITY_H_ */
diff --git a/src/core/tsi/ssl_transport_security.c b/src/core/tsi/ssl_transport_security.c
index b9e48e7373..c98071a937 100644
--- a/src/core/tsi/ssl_transport_security.c
+++ b/src/core/tsi/ssl_transport_security.c
@@ -54,7 +54,6 @@
* SSL structure. This is what we would ultimately want though... */
#define TSI_SSL_MAX_PROTECTION_OVERHEAD 100
-
/* --- Structure definitions. ---*/
struct tsi_ssl_handshaker_factory {
@@ -100,7 +99,6 @@ typedef struct {
uint32_t buffer_offset;
} tsi_ssl_frame_protector;
-
/* --- Library Initialization. ---*/
static gpr_once init_openssl_once = GPR_ONCE_INIT;
@@ -269,7 +267,7 @@ static tsi_result peer_from_x509(X509* cert, int include_certificate_type,
tsi_peer* peer) {
/* TODO(jboeuf): Maybe add more properties. */
uint32_t property_count = include_certificate_type ? 3 : 2;
- tsi_result result = tsi_construct_peer(property_count, peer);
+ tsi_result result = tsi_construct_peer(property_count, peer);
if (result != TSI_OK) return result;
do {
result = peer_property_from_x509_common_name(cert, &peer->properties[0]);
@@ -299,12 +297,10 @@ static void log_ssl_error_stack(void) {
}
}
-
/* Performs an SSL_read and handle errors. */
static tsi_result do_ssl_read(SSL* ssl, unsigned char* unprotected_bytes,
uint32_t* unprotected_bytes_size) {
- int read_from_ssl = SSL_read(ssl, unprotected_bytes,
- *unprotected_bytes_size);
+ int read_from_ssl = SSL_read(ssl, unprotected_bytes, *unprotected_bytes_size);
if (read_from_ssl == 0) {
gpr_log(GPR_ERROR, "SSL_read returned 0 unexpectedly.");
return TSI_INTERNAL_ERROR;
@@ -378,7 +374,7 @@ static tsi_result ssl_ctx_use_certificate_chain(
X509* certificate_authority = PEM_read_bio_X509(pem, NULL, NULL, "");
if (certificate_authority == NULL) {
ERR_clear_error();
- break; /* Done reading. */
+ break; /* Done reading. */
}
if (!SSL_CTX_add_extra_chain_cert(context, certificate_authority)) {
X509_free(certificate_authority);
@@ -423,8 +419,8 @@ static tsi_result ssl_ctx_use_private_key(SSL_CTX* context,
/* Loads in-memory PEM verification certs into the SSL context and optionally
returns the verification cert names (root_names can be NULL). */
static tsi_result ssl_ctx_load_verification_certs(
- SSL_CTX* context, const unsigned char* pem_roots,
- uint32_t pem_roots_size, STACK_OF(X509_NAME)** root_names) {
+ SSL_CTX* context, const unsigned char* pem_roots, uint32_t pem_roots_size,
+ STACK_OF(X509_NAME) * *root_names) {
tsi_result result = TSI_OK;
uint32_t num_roots = 0;
X509* root = NULL;
@@ -442,7 +438,7 @@ static tsi_result ssl_ctx_load_verification_certs(
root = PEM_read_bio_X509_AUX(pem, NULL, NULL, "");
if (root == NULL) {
ERR_clear_error();
- break; /* We're at the end of stream. */
+ break; /* We're at the end of stream. */
}
if (root_names != NULL) {
root_name = X509_get_subject_name(root);
@@ -485,13 +481,11 @@ static tsi_result ssl_ctx_load_verification_certs(
return result;
}
-
/* Populates the SSL context with a private key and a cert chain, and sets the
cipher list and the ephemeral ECDH key. */
static tsi_result populate_ssl_context(
SSL_CTX* context, const unsigned char* pem_private_key,
- uint32_t pem_private_key_size,
- const unsigned char* pem_certificate_chain,
+ uint32_t pem_private_key_size, const unsigned char* pem_certificate_chain,
uint32_t pem_certificate_chain_size, const char* cipher_list) {
tsi_result result = TSI_OK;
if (pem_certificate_chain != NULL) {
@@ -532,12 +526,12 @@ static tsi_result extract_x509_subject_names_from_pem_cert(
tsi_result result = TSI_OK;
X509* cert = NULL;
BIO* pem = BIO_new_mem_buf((void*)pem_cert, pem_cert_size);
- if (pem == NULL) return TSI_OUT_OF_RESOURCES;
+ if (pem == NULL) return TSI_OUT_OF_RESOURCES;
cert = PEM_read_bio_X509(pem, NULL, NULL, "");
if (cert == NULL) {
- gpr_log(GPR_ERROR, "Invalid certificate");
- result = TSI_INVALID_ARGUMENT;
+ gpr_log(GPR_ERROR, "Invalid certificate");
+ result = TSI_INVALID_ARGUMENT;
} else {
result = peer_from_x509(cert, 0, peer);
}
@@ -581,8 +575,7 @@ static tsi_result build_alpn_protocol_name_list(
static tsi_result ssl_protector_protect(
tsi_frame_protector* self, const unsigned char* unprotected_bytes,
- uint32_t* unprotected_bytes_size,
- unsigned char* protected_output_frames,
+ uint32_t* unprotected_bytes_size, unsigned char* protected_output_frames,
uint32_t* protected_output_frames_size) {
tsi_ssl_frame_protector* impl = (tsi_ssl_frame_protector*)self;
int read_from_ssl;
@@ -634,8 +627,7 @@ static tsi_result ssl_protector_protect(
static tsi_result ssl_protector_protect_flush(
tsi_frame_protector* self, unsigned char* protected_output_frames,
- uint32_t* protected_output_frames_size,
- uint32_t* still_pending_size) {
+ uint32_t* protected_output_frames_size, uint32_t* still_pending_size) {
tsi_result result = TSI_OK;
tsi_ssl_frame_protector* impl = (tsi_ssl_frame_protector*)self;
int read_from_ssl = 0;
@@ -662,8 +654,7 @@ static tsi_result ssl_protector_protect_flush(
static tsi_result ssl_protector_unprotect(
tsi_frame_protector* self, const unsigned char* protected_frames_bytes,
- uint32_t* protected_frames_bytes_size,
- unsigned char* unprotected_bytes,
+ uint32_t* protected_frames_bytes_size, unsigned char* unprotected_bytes,
uint32_t* unprotected_bytes_size) {
tsi_result result = TSI_OK;
int written_into_ssl = 0;
@@ -673,7 +664,7 @@ static tsi_result ssl_protector_unprotect(
/* First, try to read remaining data from ssl. */
result = do_ssl_read(impl->ssl, unprotected_bytes, unprotected_bytes_size);
- if (result != TSI_OK) return result;
+ if (result != TSI_OK) return result;
if (*unprotected_bytes_size == output_bytes_size) {
/* We have read everything we could and cannot process any more input. */
*protected_frames_bytes_size = 0;
@@ -684,8 +675,8 @@ static tsi_result ssl_protector_unprotect(
*unprotected_bytes_size = output_bytes_size - output_bytes_offset;
/* Then, try to write some data to ssl. */
- written_into_ssl = BIO_write(
- impl->into_ssl, protected_frames_bytes, *protected_frames_bytes_size);
+ written_into_ssl = BIO_write(impl->into_ssl, protected_frames_bytes,
+ *protected_frames_bytes_size);
if (written_into_ssl < 0) {
gpr_log(GPR_ERROR, "Sending protected frame to ssl failed with %d",
written_into_ssl);
@@ -710,13 +701,10 @@ static void ssl_protector_destroy(tsi_frame_protector* self) {
}
static const tsi_frame_protector_vtable frame_protector_vtable = {
- ssl_protector_protect,
- ssl_protector_protect_flush,
- ssl_protector_unprotect,
+ ssl_protector_protect, ssl_protector_protect_flush, ssl_protector_unprotect,
ssl_protector_destroy,
};
-
/* --- tsi_handshaker methods implementation. ---*/
static tsi_result ssl_handshaker_get_bytes_to_send_to_peer(
@@ -751,8 +739,7 @@ static tsi_result ssl_handshaker_get_result(tsi_handshaker* self) {
}
static tsi_result ssl_handshaker_process_bytes_from_peer(
- tsi_handshaker* self, const unsigned char* bytes,
- uint32_t* bytes_size) {
+ tsi_handshaker* self, const unsigned char* bytes, uint32_t* bytes_size) {
tsi_ssl_handshaker* impl = (tsi_ssl_handshaker*)self;
int bytes_written_into_ssl_size = 0;
if (bytes == NULL || bytes_size == 0 || *bytes_size > INT_MAX) {
@@ -884,14 +871,11 @@ static void ssl_handshaker_destroy(tsi_handshaker* self) {
static const tsi_handshaker_vtable handshaker_vtable = {
ssl_handshaker_get_bytes_to_send_to_peer,
- ssl_handshaker_process_bytes_from_peer,
- ssl_handshaker_get_result,
- ssl_handshaker_extract_peer,
- ssl_handshaker_create_frame_protector,
+ ssl_handshaker_process_bytes_from_peer, ssl_handshaker_get_result,
+ ssl_handshaker_extract_peer, ssl_handshaker_create_frame_protector,
ssl_handshaker_destroy,
};
-
/* --- tsi_ssl_handshaker_factory common methods. --- */
tsi_result tsi_ssl_handshaker_factory_create_handshaker(
@@ -971,7 +955,6 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client,
return TSI_OK;
}
-
/* --- tsi_ssl__client_handshaker_factory methods implementation. --- */
static tsi_result ssl_client_handshaker_factory_create_handshaker(
@@ -991,7 +974,6 @@ static void ssl_client_handshaker_factory_destroy(
free(impl);
}
-
/* --- tsi_ssl_server_handshaker_factory methods implementation. --- */
static tsi_result ssl_server_handshaker_factory_create_handshaker(
@@ -1031,19 +1013,19 @@ static int does_entry_match_name(const char* entry, uint32_t entry_length,
const char* name_subdomain = NULL;
if (entry_length == 0) return 0;
if (!strncmp(name, entry, entry_length) && (strlen(name) == entry_length)) {
- return 1; /* Perfect match. */
+ return 1; /* Perfect match. */
}
if (entry[0] != '*') return 0;
/* Wildchar subdomain matching. */
- if (entry_length < 3 || entry[1] != '.') { /* At least *.x */
+ if (entry_length < 3 || entry[1] != '.') { /* At least *.x */
gpr_log(GPR_ERROR, "Invalid wildchar entry.");
return 0;
}
name_subdomain = strchr(name, '.');
if (name_subdomain == NULL || strlen(name_subdomain) < 2) return 0;
- name_subdomain++; /* Starts after the dot. */
- entry += 2; /* Remove *. */
+ name_subdomain++; /* Starts after the dot. */
+ entry += 2; /* Remove *. */
entry_length -= 2;
return (!strncmp(entry, name_subdomain, entry_length) &&
(strlen(name_subdomain) == entry_length));
@@ -1095,7 +1077,6 @@ static int server_handshaker_factory_alpn_callback(
return SSL_TLSEXT_ERR_NOACK;
}
-
/* --- tsi_ssl_handshaker_factory constructors. --- */
tsi_result tsi_create_ssl_client_handshaker_factory(
@@ -1277,10 +1258,8 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, const char* name) {
uint32_t i = 0;
const tsi_peer_property* property = tsi_peer_get_property_by_name(
peer, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY);
- if (property == NULL ||
- property->type != TSI_PEER_PROPERTY_TYPE_STRING) {
- gpr_log(GPR_ERROR,
- "Invalid x509 subject common name property.");
+ if (property == NULL || property->type != TSI_PEER_PROPERTY_TYPE_STRING) {
+ gpr_log(GPR_ERROR, "Invalid x509 subject common name property.");
return 0;
}
if (does_entry_match_name(property->value.string.data,
@@ -1291,8 +1270,7 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, const char* name) {
property = tsi_peer_get_property_by_name(
peer, TSI_X509_SUBJECT_ALTERNATIVE_NAMES_PEER_PROPERTY);
if (property == NULL || property->type != TSI_PEER_PROPERTY_TYPE_LIST) {
- gpr_log(GPR_ERROR,
- "Invalid x509 subject alternative names property.");
+ gpr_log(GPR_ERROR, "Invalid x509 subject alternative names property.");
return 0;
}
@@ -1308,5 +1286,5 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, const char* name) {
return 1;
}
}
- return 0; /* Not found. */
+ return 0; /* Not found. */
}
diff --git a/src/core/tsi/ssl_transport_security.h b/src/core/tsi/ssl_transport_security.h
index 56f50a5dde..de2b1df7bf 100644
--- a/src/core/tsi/ssl_transport_security.h
+++ b/src/core/tsi/ssl_transport_security.h
@@ -162,9 +162,8 @@ void tsi_ssl_handshaker_factory_destroy(tsi_ssl_handshaker_factory* self);
/* Util that checks that an ssl peer matches a specific name. */
int tsi_ssl_peer_matches_name(const tsi_peer* peer, const char* name);
-
#ifdef __cplusplus
}
#endif
-#endif /* __SSL_TRANSPORT_SECURITY_H_ */
+#endif /* __SSL_TRANSPORT_SECURITY_H_ */
diff --git a/src/core/tsi/transport_security.c b/src/core/tsi/transport_security.c
index 94252e36d0..5a42f03f5f 100644
--- a/src/core/tsi/transport_security.c
+++ b/src/core/tsi/transport_security.c
@@ -44,7 +44,7 @@ char* tsi_strdup(const char* src) {
if (!src) return NULL;
len = strlen(src) + 1;
dst = malloc(len);
- if (!dst) return NULL;
+ if (!dst) return NULL;
memcpy(dst, src, len);
return dst;
}
@@ -84,17 +84,15 @@ const char* tsi_result_to_string(tsi_result result) {
}
}
-
/* --- tsi_frame_protector common implementation. ---
Calls specific implementation after state/input validation. */
-tsi_result tsi_frame_protector_protect(
- tsi_frame_protector* self,
- const unsigned char* unprotected_bytes,
- uint32_t* unprotected_bytes_size,
- unsigned char* protected_output_frames,
- uint32_t* protected_output_frames_size) {
+tsi_result tsi_frame_protector_protect(tsi_frame_protector* self,
+ const unsigned char* unprotected_bytes,
+ uint32_t* unprotected_bytes_size,
+ unsigned char* protected_output_frames,
+ uint32_t* protected_output_frames_size) {
if (self == NULL || unprotected_bytes == NULL ||
unprotected_bytes_size == NULL || protected_output_frames == NULL ||
protected_output_frames_size == NULL) {
@@ -106,10 +104,8 @@ tsi_result tsi_frame_protector_protect(
}
tsi_result tsi_frame_protector_protect_flush(
- tsi_frame_protector* self,
- unsigned char* protected_output_frames,
- uint32_t* protected_output_frames_size,
- uint32_t* still_pending_size) {
+ tsi_frame_protector* self, unsigned char* protected_output_frames,
+ uint32_t* protected_output_frames_size, uint32_t* still_pending_size) {
if (self == NULL || protected_output_frames == NULL ||
protected_output_frames == NULL || still_pending_size == NULL) {
return TSI_INVALID_ARGUMENT;
@@ -120,10 +116,8 @@ tsi_result tsi_frame_protector_protect_flush(
}
tsi_result tsi_frame_protector_unprotect(
- tsi_frame_protector* self,
- const unsigned char* protected_frames_bytes,
- uint32_t* protected_frames_bytes_size,
- unsigned char* unprotected_bytes,
+ tsi_frame_protector* self, const unsigned char* protected_frames_bytes,
+ uint32_t* protected_frames_bytes_size, unsigned char* unprotected_bytes,
uint32_t* unprotected_bytes_size) {
if (self == NULL || protected_frames_bytes == NULL ||
protected_frames_bytes_size == NULL || unprotected_bytes == NULL ||
@@ -140,7 +134,6 @@ void tsi_frame_protector_destroy(tsi_frame_protector* self) {
self->vtable->destroy(self);
}
-
/* --- tsi_handshaker common implementation. ---
Calls specific implementation after state/input validation. */
@@ -153,7 +146,6 @@ tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker* self,
return self->vtable->get_bytes_to_send_to_peer(self, bytes, bytes_size);
}
-
tsi_result tsi_handshaker_process_bytes_from_peer(tsi_handshaker* self,
const unsigned char* bytes,
uint32_t* bytes_size) {
@@ -179,8 +171,7 @@ tsi_result tsi_handshaker_extract_peer(tsi_handshaker* self, tsi_peer* peer) {
}
tsi_result tsi_handshaker_create_frame_protector(
- tsi_handshaker* self,
- uint32_t* max_protected_frame_size,
+ tsi_handshaker* self, uint32_t* max_protected_frame_size,
tsi_frame_protector** protector) {
tsi_result result;
if (self == NULL || protector == NULL) return TSI_INVALID_ARGUMENT;
@@ -201,7 +192,6 @@ void tsi_handshaker_destroy(tsi_handshaker* self) {
self->vtable->destroy(self);
}
-
/* --- tsi_peer implementation. --- */
const tsi_peer_property* tsi_peer_get_property_by_name(const tsi_peer* self,
@@ -227,7 +217,6 @@ tsi_peer_property tsi_init_peer_property(void) {
return property;
}
-
static void tsi_peer_destroy_list_property(tsi_peer_property* children,
uint32_t child_count) {
uint32_t i;
@@ -254,7 +243,7 @@ void tsi_peer_property_destruct(tsi_peer_property* property) {
/* Nothing to free. */
break;
}
- *property = tsi_init_peer_property(); /* Reset everything to 0. */
+ *property = tsi_init_peer_property(); /* Reset everything to 0. */
}
void tsi_peer_destruct(tsi_peer* self) {
diff --git a/src/core/tsi/transport_security.h b/src/core/tsi/transport_security.h
index cf9a2b0195..9a20fa83a5 100644
--- a/src/core/tsi/transport_security.h
+++ b/src/core/tsi/transport_security.h
@@ -109,10 +109,10 @@ tsi_result tsi_construct_list_peer_property(const char* name,
tsi_peer_property* property);
/* Utils. */
-char* tsi_strdup(const char* src); /* Sadly, no strdup in C89. */
+char* tsi_strdup(const char* src); /* Sadly, no strdup in C89. */
#ifdef __cplusplus
}
#endif
-#endif /* __TRANSPORT_SECURITY_H_ */
+#endif /* __TRANSPORT_SECURITY_H_ */
diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h
index 18545b4253..76746a4b20 100644
--- a/src/core/tsi/transport_security_interface.h
+++ b/src/core/tsi/transport_security_interface.h
@@ -60,7 +60,6 @@ typedef enum {
const char* tsi_result_to_string(tsi_result result);
-
/* --- tsi_frame_protector object ---
This object protects and unprotects buffers once the handshake is done.
@@ -121,12 +120,11 @@ typedef struct tsi_frame_protector tsi_frame_protector;
if (result != TSI_OK) HandleError(result);
------------------------------------------------------------------------ */
-tsi_result tsi_frame_protector_protect(
- tsi_frame_protector* self,
- const unsigned char* unprotected_bytes,
- uint32_t* unprotected_bytes_size,
- unsigned char* protected_output_frames,
- uint32_t* protected_output_frames_size);
+tsi_result tsi_frame_protector_protect(tsi_frame_protector* self,
+ const unsigned char* unprotected_bytes,
+ uint32_t* unprotected_bytes_size,
+ unsigned char* protected_output_frames,
+ uint32_t* protected_output_frames_size);
/* Indicates that we need to flush the bytes buffered in the protector and get
the resulting frame.
@@ -137,10 +135,8 @@ tsi_result tsi_frame_protector_protect(
- still_pending_bytes is an output parameter indicating the number of bytes
that still need to be flushed from the protector.*/
tsi_result tsi_frame_protector_protect_flush(
- tsi_frame_protector* self,
- unsigned char* protected_output_frames,
- uint32_t* protected_output_frames_size,
- uint32_t* still_pending_size);
+ tsi_frame_protector* self, unsigned char* protected_output_frames,
+ uint32_t* protected_output_frames_size, uint32_t* still_pending_size);
/* Outputs unprotected bytes.
- protected_frames_bytes is an input only parameter and points to the
@@ -163,16 +159,13 @@ tsi_result tsi_frame_protector_protect_flush(
needs to be read before new protected data can be processed in which case
protected_frames_size will be set to 0. */
tsi_result tsi_frame_protector_unprotect(
- tsi_frame_protector* self,
- const unsigned char* protected_frames_bytes,
- uint32_t* protected_frames_bytes_size,
- unsigned char* unprotected_bytes,
+ tsi_frame_protector* self, const unsigned char* protected_frames_bytes,
+ uint32_t* protected_frames_bytes_size, unsigned char* unprotected_bytes,
uint32_t* unprotected_bytes_size);
/* Destroys the tsi_frame_protector object. */
void tsi_frame_protector_destroy(tsi_frame_protector* self);
-
/* --- tsi_peer objects ---
tsi_peer objects are a set of properties. The peer owns the properties. */
@@ -333,7 +326,6 @@ tsi_result tsi_handshaker_get_result(tsi_handshaker* self);
#define tsi_handshaker_is_in_progress(h) \
(tsi_handshaker_get_result((h)) == TSI_HANDSHAKE_IN_PROGRESS)
-
/* This method may return TSI_FAILED_PRECONDITION if
tsi_handshaker_is_in_progress returns 1, it returns TSI_OK otherwise
assuming the handshaker is not in a fatal error state.
@@ -357,8 +349,7 @@ tsi_result tsi_handshaker_extract_peer(tsi_handshaker* self, tsi_peer* peer);
the handshaker is not in a fatal error state.
The caller is responsible for destroying the protector. */
tsi_result tsi_handshaker_create_frame_protector(
- tsi_handshaker* self,
- uint32_t* max_output_protected_frame_size,
+ tsi_handshaker* self, uint32_t* max_output_protected_frame_size,
tsi_frame_protector** protector);
/* This method releases the tsi_handshaker object. After this method is called,
@@ -369,4 +360,4 @@ void tsi_handshaker_destroy(tsi_handshaker* self);
}
#endif
-#endif /* __TRANSPORT_SECURITY_INTERFACE_H_ */
+#endif /* __TRANSPORT_SECURITY_INTERFACE_H_ */