From 5f36d91afddc1f31ef5fa62f8b4b8d6caec5dee8 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 16 Jan 2015 00:00:38 +0900 Subject: [PATCH] nghttp, nghttpd, h2load: Same indentation with nghttpx --- src/h2load.cc | 86 ++++++++++++++++----------------- src/nghttp.cc | 127 +++++++++++++++++++++++++------------------------ src/nghttpd.cc | 87 ++++++++++++++++----------------- 3 files changed, 152 insertions(+), 148 deletions(-) diff --git a/src/h2load.cc b/src/h2load.cc index cfe8441a..d8611a86 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -851,61 +851,61 @@ void print_help(std::ostream &out) { print_usage(out); out << R"( - Specify URI to access. Multiple URIs can be - specified. URIs are used in this order for each - client. All URIs are used, then first URI is - used and then 2nd URI, and so on. The scheme, - host and port in the subsequent URIs, if present, - are ignored. Those in the first URI are used - solely. + Specify URI to access. Multiple URIs can be specified. + URIs are used in this order for each client. All URIs + are used, then first URI is used and then 2nd URI, and + so on. The scheme, host and port in the subsequent + URIs, if present, are ignored. Those in the first URI + are used solely. Options: - -n, --requests= Number of requests. - Default: )" << config.nreqs << R"( - -c, --clients= Number of concurrent clients. - Default: )" << config.nclients << R"( - -t, --threads= Number of native threads. - Default: )" << config.nthreads << R"( + -n, --requests= + Number of requests. + Default: )" << config.nreqs << R"( + -c, --clients= + Number of concurrent clients. + Default: )" << config.nclients << R"( + -t, --threads= + Number of native threads. + Default: )" << config.nthreads << R"( -i, --input-file= - Path of a file with multiple URIs are seperated - by EOLs. This option will disable URIs getting - from command-line. If '-' is given as , - URIs will be read from stdin. URIs are used in - this order for each client. All URIs are used, - then first URI is used and then 2nd URI, and so - on. The scheme, host and port in the subsequent - URIs, if present, are ignored. Those in the - first URI are used solely. + Path of a file with multiple URIs are seperated by EOLs. + This option will disable URIs getting from command-line. + If '-' is given as , URIs will be read from stdin. + URIs are used in this order for each client. All URIs + are used, then first URI is used and then 2nd URI, and + so on. The scheme, host and port in the subsequent + URIs, if present, are ignored. Those in the first URI + are used solely. -m, --max-concurrent-streams=(auto|) - Max concurrent streams to issue per session. If - "auto" is given, the number of given URIs is - used. - Default: auto + Max concurrent streams to issue per session. If "auto" + is given, the number of given URIs is used. + Default: auto -w, --window-bits= - Sets the stream level initial window size to - (2**)-1. For SPDY, 2** is used instead. + Sets the stream level initial window size to (2**)-1. + For SPDY, 2** is used instead. -W, --connection-window-bits= - Sets the connection level initial window size to - (2**)-1. For SPDY, if is strictly less - than 16, this option is ignored. Otherwise - 2** is used for SPDY. + Sets the connection level initial window size to + (2**)-1. For SPDY, if is strictly less than 16, + this option is ignored. Otherwise 2** is used for + SPDY. -H, --header=
- Add/Override a header to the requests. + Add/Override a header to the requests. -p, --no-tls-proto= - Specify ALPN identifier of the protocol to be - used when accessing http URI without SSL/TLS.)"; + Specify ALPN identifier of the protocol to be used when + accessing http URI without SSL/TLS.)"; #ifdef HAVE_SPDYLAY out << R"( - Available protocols: spdy/2, spdy/3, spdy/3.1 and - )"; -#else // !HAVE_SPDYLAY + Available protocols: spdy/2, spdy/3, spdy/3.1 and )"; +#else // !HAVE_SPDYLAY out << R"( - Available protocol: )"; + Available protocol: )"; #endif // !HAVE_SPDYLAY out << NGHTTP2_CLEARTEXT_PROTO_VERSION_ID << R"( - Default: )" << NGHTTP2_CLEARTEXT_PROTO_VERSION_ID << R"( - -v, --verbose Output debug information. - --version Display version information and exit. - -h, --help Display this help and exit.)" << std::endl; + Default: )" << NGHTTP2_CLEARTEXT_PROTO_VERSION_ID << R"( + -v, --verbose + Output debug information. + --version Display version information and exit. + -h, --help Display this help and exit.)" << std::endl; } } // namespace diff --git a/src/nghttp.cc b/src/nghttp.cc index 8acf8a19..90ebaf90 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -2224,75 +2224,78 @@ namespace { void print_help(std::ostream &out) { print_usage(out); out << R"( - Specify URI to access. + Specify URI to access. Options: - -v, --verbose Print debug information such as reception and - transmission of frames and name/value pairs. - Specifying this option multiple times increases - verbosity. - -n, --null-out Discard downloaded data. - -O, --remote-name Save download data in the current directory. The - filename is dereived from URI. If URI ends with - '/', 'index.html' is used as a filename. Not - implemented yet. - -t, --timeout= Timeout each request after seconds. + -v, --verbose + Print debug information such as reception and + transmission of frames and name/value pairs. Specifying + this option multiple times increases verbosity. + -n, --null-out + Discard downloaded data. + -O, --remote-name + Save download data in the current directory. The + filename is dereived from URI. If URI ends with '/', + 'index.html' is used as a filename. Not implemented + yet. + -t, --timeout= + Timeout each request after seconds. -w, --window-bits= - Sets the stream level initial window size to - 2**-1. + Sets the stream level initial window size to 2**-1. -W, --connection-window-bits= - Sets the connection level initial window size to - 2**-1. - -a, --get-assets Download assets such as stylesheets, images and - script files linked from the downloaded resource. - Only links whose origins are the same with the - linking resource will be downloaded. nghttp - prioritizes resources using HTTP/2 dependency - based priority. The priority order, from highest - to lowest, is html itself, css, javascript and - images. - -s, --stat Print statistics. + Sets the connection level initial window size to + 2**-1. + -a, --get-assets + Download assets such as stylesheets, images and script + files linked from the downloaded resource. Only links + whose origins are the same with the linking resource + will be downloaded. nghttp prioritizes resources using + HTTP/2 dependency based priority. The priority order, + from highest to lowest, is html itself, css, javascript + and images. + -s, --stat Print statistics. -H, --header=
- Add a header to the requests. Example: - -H':method: PUT' - --cert= Use the specified client certificate file. The - file must be in PEM format. - --key= Use the client private key file. The file must - be in PEM format. - -d, --data= Post FILE to server. If '-' is given, data will - be read from stdin. - -m, --multiply= Request each URI times. By default, same URI - is not requested twice. This option disables it - too. - -u, --upgrade Perform HTTP Upgrade for HTTP/2. This option is - ignored if the request URI has https scheme. If - -d is used, the HTTP upgrade request is performed - with OPTIONS method. + Add a header to the requests. Example: -H':method: PUT' + --cert= + Use the specified client certificate file. The file + must be in PEM format. + --key= Use the client private key file. The file must be in + PEM format. + -d, --data= + Post FILE to server. If '-' is given, data will be read + from stdin. + -m, --multiply= + Request each URI times. By default, same URI is not + requested twice. This option disables it too. + -u, --upgrade + Perform HTTP Upgrade for HTTP/2. This option is ignored + if the request URI has https scheme. If -d is used, the + HTTP upgrade request is performed with OPTIONS method. -p, --weight= - Sets priority group weight. The valid value - range is [)" << NGHTTP2_MIN_WEIGHT << ", " - << NGHTTP2_MAX_WEIGHT << R"(], inclusive. - Default: )" << NGHTTP2_DEFAULT_WEIGHT << R"( + Sets priority group weight. The valid value range is + [)" << NGHTTP2_MIN_WEIGHT << ", " << NGHTTP2_MAX_WEIGHT + << R"(], inclusive. + Default: )" << NGHTTP2_DEFAULT_WEIGHT << R"( -M, --peer-max-concurrent-streams= - Use as SETTINGS_MAX_CONCURRENT_STREAMS value - of remote endpoint as if it is received in - SETTINGS frame. The default is large enough as - it is seen as unlimited. - -c, --header-table-size= - Specify decoder header table size. - -b, --padding= Add at most bytes to a frame payload as - padding. Specify 0 to disable padding. - -r, --har= Output HTTP transactions in HAR format. - If '-' is given, data is written to stdout. - --color Force colored log output. - --continuation Send large header to test CONTINUATION. + Use as SETTINGS_MAX_CONCURRENT_STREAMS value of + remote endpoint as if it is received in SETTINGS frame. + The default is large enough as it is seen as unlimited. + -c, --header-table-size= + Specify decoder header table size. + -b, --padding= + Add at most bytes to a frame payload as padding. + Specify 0 to disable padding. + -r, --har= + Output HTTP transactions in HAR format. If '-' + is given, data is written to stdout. + --color Force colored log output. + --continuation + Send large header to test CONTINUATION. --no-content-length - Don't send content-length header field. - --no-dep Don't send dependency based priority hint to - server. - --dep-idle Use idle streams as anchor nodes to express - priority. - --version Display version information and exit. - -h, --help Display this help and exit.)" << std::endl; + Don't send content-length header field. + --no-dep Don't send dependency based priority hint to server. + --dep-idle Use idle streams as anchor nodes to express priority. + --version Display version information and exit. + -h, --help Display this help and exit.)" << std::endl; } } // namespace diff --git a/src/nghttpd.cc b/src/nghttpd.cc index e08ff00a..77befb92 100644 --- a/src/nghttpd.cc +++ b/src/nghttpd.cc @@ -90,54 +90,55 @@ namespace { void print_help(std::ostream &out) { print_usage(out); out << R"( - Specify listening port number. - Set path to server's private key. Required - unless --no-tls is specified. - Set path to server's certificate. Required - unless --no-tls is specified. + Specify listening port number. + + Set path to server's private key. Required unless + --no-tls is specified. + Set path to server's certificate. Required unless + --no-tls is specified. Options: - -D, --daemon Run in a background. If -D is used, the current - working directory is changed to '/'. Therefore - if this option is used, -d option must be - specified. + -D, --daemon + Run in a background. If -D is used, the current working + directory is changed to '/'. Therefore if this option + is used, -d option must be specified. -V, --verify-client - The server sends a client certificate request. - If the client did not return a certificate, the - handshake is terminated. Currently, this option - just requests a client certificate and does not - verify it. + The server sends a client certificate request. If the + client did not return a certificate, the handshake is + terminated. Currently, this option just requests a + client certificate and does not verify it. -d, --htdocs= - Specify document root. If this option is not - specified, the document root is the current - working directory. - -v, --verbose Print debug information such as reception/ - transmission of frames and name/value pairs. - --no-tls Disable SSL/TLS. - -c, --header-table-size= - Specify decoder header table size. - --color Force colored log output. + Specify document root. If this option is not specified, + the document root is the current working directory. + -v, --verbose + Print debug information such as reception/ transmission + of frames and name/value pairs. + --no-tls Disable SSL/TLS. + -c, --header-table-size= + Specify decoder header table size. + --color Force colored log output. -p, --push== - Push resources s when is - requested. This option can be used repeatedly to - specify multiple push configurations. and - s are relative to document root. See - --htdocs option. Example: -p/=/foo.png - -p/doc=/bar.css - -b, --padding= Add at most bytes to a frame payload as - padding. Specify 0 to disable padding. - -n, --workers= - Set the number of worker threads. - Default: 1 - -e, --error-gzip Make error response gzipped. + Push resources s when is requested. + This option can be used repeatedly to specify multiple + push configurations. and s are + relative to document root. See --htdocs option. + Example: -p/=/foo.png -p/doc=/bar.css + -b, --padding= + Add at most bytes to a frame payload as padding. + Specify 0 to disable padding. + -n, --workers= + Set the number of worker threads. + Default: 1 + -e, --error-gzip + Make error response gzipped. --dh-param-file= - Path to file that contains DH parameters in PEM - format. Without this option, DHE cipher suites - are not available. - --early-response Start sending response when request HEADERS is - received, rather than complete request is - received. - --version Display version information and exit. - -h, --help Display this help and exit.)" << std::endl; + Path to file that contains DH parameters in PEM format. + Without this option, DHE cipher suites are not + available. + --early-response + Start sending response when request HEADERS is received, + rather than complete request is received. + --version Display version information and exit. + -h, --help Display this help and exit.)" << std::endl; } } // namespace