diff options
Diffstat (limited to 'src/core/transport/chttp2/alpn.c')
-rw-r--r-- | src/core/transport/chttp2/alpn.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/core/transport/chttp2/alpn.c b/src/core/transport/chttp2/alpn.c index 69da4e6718..f008615c9a 100644 --- a/src/core/transport/chttp2/alpn.c +++ b/src/core/transport/chttp2/alpn.c @@ -36,21 +36,29 @@ #include <grpc/support/useful.h> /* in order of preference */ -static const char *const supported_versions[] = {"h2"}; +static const char *const supported_versions[] = { "h2" }; -int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size) { +int +grpc_chttp2_is_alpn_version_supported (const char *version, size_t size) +{ size_t i; - for (i = 0; i < GPR_ARRAY_SIZE(supported_versions); i++) { - if (!strncmp(version, supported_versions[i], size)) return 1; - } + for (i = 0; i < GPR_ARRAY_SIZE (supported_versions); i++) + { + if (!strncmp (version, supported_versions[i], size)) + return 1; + } return 0; } -size_t grpc_chttp2_num_alpn_versions(void) { - return GPR_ARRAY_SIZE(supported_versions); +size_t +grpc_chttp2_num_alpn_versions (void) +{ + return GPR_ARRAY_SIZE (supported_versions); } -const char *grpc_chttp2_get_alpn_version_index(size_t i) { - GPR_ASSERT(i < GPR_ARRAY_SIZE(supported_versions)); +const char * +grpc_chttp2_get_alpn_version_index (size_t i) +{ + GPR_ASSERT (i < GPR_ARRAY_SIZE (supported_versions)); return supported_versions[i]; } |