From 54bf2256926d180b35a0b03141ce6d478c8bcda4 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 15 Oct 2015 21:42:11 +0900 Subject: [PATCH] clang-format-3.5 --- src/shrpx_config.cc | 2 +- src/shrpx_log.cc | 4 ++-- src/util.cc | 21 ++++++++++----------- src/util.h | 3 ++- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/shrpx_config.cc b/src/shrpx_config.cc index eacc48b9..8efd7f5e 100644 --- a/src/shrpx_config.cc +++ b/src/shrpx_config.cc @@ -1458,7 +1458,7 @@ int parse_config(const char *opt, const char *optarg, mod_config()->fastopen = n; return 0; - } + } case SHRPX_OPTID_BACKEND_KEEP_ALIVE_TIMEOUT: return parse_duration(&mod_config()->downstream_idle_read_timeout, opt, optarg); diff --git a/src/shrpx_log.cc b/src/shrpx_log.cc index 71714bfa..0eff4ac0 100644 --- a/src/shrpx_log.cc +++ b/src/shrpx_log.cc @@ -364,8 +364,8 @@ int reopen_log_files() { lgconf->accesslog_fd = new_accesslog_fd; lgconf->errorlog_fd = new_errorlog_fd; - lgconf->errorlog_tty = (new_errorlog_fd == -1) ? - false : isatty(new_errorlog_fd); + lgconf->errorlog_tty = + (new_errorlog_fd == -1) ? false : isatty(new_errorlog_fd); return res; } diff --git a/src/util.cc b/src/util.cc index c02e2839..6b304344 100644 --- a/src/util.cc +++ b/src/util.cc @@ -659,9 +659,7 @@ void store_original_fds() { make_socket_closeonexec(STDERR_COPY); } -void restore_original_fds() { - dup2(STDERR_COPY, STDERR_FILENO); -} +void restore_original_fds() { dup2(STDERR_COPY, STDERR_FILENO); } void close_log_file(int &fd) { if (fd != STDERR_COPY && fd != STDOUT_COPY && fd != -1) { @@ -771,8 +769,8 @@ bool check_h2_is_selected(const unsigned char *proto, size_t len) { namespace { bool select_proto(const unsigned char **out, unsigned char *outlen, - const unsigned char *in, unsigned int inlen, const char *key, - unsigned int keylen) { + const unsigned char *in, unsigned int inlen, const char *key, + unsigned int keylen) { for (auto p = in, end = in + inlen; p + keylen <= end; p += *p + 1) { if (std::equal(key, key + keylen, p)) { *out = p + 1; @@ -787,17 +785,19 @@ bool select_proto(const unsigned char **out, unsigned char *outlen, bool select_h2(const unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen) { return select_proto(out, outlen, in, inlen, NGHTTP2_PROTO_ALPN, - str_size(NGHTTP2_PROTO_ALPN)) || + str_size(NGHTTP2_PROTO_ALPN)) || select_proto(out, outlen, in, inlen, NGHTTP2_H2_16_ALPN, - str_size(NGHTTP2_H2_16_ALPN)) || + str_size(NGHTTP2_H2_16_ALPN)) || select_proto(out, outlen, in, inlen, NGHTTP2_H2_14_ALPN, - str_size(NGHTTP2_H2_14_ALPN)); + str_size(NGHTTP2_H2_14_ALPN)); } bool select_protocol(const unsigned char **out, unsigned char *outlen, - const unsigned char *in, unsigned int inlen, std::vector proto_list) { + const unsigned char *in, unsigned int inlen, + std::vector proto_list) { for (const auto &proto : proto_list) { - if (select_proto(out, outlen, in, inlen, proto.c_str(), static_cast(proto.size()))) { + if (select_proto(out, outlen, in, inlen, proto.c_str(), + static_cast(proto.size()))) { return true; } } @@ -818,7 +818,6 @@ std::vector get_default_alpn() { return res; } - std::vector> split_config_str_list(const char *s, char delim) { size_t len = 1; diff --git a/src/util.h b/src/util.h index 00265e87..101911cb 100644 --- a/src/util.h +++ b/src/util.h @@ -579,7 +579,8 @@ bool select_h2(const unsigned char **out, unsigned char *outlen, // present in |in| of length inlen. Returns true if identifier is // selected. bool select_protocol(const unsigned char **out, unsigned char *outlen, - const unsigned char *in, unsigned int inlen, std::vector proto_list); + const unsigned char *in, unsigned int inlen, + std::vector proto_list); // Returns default ALPN protocol list, which only contains supported // HTTP/2 protocol identifier.