From fc94018b9795937bf4fdfc7ec34928e815c188eb Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 9 Jun 2018 16:02:26 +0900 Subject: [PATCH] clang-format-6.0 --- doc/sources/contribute.rst | 4 ++-- src/h2load.cc | 47 +++++++++++++++++++++----------------- src/nghttpd.cc | 3 ++- src/shrpx.cc | 22 +++++++++++------- 4 files changed, 44 insertions(+), 32 deletions(-) diff --git a/doc/sources/contribute.rst b/doc/sources/contribute.rst index ffb2911e..dc814a39 100644 --- a/doc/sources/contribute.rst +++ b/doc/sources/contribute.rst @@ -26,7 +26,7 @@ Coding style We use clang-format to format source code consistently. The clang-format configuration file .clang-format is located at the root directory. Since clang-format produces slightly different results -between versions, we currently use clang-format-5.0. +between versions, we currently use clang-format-6.0. To detect any violation to the coding style, we recommend to setup git pre-commit hook to check coding style of the changes you introduced. @@ -34,7 +34,7 @@ The pre-commit file is located at the root directory. Copy it under .git/hooks and make sure that it is executable. The pre-commit script uses clang-format-diff.py to detect any style errors. If it is not in your PATH or it exists under different name (e.g., -clang-format-diff-5.0 in debian), either add it to PATH variable or +clang-format-diff-6.0 in debian), either add it to PATH variable or add git option ``clangformatdiff.binary`` to point to the script. For emacs users, integrating clang-format to emacs is very easy. diff --git a/src/h2load.cc b/src/h2load.cc index 5916f200..229c73df 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -1799,10 +1799,12 @@ Options: -c, --clients= Number of concurrent clients. With -r option, this specifies the maximum number of connections to be made. - Default: )" << config.nclients << R"( + Default: )" + << config.nclients << R"( -t, --threads= Number of native threads. - Default: )" << config.nthreads << R"( + Default: )" + << config.nthreads << R"( -i, --input-file= Path of a file with multiple URIs are separated by EOLs. This option will disable URIs getting from command-line. @@ -1825,7 +1827,8 @@ Options: -W, --connection-window-bits= Sets the connection level initial window size to (2**)-1. - Default: )" << config.connection_window_bits << R"( + Default: )" + << config.connection_window_bits << R"( -H, --header=
Add/Override a header to the requests. --ciphers= @@ -1836,8 +1839,8 @@ Options: -p, --no-tls-proto= Specify ALPN identifier of the protocol to be used when accessing http URI without SSL/TLS. - Available protocols: )" << NGHTTP2_CLEARTEXT_PROTO_VERSION_ID - << R"( and )" << NGHTTP2_H1_1 << R"( + Available protocols: )" + << NGHTTP2_CLEARTEXT_PROTO_VERSION_ID << R"( and )" << NGHTTP2_H1_1 << R"( Default: )" << NGHTTP2_CLEARTEXT_PROTO_VERSION_ID << R"( -d, --data= @@ -1921,7 +1924,8 @@ Options: NPN. The parameter must be delimited by a single comma only and any white spaces are treated as a part of protocol string. - Default: )" << DEFAULT_NPN_LIST << R"( + Default: )" + << DEFAULT_NPN_LIST << R"( --h1 Short hand for --npn-list=http/1.1 --no-tls-proto=http/1.1, which effectively force http/1.1 for both http and https URI. @@ -1949,7 +1953,8 @@ Options: The argument is an integer and an optional unit (e.g., 1s is 1 second and 500ms is 500 milliseconds). Units are h, m, s or ms (hours, minutes, seconds and milliseconds, respectively). If a unit - is omitted, a second is used as unit.)" << std::endl; + is omitted, a second is used as unit.)" + << std::endl; } } // namespace @@ -2686,14 +2691,14 @@ int main(int argc, char **argv) { finished in )" << util::format_duration(duration) << ", " << rps << " req/s, " << util::utos_funit(bps) << R"(B/s -requests: )" << stats.req_todo << " total, " - << stats.req_started << " started, " << stats.req_done << " done, " - << stats.req_status_success << " succeeded, " << stats.req_failed - << " failed, " << stats.req_error << " errored, " - << stats.req_timedout << R"( timeout -status codes: )" << stats.status[2] << " 2xx, " - << stats.status[3] << " 3xx, " << stats.status[4] << " 4xx, " - << stats.status[5] << R"( 5xx +requests: )" << stats.req_todo + << " total, " << stats.req_started << " started, " << stats.req_done + << " done, " << stats.req_status_success << " succeeded, " + << stats.req_failed << " failed, " << stats.req_error + << " errored, " << stats.req_timedout << R"( timeout +status codes: )" + << stats.status[2] << " 2xx, " << stats.status[3] << " 3xx, " + << stats.status[4] << " 4xx, " << stats.status[5] << R"( 5xx traffic: )" << util::utos_funit(stats.bytes_total) << "B (" << stats.bytes_total << ") total, " << util::utos_funit(stats.bytes_head) << "B (" << stats.bytes_head @@ -2701,12 +2706,12 @@ traffic: )" << util::utos_funit(stats.bytes_total) << "%), " << util::utos_funit(stats.bytes_body) << "B (" << stats.bytes_body << R"() data min max mean sd +/- sd -time for request: )" << std::setw(10) - << util::format_duration(ts.request.min) << " " << std::setw(10) - << util::format_duration(ts.request.max) << " " << std::setw(10) - << util::format_duration(ts.request.mean) << " " << std::setw(10) - << util::format_duration(ts.request.sd) << std::setw(9) - << util::dtos(ts.request.within_sd) << "%" +time for request: )" + << std::setw(10) << util::format_duration(ts.request.min) << " " + << std::setw(10) << util::format_duration(ts.request.max) << " " + << std::setw(10) << util::format_duration(ts.request.mean) << " " + << std::setw(10) << util::format_duration(ts.request.sd) + << std::setw(9) << util::dtos(ts.request.within_sd) << "%" << "\ntime for connect: " << std::setw(10) << util::format_duration(ts.connect.min) << " " << std::setw(10) << util::format_duration(ts.connect.max) << " " << std::setw(10) diff --git a/src/nghttpd.cc b/src/nghttpd.cc index c7b64b53..b26aea2f 100644 --- a/src/nghttpd.cc +++ b/src/nghttpd.cc @@ -174,7 +174,8 @@ Options: --mime-types-file= Path to file that contains MIME media types and the extensions that represent them. - Default: )" << config.mime_types_file << R"( + Default: )" + << config.mime_types_file << R"( --no-content-length Don't send content-length header field. --version Display version information and exit. diff --git a/src/shrpx.cc b/src/shrpx.cc index c9010dd6..003707a9 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -1897,7 +1897,8 @@ Connections: Performance: -n, --workers= Set the number of worker threads. - Default: )" << config->num_worker << R"( + Default: )" + << config->num_worker << R"( --single-thread Run everything in one thread inside the worker process. This feature is provided for better debugging @@ -2078,7 +2079,8 @@ SSL/TLS: --client-ciphers= Set allowed cipher list for backend connection. The format of the string is described in OpenSSL ciphers(1). - Default: )" << config->tls.client.ciphers << R"( + Default: )" + << config->tls.client.ciphers << R"( --ecdh-curves= Set supported curve list for frontend connections. is a colon separated list of curve NID or names @@ -2134,7 +2136,8 @@ SSL/TLS: NPN. The parameter must be delimited by a single comma only and any white spaces are treated as a part of protocol string. - Default: )" << DEFAULT_NPN_LIST + Default: )" + << DEFAULT_NPN_LIST << R"( --verify-client Require and verify client certificate. @@ -2539,7 +2542,8 @@ Logging: Set path to write error log. To reopen file, send USR1 signal to nghttpx. stderr will be redirected to the error log file unless --errorlog-syslog is used. - Default: )" << config->logging.error.file << R"( + Default: )" + << config->logging.error.file << R"( --errorlog-syslog Send error log to syslog. If this option is used, --errorlog-file option is ignored. @@ -2671,8 +2675,8 @@ HTTP: Specify the port number which appears in Location header field when redirect to HTTPS URI is made due to "redirect-if-not-tls" parameter in --backend option. - Default: )" << config->http.redirect_https_port - << R"( + Default: )" + << config->http.redirect_https_port << R"( API: --api-max-request-body= @@ -2751,7 +2755,8 @@ Misc: Load configuration from . Please note that nghttpx always tries to read the default configuration file if --conf is not given. - Default: )" << config->conf_path << R"( + Default: )" + << config->conf_path << R"( --include= Load additional configurations from . File is read when configuration parser encountered this @@ -2769,7 +2774,8 @@ Misc: The argument is an integer and an optional unit (e.g., 1s is 1 second and 500ms is 500 milliseconds). Units are h, m, s or ms (hours, minutes, seconds and milliseconds, respectively). If a unit - is omitted, a second is used as unit.)" << std::endl; + is omitted, a second is used as unit.)" + << std::endl; } } // namespace