From a8625e15f0139457b216287a266668754bad62b8 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 8 May 2015 19:24:17 +0900 Subject: [PATCH 01/18] clang-format --- lib/nghttp2_hd.c | 4 ++-- src/h2load.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index 7aac859c..f9444e09 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -1752,8 +1752,8 @@ static int hd_inflate_remove_bufs_with_name(nghttp2_hd_inflater *inflater, #ifndef NDEBUG rv = #endif - nghttp2_bufs_remove_copy(&inflater->nvbufs, - buf + ent_name->nv.namelen + 1); + nghttp2_bufs_remove_copy(&inflater->nvbufs, + buf + ent_name->nv.namelen + 1); assert(ent_name->nv.namelen + 1 + rv == buflen); nghttp2_bufs_reset(&inflater->nvbufs); diff --git a/src/h2load.h b/src/h2load.h index e731a305..15d071ba 100644 --- a/src/h2load.h +++ b/src/h2load.h @@ -94,8 +94,7 @@ struct RequestStat { bool completed; }; -template -struct TimeStat { +template struct TimeStat { // min, max, mean and sd (standard deviation) Duration min, max, mean, sd; // percentage of samples inside mean -/+ sd From 132719f752993525c7c2faadf19f5f723ade52f6 Mon Sep 17 00:00:00 2001 From: Syohei YOSHIDA Date: Tue, 12 May 2015 10:49:42 +0900 Subject: [PATCH 02/18] Correct misspellings in document --- README.rst | 6 +++--- doc/h2load.1 | 2 +- doc/h2load.1.rst | 2 +- doc/nghttpx.1 | 2 +- doc/nghttpx.1.rst | 2 +- doc/sources/h2load-howto.rst | 2 +- doc/sources/libnghttp2_asio.rst | 4 ++-- doc/sources/nghttpx-howto.rst | 4 ++-- doc/sources/python-apiref.rst | 2 +- doc/sources/tutorial-client.rst | 10 +++++----- doc/sources/tutorial-hpack.rst | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.rst b/README.rst index 3bade963..02f33e18 100644 --- a/README.rst +++ b/README.rst @@ -13,7 +13,7 @@ An HPACK encoder and decoder are available as a public API. An experimental high level C++ library is also available. -We have Python bindings of this libary, but we do not have full +We have Python bindings of this library, but we do not have full code coverage yet. Development Status @@ -490,7 +490,7 @@ disabled in the frontend and incoming HTTP/1.1 connections can be upgraded to HTTP/2 through HTTP Upgrade. The ``--http2-bridge``, ``--client`` and ``--client-proxy`` modes use -SSL/TLS in the backend connection by deafult. To disable SSL/TLS, use +SSL/TLS in the backend connection by default. To disable SSL/TLS, use the ``--backend-no-tls`` option. ``nghttpx`` supports a configuration file. See the ``--conf`` option and @@ -785,7 +785,7 @@ max_deflate_size The maximum header table size the encoder uses. This can be smaller than ``max_size``. In this case, the encoder only uses up to first ``max_deflate_size`` buffer. Since the header table size is still - ``max_size``, the encoder has to keep track of entries ouside the + ``max_size``, the encoder has to keep track of entries outside the ``max_deflate_size`` but inside the ``max_size`` and make sure that they are no longer referenced. diff --git a/doc/h2load.1 b/doc/h2load.1 index 8a59a11a..52c0428b 100644 --- a/doc/h2load.1 +++ b/doc/h2load.1 @@ -71,7 +71,7 @@ Default: \fB1\fP .INDENT 0.0 .TP .B \-i, \-\-input\-file= -Path of a file with multiple URIs are seperated by EOLs. +Path of a file with multiple URIs are separated by EOLs. This option will disable URIs getting from command\-line. If \(aq\-\(aq is given as , URIs will be read from stdin. URIs are used in this order for each client. All URIs diff --git a/doc/h2load.1.rst b/doc/h2load.1.rst index 4dae19e7..a8edea27 100644 --- a/doc/h2load.1.rst +++ b/doc/h2load.1.rst @@ -46,7 +46,7 @@ OPTIONS .. option:: -i, --input-file= - Path of a file with multiple URIs are seperated by EOLs. + Path of a file with multiple URIs are separated 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 diff --git a/doc/nghttpx.1 b/doc/nghttpx.1 index 6399cd05..4e5da161 100644 --- a/doc/nghttpx.1 +++ b/doc/nghttpx.1 @@ -812,7 +812,7 @@ argument in the configuration file. Specify \fByes\fP as an argument ignored. .sp To specify private key and certificate file which are given as -positional arguments in commnad\-line, use \fBprivate\-key\-file\fP and +positional arguments in command\-line, use \fBprivate\-key\-file\fP and \fBcertificate\-file\fP\&. .sp \fI\%\-\-conf\fP option cannot be used in the configuration file and diff --git a/doc/nghttpx.1.rst b/doc/nghttpx.1.rst index c4571d75..cdcbe019 100644 --- a/doc/nghttpx.1.rst +++ b/doc/nghttpx.1.rst @@ -727,7 +727,7 @@ FILES ignored. To specify private key and certificate file which are given as - positional arguments in commnad-line, use ``private-key-file`` and + positional arguments in command-line, use ``private-key-file`` and ``certificate-file``. :option:`--conf` option cannot be used in the configuration file and diff --git a/doc/sources/h2load-howto.rst b/doc/sources/h2load-howto.rst index 9660e07d..7c07194f 100644 --- a/doc/sources/h2load-howto.rst +++ b/doc/sources/h2load-howto.rst @@ -87,5 +87,5 @@ If multiple URIs are specified, they are used in round robin manner. .. note:: - Please note that h2load uses sheme, host and port in the first URI + Please note that h2load uses scheme, host and port in the first URI and ignores those parts in the rest of the URIs. diff --git a/doc/sources/libnghttp2_asio.rst b/doc/sources/libnghttp2_asio.rst index 85d2e01e..76999f9f 100644 --- a/doc/sources/libnghttp2_asio.rst +++ b/doc/sources/libnghttp2_asio.rst @@ -80,7 +80,7 @@ status code, in the above example, which is 200. The second argument, which is omitted in the above example, is additional header fields to send. -``nghttp2::asio_http2::server::response::end`` sends responde body. +``nghttp2::asio_http2::server::response::end`` sends response body. In the above example, we send string "hello, world". The life time of req and res object ends after the callback set by @@ -277,7 +277,7 @@ response header fields and response body to the console screen: ``boost::asio::io_service`` object and remote server address. When connection is made, the callback function passed to ``nghttp2::asio_http2::client::on_connect`` is invoked with connected -address as its paramter. After this callback call, use +address as its parameter. After this callback call, use ``nghttp2::asio_http2::session::submit`` to send request to the server. You can submit multiple requests at once without waiting for the completion of previous request. diff --git a/doc/sources/nghttpx-howto.rst b/doc/sources/nghttpx-howto.rst index 541e4a45..1f7d87e2 100644 --- a/doc/sources/nghttpx-howto.rst +++ b/doc/sources/nghttpx-howto.rst @@ -21,7 +21,7 @@ SSL/TLS, the frontend also supports SPDY protocol. By default, this mode's frontend connection is encrypted using SSL/TLS. So server's private key and certificate must be supplied to the command line (or through configuration file). In this case, the -fontend protocol selection will is done via ALPN or NPN. +frontend protocol selection will is done via ALPN or NPN. With ``--frontend-no-tls`` option, user can turn off SSL/TLS in frontend connection. In this case, SPDY protocol is not available @@ -243,7 +243,7 @@ Read/write rate limit --------------------- nghttpx supports transfer rate limiting on frontend connections. You -can do rate limit per frontend connection for reading and writeing +can do rate limit per frontend connection for reading and writing individually. To perform rate limit for reading, use ``--read-rate`` and diff --git a/doc/sources/python-apiref.rst b/doc/sources/python-apiref.rst index fd9e1111..d9d8494c 100644 --- a/doc/sources/python-apiref.rst +++ b/doc/sources/python-apiref.rst @@ -267,7 +267,7 @@ HTTP/2 servers (byte string could be ``None``), :py:data:`DATA_EOF` must be returned as flag. If there is no data available right now, but additional data are anticipated, return tuple (``None``, - :py:data:`DATA_DEFERRD`). When data arrived, call + :py:data:`DATA_DEFERRED`). When data arrived, call :py:meth:`resume()` and restart response body transmission. Only the body generator can pause response body generation; diff --git a/doc/sources/tutorial-client.rst b/doc/sources/tutorial-client.rst index 0d168991..94026323 100644 --- a/doc/sources/tutorial-client.rst +++ b/doc/sources/tutorial-client.rst @@ -65,11 +65,11 @@ its stream specific data in ``http2_stream_data`` structure and the defined as follows:: typedef struct { - /* The NULL-terminated URI string to retreive. */ + /* The NULL-terminated URI string to retrieve. */ const char *uri; /* Parsed result of the |uri| */ struct http_parser_url *u; - /* The authroity portion of the |uri|, not NULL-terminated */ + /* The authority portion of the |uri|, not NULL-terminated */ char *authority; /* The path portion of the |uri|, including query, not NULL-terminated */ @@ -204,7 +204,7 @@ transmission of client connection header is done in } Here we specify SETTINGS_MAX_CONCURRENT_STREAMS to 100, which is -really not needed for this tiny example progoram, but we are +really not needed for this tiny example program, but we are demonstrating the use of SETTINGS frame. To queue the SETTINGS frame for the transmission, we use `nghttp2_submit_settings()`. Note that `nghttp2_submit_settings()` function only queues the frame and not @@ -388,7 +388,7 @@ After all name/value pairs are emitted for a frame, } In this tutorial, we are just interested in the HTTP response -HEADERS. We check te frame type and its category (it should be +HEADERS. We check the frame type and its category (it should be :macro:`NGHTTP2_HCAT_RESPONSE` for HTTP response HEADERS). Also check its stream ID. @@ -407,7 +407,7 @@ of data is received from the remote peer:: } In our case, a chunk of data is response body. After checking stream -ID, we just write the recieved data to the stdout. Note that the +ID, we just write the received data to the stdout. Note that the output in the terminal may be corrupted if the response body contains some binary data. diff --git a/doc/sources/tutorial-hpack.rst b/doc/sources/tutorial-hpack.rst index 3bfc834d..0b4d59f1 100644 --- a/doc/sources/tutorial-hpack.rst +++ b/doc/sources/tutorial-hpack.rst @@ -51,7 +51,7 @@ bound of encoded result, use `nghttp2_hd_deflate_bound()` function:: size_t nghttp2_hd_deflate_bound(nghttp2_hd_deflater *deflater, const nghttp2_nv *nva, size_t nvlen); -Pass this function with the same paramters *deflater*, *nva* and +Pass this function with the same parameters *deflater*, *nva* and *nvlen* which will be passed to `nghttp2_hd_deflate_hd()`. The subsequent call of `nghttp2_hd_deflate_hd()` will use current From 2f2a7ace81223239aef48b5d4e3fff78e182b87e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 12 May 2015 23:24:18 +0900 Subject: [PATCH 03/18] Fix corresponding upstream source reported in previous commits accordingly --- doc/nghttpx.h2r | 2 +- examples/libevent-client.c | 4 ++-- src/h2load.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/nghttpx.h2r b/doc/nghttpx.h2r index 9f3cf66b..2d2f90d4 100644 --- a/doc/nghttpx.h2r +++ b/doc/nghttpx.h2r @@ -19,7 +19,7 @@ FILES ignored. To specify private key and certificate file which are given as - positional arguments in commnad-line, use ``private-key-file`` and + positional arguments in command-line, use ``private-key-file`` and ``certificate-file``. :option:`--conf` option cannot be used in the configuration file and diff --git a/examples/libevent-client.c b/examples/libevent-client.c index 4cda9b6f..af60fb3b 100644 --- a/examples/libevent-client.c +++ b/examples/libevent-client.c @@ -50,11 +50,11 @@ #define ARRLEN(x) (sizeof(x) / sizeof(x[0])) typedef struct { - /* The NULL-terminated URI string to retreive. */ + /* The NULL-terminated URI string to retrieve. */ const char *uri; /* Parsed result of the |uri| */ struct http_parser_url *u; - /* The authroity portion of the |uri|, not NULL-terminated */ + /* The authority portion of the |uri|, not NULL-terminated */ char *authority; /* The path portion of the |uri|, including query, not NULL-terminated */ diff --git a/src/h2load.cc b/src/h2load.cc index 8e1fa822..4c695334 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -1014,7 +1014,7 @@ Options: Number of native threads. Default: )" << config.nthreads << R"( -i, --input-file= - Path of a file with multiple URIs are seperated by EOLs. + Path of a file with multiple URIs are separated 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 From 260131966d347dce250d1d66a424348e8737a106 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 12 May 2015 23:30:17 +0900 Subject: [PATCH 04/18] help2rst.py: Add comment to tell that this is a generated file --- help2rst.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/help2rst.py b/help2rst.py index 4beda7b0..2c9c46c0 100755 --- a/help2rst.py +++ b/help2rst.py @@ -61,6 +61,8 @@ def help2man(infile): description.append(line) print ''' +.. GENERATED by help2rst.py. DO NOT EDIT DIRECTLY. + .. program:: {cmdname} {cmdname}(1) From 5da49989f8ffb403e5e5543fb6c6f54a43142600 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 13 May 2015 00:38:28 +0900 Subject: [PATCH 05/18] nghttpd: Add --echo-upload option to send back request body --- src/HttpServer.cc | 93 +++++++++++++++++++++++++++++++++++++++++++---- src/HttpServer.h | 2 + src/nghttpd.cc | 7 ++++ 3 files changed, 95 insertions(+), 7 deletions(-) diff --git a/src/HttpServer.cc b/src/HttpServer.cc index edbf1a81..bfda4274 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -91,7 +91,8 @@ Config::Config() session_option(nullptr), data_ptr(nullptr), padding(0), num_worker(1), max_concurrent_streams(100), header_table_size(-1), port(0), verbose(false), daemon(false), verify_client(false), no_tls(false), - error_gzip(false), early_response(false), hexdump(false) { + error_gzip(false), early_response(false), hexdump(false), + echo_upload(false) { nghttp2_option_new(&session_option); nghttp2_option_set_recv_client_preface(session_option, 1); } @@ -282,7 +283,7 @@ private: Stream::Stream(Http2Handler *handler, int32_t stream_id) : handler(handler), file_ent(nullptr), body_length(0), body_offset(0), - stream_id(stream_id) { + stream_id(stream_id), echo_upload(false) { auto config = handler->get_config(); ev_timer_init(&rtimer, stream_timeout_cb, 0., config->stream_read_timeout); ev_timer_init(&wtimer, stream_timeout_cb, 0., config->stream_write_timeout); @@ -918,6 +919,49 @@ void prepare_status_response(Stream *stream, Http2Handler *hd, int status) { } } // namespace +namespace { +void prepare_echo_response(Stream *stream, Http2Handler *hd) { + auto length = lseek(stream->file_ent->fd, 0, SEEK_END); + if (length == -1) { + hd->submit_rst_stream(stream, NGHTTP2_INTERNAL_ERROR); + return; + } + stream->body_length = length; + if (lseek(stream->file_ent->fd, 0, SEEK_SET) == -1) { + hd->submit_rst_stream(stream, NGHTTP2_INTERNAL_ERROR); + return; + } + nghttp2_data_provider data_prd; + data_prd.source.fd = stream->file_ent->fd; + data_prd.read_callback = file_read_callback; + + Headers headers; + headers.emplace_back("nghttpd-response", "echo"); + headers.emplace_back("content-length", util::utos(length)); + + hd->submit_response("200", stream->stream_id, headers, &data_prd); +} +} // namespace + +namespace { +bool prepare_upload_temp_store(Stream *stream, Http2Handler *hd) { + auto sessions = hd->get_sessions(); + + char tempfn[] = "/tmp/nghttpd.temp.XXXXXX"; + auto fd = mkstemp(tempfn); + if (fd == -1) { + return false; + } + unlink(tempfn); + // Ordinary request never start with "echo:". The length is 0 for + // now. We will update it when we get whole request body. + stream->file_ent = sessions->cache_fd(std::string("echo:") + tempfn, + FileEntry(tempfn, 0, 0, fd)); + stream->echo_upload = true; + return true; +} +} // namespace + namespace { void prepare_redirect_response(Stream *stream, Http2Handler *hd, const std::string &path, int status) { @@ -972,8 +1016,14 @@ void prepare_response(Stream *stream, Http2Handler *hd, url = reqpath; } - url = util::percentDecode(url.begin(), url.end()); + auto sessions = hd->get_sessions(); + + url = util::percentDecode(std::begin(url), std::end(url)); if (!util::check_path(url)) { + if (stream->file_ent) { + sessions->release_fd(stream->file_ent->path); + stream->file_ent = nullptr; + } prepare_status_response(stream, hd, 404); return; } @@ -987,12 +1037,18 @@ void prepare_response(Stream *stream, Http2Handler *hd, } } } + std::string path = hd->get_config()->htdocs + url; if (path[path.size() - 1] == '/') { path += DEFAULT_HTML; } - auto sessions = hd->get_sessions(); + if (stream->echo_upload) { + assert(stream->file_ent); + prepare_echo_response(stream, hd); + return; + } + auto file_ent = sessions->get_cached_fd(path); if (file_ent == nullptr) { @@ -1122,7 +1178,7 @@ int hd_on_frame_recv_callback(nghttp2_session *session, if (frame->hd.flags & NGHTTP2_FLAG_END_STREAM) { remove_stream_read_timeout(stream); - if (!hd->get_config()->early_response) { + if (stream->echo_upload || !hd->get_config()->early_response) { prepare_response(stream, hd); } } else { @@ -1146,14 +1202,22 @@ int hd_on_frame_recv_callback(nghttp2_session *session, hd->submit_non_final_response("100", frame->hd.stream_id); } - if (hd->get_config()->early_response) { + auto &method = http2::get_header(stream->hdidx, http2::HD__METHOD, + stream->headers)->value; + if (hd->get_config()->echo_upload && + (method == "POST" || method == "PUT")) { + if (!prepare_upload_temp_store(stream, hd)) { + hd->submit_rst_stream(stream, NGHTTP2_INTERNAL_ERROR); + return 0; + } + } else if (hd->get_config()->early_response) { prepare_response(stream, hd); } } if (frame->hd.flags & NGHTTP2_FLAG_END_STREAM) { remove_stream_read_timeout(stream); - if (!hd->get_config()->early_response) { + if (stream->echo_upload || !hd->get_config()->early_response) { prepare_response(stream, hd); } } else { @@ -1299,6 +1363,21 @@ int on_data_chunk_recv_callback(nghttp2_session *session, uint8_t flags, return 0; } + if (stream->echo_upload) { + assert(stream->file_ent); + while (len) { + ssize_t n; + while ((n = write(stream->file_ent->fd, data, len)) == -1 && + errno == EINTR) + ; + if (n == -1) { + hd->submit_rst_stream(stream, NGHTTP2_INTERNAL_ERROR); + return 0; + } + len -= n; + data += n; + } + } // TODO Handle POST add_stream_read_timeout(stream); diff --git a/src/HttpServer.h b/src/HttpServer.h index 98ca9c43..3d96bc22 100644 --- a/src/HttpServer.h +++ b/src/HttpServer.h @@ -73,6 +73,7 @@ struct Config { bool error_gzip; bool early_response; bool hexdump; + bool echo_upload; Config(); ~Config(); }; @@ -101,6 +102,7 @@ struct Stream { int64_t body_offset; int32_t stream_id; http2::HeaderIndex hdidx; + bool echo_upload; Stream(Http2Handler *handler, int32_t stream_id); ~Stream(); }; diff --git a/src/nghttpd.cc b/src/nghttpd.cc index 5126cea1..83b26a48 100644 --- a/src/nghttpd.cc +++ b/src/nghttpd.cc @@ -153,6 +153,8 @@ Options: --hexdump Display the incoming traffic in hexadecimal (Canonical hex+ASCII display). If SSL/TLS is used, decrypted data are used. + --echo-upload + Send back uploaded content if method is POST or PUT. --version Display version information and exit. -h, --help Display this help and exit. @@ -188,6 +190,7 @@ int main(int argc, char **argv) { {"early-response", no_argument, &flag, 5}, {"trailer", required_argument, &flag, 6}, {"hexdump", no_argument, &flag, 7}, + {"echo-upload", no_argument, &flag, 8}, {nullptr, 0, nullptr, 0}}; int option_index = 0; int c = getopt_long(argc, argv, "DVb:c:d:ehm:n:p:va:", long_options, @@ -310,6 +313,10 @@ int main(int argc, char **argv) { // hexdump option config.hexdump = true; break; + case 8: + // echo-upload option + config.echo_upload = true; + break; } break; default: From 91c8f085ef0f9c233554c35a9e48800365d71b77 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 13 May 2015 00:44:37 +0900 Subject: [PATCH 06/18] Update man pages --- doc/h2load.1 | 2 +- doc/h2load.1.rst | 2 ++ doc/nghttp.1 | 2 +- doc/nghttp.1.rst | 2 ++ doc/nghttpd.1 | 7 ++++++- doc/nghttpd.1.rst | 6 ++++++ doc/nghttpx.1 | 2 +- doc/nghttpx.1.rst | 2 ++ 8 files changed, 21 insertions(+), 4 deletions(-) diff --git a/doc/h2load.1 b/doc/h2load.1 index 52c0428b..e6acc547 100644 --- a/doc/h2load.1 +++ b/doc/h2load.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "H2LOAD" "1" "May 08, 2015" "0.7.14" "nghttp2" +.TH "H2LOAD" "1" "May 13, 2015" "0.7.15-DEV" "nghttp2" .SH NAME h2load \- HTTP/2 benchmarking tool . diff --git a/doc/h2load.1.rst b/doc/h2load.1.rst index a8edea27..2bc0f6a8 100644 --- a/doc/h2load.1.rst +++ b/doc/h2load.1.rst @@ -1,4 +1,6 @@ +.. GENERATED by help2rst.py. DO NOT EDIT DIRECTLY. + .. program:: h2load h2load(1) diff --git a/doc/nghttp.1 b/doc/nghttp.1 index 51596f6a..1ec86b1e 100644 --- a/doc/nghttp.1 +++ b/doc/nghttp.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "NGHTTP" "1" "May 08, 2015" "0.7.14" "nghttp2" +.TH "NGHTTP" "1" "May 13, 2015" "0.7.15-DEV" "nghttp2" .SH NAME nghttp \- HTTP/2 experimental client . diff --git a/doc/nghttp.1.rst b/doc/nghttp.1.rst index 88cb8afd..7f2449b2 100644 --- a/doc/nghttp.1.rst +++ b/doc/nghttp.1.rst @@ -1,4 +1,6 @@ +.. GENERATED by help2rst.py. DO NOT EDIT DIRECTLY. + .. program:: nghttp nghttp(1) diff --git a/doc/nghttpd.1 b/doc/nghttpd.1 index 0c98d0d3..0da439b0 100644 --- a/doc/nghttpd.1 +++ b/doc/nghttpd.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "NGHTTPD" "1" "May 08, 2015" "0.7.14" "nghttp2" +.TH "NGHTTPD" "1" "May 13, 2015" "0.7.15-DEV" "nghttp2" .SH NAME nghttpd \- HTTP/2 experimental server . @@ -167,6 +167,11 @@ are used. .UNINDENT .INDENT 0.0 .TP +.B \-\-echo\-upload +Send back uploaded content if method is POST or PUT. +.UNINDENT +.INDENT 0.0 +.TP .B \-\-version Display version information and exit. .UNINDENT diff --git a/doc/nghttpd.1.rst b/doc/nghttpd.1.rst index abb9c45a..e9ac30df 100644 --- a/doc/nghttpd.1.rst +++ b/doc/nghttpd.1.rst @@ -1,4 +1,6 @@ +.. GENERATED by help2rst.py. DO NOT EDIT DIRECTLY. + .. program:: nghttpd nghttpd(1) @@ -126,6 +128,10 @@ OPTIONS hex+ASCII display). If SSL/TLS is used, decrypted data are used. +.. option:: --echo-upload + + Send back uploaded content if method is POST or PUT. + .. option:: --version Display version information and exit. diff --git a/doc/nghttpx.1 b/doc/nghttpx.1 index 4e5da161..34ae5be9 100644 --- a/doc/nghttpx.1 +++ b/doc/nghttpx.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "NGHTTPX" "1" "May 08, 2015" "0.7.14" "nghttp2" +.TH "NGHTTPX" "1" "May 13, 2015" "0.7.15-DEV" "nghttp2" .SH NAME nghttpx \- HTTP/2 experimental proxy . diff --git a/doc/nghttpx.1.rst b/doc/nghttpx.1.rst index cdcbe019..efacbb44 100644 --- a/doc/nghttpx.1.rst +++ b/doc/nghttpx.1.rst @@ -1,4 +1,6 @@ +.. GENERATED by help2rst.py. DO NOT EDIT DIRECTLY. + .. program:: nghttpx nghttpx(1) From 38cfc5c47cd270c15b978f8033962289d503a7aa Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 13 May 2015 22:30:35 +0900 Subject: [PATCH 07/18] Check more headers and funcs --- configure.ac | 75 +++++++++++++++++++----- examples/asio-sv2.cc | 4 ++ examples/client.c | 12 +++- examples/libevent-client.c | 8 ++- examples/libevent-server.c | 12 +++- examples/tiny-nghttpd.c | 14 ++++- src/HttpServer.cc | 12 ++++ src/app_helper.cc | 10 ++++ src/app_helper.h | 2 + src/buffer_test.h | 4 ++ src/deflatehd.cc | 2 + src/h2load.cc | 4 ++ src/h2load.h | 4 ++ src/http2_test.h | 4 ++ src/inflatehd.cc | 2 + src/memchunk_test.h | 4 ++ src/nghttp.cc | 6 ++ src/nghttp.h | 4 ++ src/nghttp2_gzip_test.h | 4 ++ src/nghttpd.cc | 2 + src/shrpx-unittest.cc | 2 +- src/shrpx.cc | 16 +++++ src/shrpx.h | 2 + src/shrpx_accept_handler.cc | 2 + src/shrpx_client_handler.cc | 2 + src/shrpx_config.cc | 10 ++++ src/shrpx_config.h | 6 ++ src/shrpx_config_test.cc | 2 + src/shrpx_config_test.h | 4 ++ src/shrpx_connection.cc | 2 + src/shrpx_connection_handler.cc | 2 + src/shrpx_connection_handler.h | 2 + src/shrpx_downstream_test.h | 4 ++ src/shrpx_http2_downstream_connection.cc | 2 + src/shrpx_http2_session.cc | 2 + src/shrpx_log.cc | 6 ++ src/shrpx_ssl.cc | 4 ++ src/shrpx_ssl_test.h | 4 ++ src/shrpx_worker.cc | 2 + src/timegm.h | 2 + src/util.cc | 12 ++++ src/util.h | 4 ++ src/util_test.h | 4 ++ 43 files changed, 266 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 5d349cb3..efff6ece 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,25 @@ dnl http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Orderin AC_PREREQ(2.61) AC_INIT([nghttp2], [0.7.15-DEV], [t-tujikawa@users.sourceforge.net]) +AC_USE_SYSTEM_EXTENSIONS + LT_PREREQ([2.2.6]) LT_INIT() + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST +AC_CANONICAL_TARGET + +AM_INIT_AUTOMAKE([subdir-objects]) +# comment out for now since this requires automake 1.13 or higher and +# travis has older one. +# AM_EXTRA_RECURSIVE_TARGETS([it]) + +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_HEADERS([config.h]) + dnl See versioning rule: dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html AC_SUBST(LT_CURRENT, 13) @@ -42,21 +59,6 @@ PACKAGE_VERSION_NUM=`printf "0x%02x%02x%02x" "$major" "$minor" "$patch"` AC_SUBST(PACKAGE_VERSION_NUM) -AC_CANONICAL_BUILD -AC_CANONICAL_HOST -AC_CANONICAL_TARGET - -AC_CONFIG_MACRO_DIR([m4]) - -AM_INIT_AUTOMAKE([subdir-objects]) -# comment out for now since this requires automake 1.13 or higher and -# travis has older one. -# AM_EXTRA_RECURSIVE_TARGETS([it]) - -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -AC_CONFIG_HEADERS([config.h]) - dnl Checks for command-line options AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], @@ -129,10 +131,13 @@ AC_ARG_VAR([CYTHON], [the Cython executable]) dnl Checks for programs AC_PROG_CC AC_PROG_CXX +AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET -AM_PROG_CC_C_O +AC_PROG_RANLIB +AC_PROG_MKDIR_P + PKG_PROG_PKG_CONFIG([0.20]) if [test "x$request_python_bindings" != "xno"]; then @@ -498,12 +503,19 @@ AM_CONDITIONAL([ENABLE_FAILMALLOC], [ test "x${enable_failmalloc}" = "xyes" ]) AC_HEADER_ASSERT AC_CHECK_HEADERS([ \ arpa/inet.h \ + fcntl.h \ + inttypes.h \ + limits.h \ + netdb.h \ netinet/in.h \ pwd.h \ stddef.h \ stdint.h \ stdlib.h \ string.h \ + sys/socket.h \ + sys/time.h \ + syslog.h \ time.h \ unistd.h \ ]) @@ -515,8 +527,17 @@ AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T +AC_TYPE_INT8_T +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_UID_T AC_CHECK_TYPES([ptrdiff_t]) +AC_CHECK_HEADER_STDBOOL AC_C_BIGENDIAN +AC_C_INLINE AC_SYS_LARGEFILE AC_CHECK_MEMBER([struct tm.tm_gmtoff], [have_struct_tm_tm_gmtoff=yes], @@ -535,12 +556,34 @@ AC_CHECK_SIZEOF([int *]) if test "x$cross_compiling" != "xyes"; then AC_FUNC_MALLOC fi + +AC_FUNC_CHOWN +AC_FUNC_ERROR_AT_LINE +AC_FUNC_FORK +# Don't check realloc, since LeakSanitizer detects memory leak during check +# AC_FUNC_REALLOC +AC_FUNC_STRERROR_R +AC_FUNC_STRNLEN + AC_CHECK_FUNCS([ \ _Exit \ accept4 \ + dup2 \ + getcwd \ getpwnam \ + localtime_r \ + memchr \ memmove \ memset \ + socket \ + sqrt \ + strchr \ + strdup \ + strerror \ + strndup \ + strstr \ + strtol \ + strtoul \ timegm \ ]) diff --git a/examples/asio-sv2.cc b/examples/asio-sv2.cc index 6cc2d5c0..8d2580ed 100644 --- a/examples/asio-sv2.cc +++ b/examples/asio-sv2.cc @@ -35,8 +35,12 @@ // #include #include +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H #include #include diff --git a/examples/client.c b/examples/client.c index 314efb34..b2680f61 100644 --- a/examples/client.c +++ b/examples/client.c @@ -28,16 +28,26 @@ */ #ifdef HAVE_CONFIG_H #include -#endif /* !HAVE_CONFIG_H */ +#endif /* HAVE_CONFIG_H */ #include #include +#ifdef HAVE_UNISTD_H #include +#endif /* HAVE_UNISTD_H */ +#ifdef HAVE_FCNTL_H #include +#endif /* HAVE_FCNTL_H */ #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif /* HAVE_SYS_SOCKET_H */ +#ifdef HAVE_NETDB_H #include +#endif /* HAVE_NETDB_H */ +#ifdef HAVE_NETINET_IN_H #include +#endif /* HAVE_NETINET_IN_H */ #include #include #include diff --git a/examples/libevent-client.c b/examples/libevent-client.c index af60fb3b..019254c0 100644 --- a/examples/libevent-client.c +++ b/examples/libevent-client.c @@ -24,12 +24,18 @@ */ #ifdef HAVE_CONFIG_H #include -#endif /* !HAVE_CONFIG_H */ +#endif /* HAVE_CONFIG_H */ #include +#ifdef HAVE_UNISTD_H #include +#endif /* HAVE_UNISTD_H */ +#ifdef HAVE_SYS_SOCKET_H #include +#endif /* HAVE_SYS_SOCKET_H */ +#ifdef HAVE_NETINET_IN_H #include +#endif /* HAVE_NETINET_IN_H */ #include #include #include diff --git a/examples/libevent-server.c b/examples/libevent-server.c index 9746f234..05a24bbc 100644 --- a/examples/libevent-server.c +++ b/examples/libevent-server.c @@ -24,17 +24,27 @@ */ #ifdef HAVE_CONFIG_H #include -#endif /* !HAVE_CONFIG_H */ +#endif /* HAVE_CONFIG_H */ #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif /* HAVE_SYS_SOCKET_H */ +#ifdef HAVE_NETDB_H #include +#endif /* HAVE_NETDB_H */ #include +#ifdef HAVE_UNISTD_H #include +#endif /* HAVE_UNISTD_H */ #include +#ifdef HAVE_FCNTL_H #include +#endif /* HAVE_FCNTL_H */ #include +#ifdef HAVE_NETINET_IN_H #include +#endif /* HAVE_NETINET_IN_H */ #include #include diff --git a/examples/tiny-nghttpd.c b/examples/tiny-nghttpd.c index e11df975..613112fc 100644 --- a/examples/tiny-nghttpd.c +++ b/examples/tiny-nghttpd.c @@ -30,18 +30,30 @@ #ifdef HAVE_CONFIG_H #include -#endif /* !HAVE_CONFIG_H */ +#endif /* HAVE_CONFIG_H */ #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif /* HAVE_SYS_SOCKET_H */ #include +#ifdef HAVE_FCNTL_H #include +#endif /* HAVE_FCNTL_H */ +#ifdef HAVE_NETDB_H #include +#endif /* HAVE_NETDB_H */ +#ifdef HAVE_NETINET_IN_H #include +#endif /* HAVE_NETINET_IN_H */ #include +#ifdef HAVE_UNISTD_H #include +#endif /* HAVE_UNISTD_H */ #include +#ifdef HAVE_TIME_H #include +#endif /* HAVE_TIME_H */ #include #include #include diff --git a/src/HttpServer.cc b/src/HttpServer.cc index bfda4274..03104284 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -25,13 +25,25 @@ #include "HttpServer.h" #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include +#ifdef HAVE_ARPA_INET_H #include +#endif // HAVE_ARPA_INET_H #include #include diff --git a/src/app_helper.cc b/src/app_helper.cc index af7653c1..48298b91 100644 --- a/src/app_helper.cc +++ b/src/app_helper.cc @@ -23,11 +23,21 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include #include diff --git a/src/app_helper.h b/src/app_helper.h index 6675fde5..14aba711 100644 --- a/src/app_helper.h +++ b/src/app_helper.h @@ -29,7 +29,9 @@ #include #include +#ifdef HAVE_SYS_TIME_H #include +#endif // HAVE_SYS_TIME_H #include #include diff --git a/src/buffer_test.h b/src/buffer_test.h index d1a889b5..abdc9879 100644 --- a/src/buffer_test.h +++ b/src/buffer_test.h @@ -25,6 +25,10 @@ #ifndef BUFFER_TEST_H #define BUFFER_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace nghttp2 { void test_buffer_write(void); diff --git a/src/deflatehd.cc b/src/deflatehd.cc index dd67ebdb..cd0c5d59 100644 --- a/src/deflatehd.cc +++ b/src/deflatehd.cc @@ -26,7 +26,9 @@ #include #endif // HAVE_CONFIG_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include diff --git a/src/h2load.cc b/src/h2load.cc index 4c695334..55784156 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -26,10 +26,14 @@ #include #include +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include #include +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H #include #include diff --git a/src/h2load.h b/src/h2load.h index 15d071ba..78a20389 100644 --- a/src/h2load.h +++ b/src/h2load.h @@ -28,8 +28,12 @@ #include "nghttp2_config.h" #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include #include diff --git a/src/http2_test.h b/src/http2_test.h index 1171b926..36c5a59a 100644 --- a/src/http2_test.h +++ b/src/http2_test.h @@ -25,6 +25,10 @@ #ifndef SHRPX_HTTP2_TEST_H #define SHRPX_HTTP2_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace shrpx { void test_http2_add_header(void); diff --git a/src/inflatehd.cc b/src/inflatehd.cc index 353941af..37077e85 100644 --- a/src/inflatehd.cc +++ b/src/inflatehd.cc @@ -26,7 +26,9 @@ #include #endif // HAVE_CONFIG_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include diff --git a/src/memchunk_test.h b/src/memchunk_test.h index 31e2665c..9d170a43 100644 --- a/src/memchunk_test.h +++ b/src/memchunk_test.h @@ -25,6 +25,10 @@ #ifndef MEMCHUNK_TEST_H #define MEMCHUNK_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace nghttp2 { void test_pool_recycle(void); diff --git a/src/nghttp.cc b/src/nghttp.cc index 49e1825b..d8c3a58c 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -25,9 +25,15 @@ #include "nghttp.h" #include +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include #include diff --git a/src/nghttp.h b/src/nghttp.h index 67e94722..0a7ee351 100644 --- a/src/nghttp.h +++ b/src/nghttp.h @@ -28,8 +28,12 @@ #include "nghttp2_config.h" #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include #include diff --git a/src/nghttp2_gzip_test.h b/src/nghttp2_gzip_test.h index ff2598d5..2defcdc8 100644 --- a/src/nghttp2_gzip_test.h +++ b/src/nghttp2_gzip_test.h @@ -25,6 +25,10 @@ #ifndef NGHTTP2_GZIP_TEST_H #define NGHTTP2_GZIP_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ + #ifdef __cplusplus extern "C" { #endif diff --git a/src/nghttpd.cc b/src/nghttpd.cc index 83b26a48..4ffc0bc9 100644 --- a/src/nghttpd.cc +++ b/src/nghttpd.cc @@ -24,7 +24,9 @@ */ #include "nghttp2_config.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include diff --git a/src/shrpx-unittest.cc b/src/shrpx-unittest.cc index 34428e07..86edb1e0 100644 --- a/src/shrpx-unittest.cc +++ b/src/shrpx-unittest.cc @@ -24,7 +24,7 @@ */ #ifdef HAVE_CONFIG_H #include -#endif /* HAVE_CONFIG_H */ +#endif // HAVE_CONFIG_H #include #include diff --git a/src/shrpx.cc b/src/shrpx.cc index 49593e45..2cb2cc59 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -27,19 +27,35 @@ #include #include #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H #include +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include +#ifdef HAVE_ARPA_INET_H #include +#endif // HAVE_ARPA_INET_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include +#ifdef HAVE_SYSLOG_H #include +#endif // HAVE_SYSLOG_H #include +#ifdef HAVE_LIMITS_H #include +#endif // HAVE_LIMITS_H +#ifdef HAVE_SYS_TIME_H #include +#endif // HAVE_SYS_TIME_H #include #include diff --git a/src/shrpx.h b/src/shrpx.h index 85c4d343..bd91c766 100644 --- a/src/shrpx.h +++ b/src/shrpx.h @@ -30,7 +30,9 @@ #endif // HAVE_CONFIG_H #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H #include diff --git a/src/shrpx_accept_handler.cc b/src/shrpx_accept_handler.cc index d69a05cc..0d448306 100644 --- a/src/shrpx_accept_handler.cc +++ b/src/shrpx_accept_handler.cc @@ -24,7 +24,9 @@ */ #include "shrpx_accept_handler.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index 1d66e2e3..51e0b524 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -24,7 +24,9 @@ */ #include "shrpx_client_handler.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include "shrpx_upstream.h" diff --git a/src/shrpx_config.cc b/src/shrpx_config.cc index 9e0ac424..6577343d 100644 --- a/src/shrpx_config.cc +++ b/src/shrpx_config.cc @@ -24,13 +24,23 @@ */ #include "shrpx_config.h" +#ifdef HAVE_PWD_H #include +#endif // HAVE_PWD_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H +#ifdef HAVE_SYSLOG_H #include +#endif // HAVE_SYSLOG_H #include #include +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include diff --git a/src/shrpx_config.h b/src/shrpx_config.h index 4856fb8e..872bf836 100644 --- a/src/shrpx_config.h +++ b/src/shrpx_config.h @@ -29,10 +29,16 @@ #include #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H #include +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H +#ifdef HAVE_ARPA_INET_H #include +#endif // HAVE_ARPA_INET_H #include #include #include diff --git a/src/shrpx_config_test.cc b/src/shrpx_config_test.cc index e326b4af..ad570bbc 100644 --- a/src/shrpx_config_test.cc +++ b/src/shrpx_config_test.cc @@ -24,7 +24,9 @@ */ #include "shrpx_config_test.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include diff --git a/src/shrpx_config_test.h b/src/shrpx_config_test.h index 9db5d4e3..6d6d0353 100644 --- a/src/shrpx_config_test.h +++ b/src/shrpx_config_test.h @@ -25,6 +25,10 @@ #ifndef SHRPX_CONFIG_TEST_H #define SHRPX_CONFIG_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace shrpx { void test_shrpx_config_parse_config_str_list(void); diff --git a/src/shrpx_connection.cc b/src/shrpx_connection.cc index 51a5d39c..88ded529 100644 --- a/src/shrpx_connection.cc +++ b/src/shrpx_connection.cc @@ -24,7 +24,9 @@ */ #include "shrpx_connection.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include diff --git a/src/shrpx_connection_handler.cc b/src/shrpx_connection_handler.cc index 8779779d..ceebf61b 100644 --- a/src/shrpx_connection_handler.cc +++ b/src/shrpx_connection_handler.cc @@ -24,7 +24,9 @@ */ #include "shrpx_connection_handler.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include diff --git a/src/shrpx_connection_handler.h b/src/shrpx_connection_handler.h index d8c328c5..00e4be49 100644 --- a/src/shrpx_connection_handler.h +++ b/src/shrpx_connection_handler.h @@ -28,7 +28,9 @@ #include "shrpx.h" #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H #include #include diff --git a/src/shrpx_downstream_test.h b/src/shrpx_downstream_test.h index b1e1aee5..67e8f6bd 100644 --- a/src/shrpx_downstream_test.h +++ b/src/shrpx_downstream_test.h @@ -25,6 +25,10 @@ #ifndef SHRPX_DOWNSTREAM_TEST_H #define SHRPX_DOWNSTREAM_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace shrpx { void test_downstream_index_request_headers(void); diff --git a/src/shrpx_http2_downstream_connection.cc b/src/shrpx_http2_downstream_connection.cc index d8d83d73..f5cba83e 100644 --- a/src/shrpx_http2_downstream_connection.cc +++ b/src/shrpx_http2_downstream_connection.cc @@ -24,7 +24,9 @@ */ #include "shrpx_http2_downstream_connection.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include "http-parser/http_parser.h" diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index 2e8568ed..4fae1f0e 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -25,7 +25,9 @@ #include "shrpx_http2_session.h" #include +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include diff --git a/src/shrpx_log.cc b/src/shrpx_log.cc index 621aad8e..1446df6e 100644 --- a/src/shrpx_log.cc +++ b/src/shrpx_log.cc @@ -24,9 +24,15 @@ */ #include "shrpx_log.h" +#ifdef HAVE_SYSLOG_H #include +#endif // HAVE_SYSLOG_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H +#ifdef HAVE_INTTYPES_H #include +#endif // HAVE_INTTYPES_H #include #include diff --git a/src/shrpx_ssl.cc b/src/shrpx_ssl.cc index cb27749a..b37ad26f 100644 --- a/src/shrpx_ssl.cc +++ b/src/shrpx_ssl.cc @@ -24,8 +24,12 @@ */ #include "shrpx_ssl.h" +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include #include #include diff --git a/src/shrpx_ssl_test.h b/src/shrpx_ssl_test.h index fbb1fa62..89b00449 100644 --- a/src/shrpx_ssl_test.h +++ b/src/shrpx_ssl_test.h @@ -25,6 +25,10 @@ #ifndef SHRPX_SSL_TEST_H #define SHRPX_SSL_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace shrpx { void test_shrpx_ssl_create_lookup_tree(void); diff --git a/src/shrpx_worker.cc b/src/shrpx_worker.cc index 6b2b658b..a9bf6e65 100644 --- a/src/shrpx_worker.cc +++ b/src/shrpx_worker.cc @@ -24,7 +24,9 @@ */ #include "shrpx_worker.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include diff --git a/src/timegm.h b/src/timegm.h index 529235cf..32a9526d 100644 --- a/src/timegm.h +++ b/src/timegm.h @@ -33,7 +33,9 @@ extern "C" { #endif /* __cplusplus */ +#ifdef HAVE_TIME_H #include +#endif // HAVE_TIME_H #ifndef HAVE_TIMEGM diff --git a/src/util.cc b/src/util.cc index 2926ae9e..20aaca70 100644 --- a/src/util.cc +++ b/src/util.cc @@ -24,15 +24,27 @@ */ #include "util.h" +#ifdef HAVE_TIME_H #include +#endif // HAVE_TIME_H #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include +#ifdef HAVE_ARPA_INET_H #include +#endif // HAVE_ARPA_INET_H #include #include diff --git a/src/util.h b/src/util.h index f20624d5..4525df53 100644 --- a/src/util.h +++ b/src/util.h @@ -27,9 +27,13 @@ #include "nghttp2_config.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include #include diff --git a/src/util_test.h b/src/util_test.h index d8f7dd47..00290b89 100644 --- a/src/util_test.h +++ b/src/util_test.h @@ -25,6 +25,10 @@ #ifndef UTIL_TEST_H #define UTIL_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace shrpx { void test_util_streq(void); From 0aa17f64c188a90495c166cc5b18a960356a0f02 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 13 May 2015 23:39:48 +0900 Subject: [PATCH 08/18] doc: Remove 'NGHTTP2_EXTERN' from api doc --- doc/mkapiref.py | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/mkapiref.py b/doc/mkapiref.py index 16382d49..23ab9cc5 100755 --- a/doc/mkapiref.py +++ b/doc/mkapiref.py @@ -222,6 +222,7 @@ def process_function(domain, infile): func_proto = ''.join(func_proto) func_proto = re.sub(r';\n$', '', func_proto) func_proto = re.sub(r'\s+', ' ', func_proto) + func_proto = re.sub(r'NGHTTP2_EXTERN ', '', func_proto) return FunctionDoc(func_proto, content, domain) def read_content(infile): From c4068cd404f7afa5783f5724b8464fdafee40430 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 13 May 2015 23:48:31 +0900 Subject: [PATCH 09/18] Fix travis build error Remove AC_PROG_RANLIB because it is rendered obsolete by LT_INIT. Remove AC_CHECK_HEADER_STDBOOl, because travis does not have one. --- configure.ac | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.ac b/configure.ac index efff6ece..ba9749c7 100644 --- a/configure.ac +++ b/configure.ac @@ -135,7 +135,6 @@ AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET -AC_PROG_RANLIB AC_PROG_MKDIR_P PKG_PROG_PKG_CONFIG([0.20]) @@ -535,7 +534,6 @@ AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_UID_T AC_CHECK_TYPES([ptrdiff_t]) -AC_CHECK_HEADER_STDBOOL AC_C_BIGENDIAN AC_C_INLINE AC_SYS_LARGEFILE From 53bfc70c9e9da8a572bf02a2ac57904548f0ae4a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 14 May 2015 00:17:45 +0900 Subject: [PATCH 10/18] Include inttypes.h (or cintypes for C++) instead of stdint.h From autoconf manual, section 5.6.1 Portability of Headers, says: """ The C99 standard says that inttypes.h includes stdint.h, so there's no need to include stdint.h separately in a standard environment. Some implementations have inttypes.h but not stdint.h (e.g., Solaris 7), but we don't know of any implementation that has stdint.h but not inttypes.h. """ --- examples/client.c | 2 +- lib/includes/nghttp2/nghttp2.h | 2 +- src/HttpServer.h | 2 +- src/app_helper.h | 2 +- src/h2load_session.h | 3 ++- src/shrpx.cc | 2 +- src/shrpx_config.h | 2 +- src/shrpx_downstream.h | 3 +-- src/shrpx_downstream_queue.h | 3 +-- src/shrpx_https_upstream.h | 3 +-- src/timegm.c | 2 +- 11 files changed, 12 insertions(+), 14 deletions(-) diff --git a/examples/client.c b/examples/client.c index b2680f61..b12c3e48 100644 --- a/examples/client.c +++ b/examples/client.c @@ -30,7 +30,7 @@ #include #endif /* HAVE_CONFIG_H */ -#include +#include #include #ifdef HAVE_UNISTD_H #include diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index c9857e16..4edba80e 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -36,7 +36,7 @@ extern "C" { #endif #include -#include +#include #include #include diff --git a/src/HttpServer.h b/src/HttpServer.h index 3d96bc22..a91e7d3c 100644 --- a/src/HttpServer.h +++ b/src/HttpServer.h @@ -27,9 +27,9 @@ #include "nghttp2_config.h" -#include #include +#include #include #include diff --git a/src/app_helper.h b/src/app_helper.h index 14aba711..034489f4 100644 --- a/src/app_helper.h +++ b/src/app_helper.h @@ -27,7 +27,7 @@ #include "nghttp2_config.h" -#include +#include #include #ifdef HAVE_SYS_TIME_H #include diff --git a/src/h2load_session.h b/src/h2load_session.h index 4231b914..18175748 100644 --- a/src/h2load_session.h +++ b/src/h2load_session.h @@ -28,7 +28,8 @@ #include "nghttp2_config.h" #include -#include + +#include #include "h2load.h" diff --git a/src/shrpx.cc b/src/shrpx.cc index 2cb2cc59..9cbcc367 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -24,7 +24,6 @@ */ #include "shrpx.h" -#include #include #include #ifdef HAVE_SYS_SOCKET_H @@ -59,6 +58,7 @@ #include #include +#include #include #include #include diff --git a/src/shrpx_config.h b/src/shrpx_config.h index 872bf836..8afccd51 100644 --- a/src/shrpx_config.h +++ b/src/shrpx_config.h @@ -27,7 +27,6 @@ #include "shrpx.h" -#include #include #ifdef HAVE_SYS_SOCKET_H #include @@ -39,6 +38,7 @@ #ifdef HAVE_ARPA_INET_H #include #endif // HAVE_ARPA_INET_H +#include #include #include #include diff --git a/src/shrpx_downstream.h b/src/shrpx_downstream.h index f761b6a0..2bd29312 100644 --- a/src/shrpx_downstream.h +++ b/src/shrpx_downstream.h @@ -27,8 +27,7 @@ #include "shrpx.h" -#include - +#include #include #include #include diff --git a/src/shrpx_downstream_queue.h b/src/shrpx_downstream_queue.h index ee5028bd..d327a05f 100644 --- a/src/shrpx_downstream_queue.h +++ b/src/shrpx_downstream_queue.h @@ -27,8 +27,7 @@ #include "shrpx.h" -#include - +#include #include #include #include diff --git a/src/shrpx_https_upstream.h b/src/shrpx_https_upstream.h index 1b0c648a..3b9d5320 100644 --- a/src/shrpx_https_upstream.h +++ b/src/shrpx_https_upstream.h @@ -27,8 +27,7 @@ #include "shrpx.h" -#include - +#include #include #include "http-parser/http_parser.h" diff --git a/src/timegm.c b/src/timegm.c index bf572b72..90bf53ff 100644 --- a/src/timegm.c +++ b/src/timegm.c @@ -26,7 +26,7 @@ #ifndef HAVE_TIMEGM -#include +#include /* Counter the number of leap year in the range [0, y). The |y| is the year, including century (e.g., 2012) */ From 32603d7efff48bf58937392b194d286c7c854fbd Mon Sep 17 00:00:00 2001 From: Etienne Cimon Date: Thu, 14 May 2015 10:45:17 -0400 Subject: [PATCH 11/18] Access violation in buffers When adding a large amount of data that spans to multiple chunks, the pointer is incremented by the wrong value. --- lib/nghttp2_buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nghttp2_buf.c b/lib/nghttp2_buf.c index 0941f78b..96454a89 100644 --- a/lib/nghttp2_buf.c +++ b/lib/nghttp2_buf.c @@ -320,7 +320,7 @@ int nghttp2_bufs_add(nghttp2_bufs *bufs, const void *data, size_t len) { } buf->last = nghttp2_cpymem(buf->last, p, nwrite); - p += len; + p += nwrite; len -= nwrite; } From 252aeb43e1e11c1974b8a56f77a94468135ab87a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 15 May 2015 01:00:09 +0900 Subject: [PATCH 12/18] Add test for GH-232 --- tests/main.c | 2 ++ tests/nghttp2_buf_test.c | 20 ++++++++++++++++++++ tests/nghttp2_buf_test.h | 1 + 3 files changed, 23 insertions(+) diff --git a/tests/main.c b/tests/main.c index 933da918..ae42e70c 100644 --- a/tests/main.c +++ b/tests/main.c @@ -340,6 +340,8 @@ int main(int argc _U_, char *argv[] _U_) { !CU_add_test(pSuite, "check_header_value", test_nghttp2_check_header_value) || !CU_add_test(pSuite, "bufs_add", test_nghttp2_bufs_add) || + !CU_add_test(pSuite, "bufs_add_stack_buffer_overflow_bug", + test_nghttp2_bufs_add_stack_buffer_overflow_bug) || !CU_add_test(pSuite, "bufs_addb", test_nghttp2_bufs_addb) || !CU_add_test(pSuite, "bufs_orb", test_nghttp2_bufs_orb) || !CU_add_test(pSuite, "bufs_remove", test_nghttp2_bufs_remove) || diff --git a/tests/nghttp2_buf_test.c b/tests/nghttp2_buf_test.c index 01f31fcf..8860554f 100644 --- a/tests/nghttp2_buf_test.c +++ b/tests/nghttp2_buf_test.c @@ -63,6 +63,26 @@ void test_nghttp2_bufs_add(void) { nghttp2_bufs_free(&bufs); } +/* Test for GH-232, stack-buffer-overflow */ +void test_nghttp2_bufs_add_stack_buffer_overflow_bug(void) { + int rv; + nghttp2_bufs bufs; + uint8_t data[1024]; + nghttp2_mem *mem; + + mem = nghttp2_mem_default(); + + rv = nghttp2_bufs_init(&bufs, 100, 200, mem); + CU_ASSERT(0 == rv); + + rv = nghttp2_bufs_add(&bufs, data, sizeof(data)); + + CU_ASSERT(0 == rv); + CU_ASSERT(sizeof(data) == nghttp2_bufs_len(&bufs)); + + nghttp2_bufs_free(&bufs); +} + void test_nghttp2_bufs_addb(void) { int rv; nghttp2_bufs bufs; diff --git a/tests/nghttp2_buf_test.h b/tests/nghttp2_buf_test.h index 5da388e7..0b94a3f4 100644 --- a/tests/nghttp2_buf_test.h +++ b/tests/nghttp2_buf_test.h @@ -26,6 +26,7 @@ #define NGHTTP2_BUF_TEST_H void test_nghttp2_bufs_add(void); +void test_nghttp2_bufs_add_stack_buffer_overflow_bug(void); void test_nghttp2_bufs_addb(void); void test_nghttp2_bufs_orb(void); void test_nghttp2_bufs_remove(void); From 0479f833fcdfd5e88480cba2e97571ef19813ec0 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 15 May 2015 22:20:15 +0900 Subject: [PATCH 13/18] Revert "nghttpx: Remove last write/read fields for TLS" This reverts commit 585af938287d329333d9c755698fb25aa6471dab. --- src/shrpx_connection.cc | 46 ++++++++++++++++++++++++++++------------- src/shrpx_connection.h | 4 ++++ src/shrpx_ssl.cc | 2 -- 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/src/shrpx_connection.cc b/src/shrpx_connection.cc index 88ded529..30c2ec98 100644 --- a/src/shrpx_connection.cc +++ b/src/shrpx_connection.cc @@ -153,13 +153,21 @@ void Connection::update_tls_warmup_writelen(size_t n) { } ssize_t Connection::write_tls(const void *data, size_t len) { - // We set SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER, so we don't have to - // care about parameters after SSL_ERROR_WANT_READ or - // SSL_ERROR_WANT_WRITE. - len = std::min(len, wlimit.avail()); - len = std::min(len, get_tls_write_limit()); - if (len == 0) { - return 0; + // SSL_write requires the same arguments (buf pointer and its + // length) on SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. + // get_write_limit() may return smaller length than previously + // passed to SSL_write, which violates OpenSSL assumption. To avoid + // this, we keep last legnth passed to SSL_write to + // tls.last_writelen if SSL_write indicated I/O blocking. + if (tls.last_writelen == 0) { + len = std::min(len, wlimit.avail()); + len = std::min(len, get_tls_write_limit()); + if (len == 0) { + return 0; + } + } else { + len = tls.last_writelen; + tls.last_writelen = 0; } auto rv = SSL_write(tls.ssl, data, len); @@ -179,6 +187,7 @@ ssize_t Connection::write_tls(const void *data, size_t len) { } return SHRPX_ERR_NETWORK; case SSL_ERROR_WANT_WRITE: + tls.last_writelen = len; wlimit.startw(); ev_timer_again(loop, &wt); return 0; @@ -198,13 +207,21 @@ ssize_t Connection::write_tls(const void *data, size_t len) { } ssize_t Connection::read_tls(void *data, size_t len) { - // Although SSL_read manual says it requires the same arguments (buf - // pointer and its length) on SSL_ERROR_WANT_READ or - // SSL_ERROR_WANT_WRITE. But after reading OpenSSL source code, - // there is no such requirement. - len = std::min(len, rlimit.avail()); - if (len == 0) { - return 0; + // SSL_read requires the same arguments (buf pointer and its + // length) on SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. + // rlimit_.avail() or rlimit_.avail() may return different length + // than the length previously passed to SSL_read, which violates + // OpenSSL assumption. To avoid this, we keep last legnth passed + // to SSL_read to tls_last_readlen_ if SSL_read indicated I/O + // blocking. + if (tls.last_readlen == 0) { + len = std::min(len, rlimit.avail()); + if (len == 0) { + return 0; + } + } else { + len = tls.last_readlen; + tls.last_readlen = 0; } auto rv = SSL_read(tls.ssl, data, len); @@ -213,6 +230,7 @@ ssize_t Connection::read_tls(void *data, size_t len) { auto err = SSL_get_error(tls.ssl, rv); switch (err) { case SSL_ERROR_WANT_READ: + tls.last_readlen = len; return 0; case SSL_ERROR_WANT_WRITE: if (LOG_ENABLED(INFO)) { diff --git a/src/shrpx_connection.h b/src/shrpx_connection.h index 4e348412..055d32c3 100644 --- a/src/shrpx_connection.h +++ b/src/shrpx_connection.h @@ -42,6 +42,10 @@ struct TLSConnection { SSL *ssl; ev_tstamp last_write_time; size_t warmup_writelen; + // length passed to SSL_write and SSL_read last time. This is + // required since these functions require the exact same parameters + // on non-blocking I/O. + size_t last_writelen, last_readlen; bool initial_handshake_done; bool reneg_started; }; diff --git a/src/shrpx_ssl.cc b/src/shrpx_ssl.cc index b37ad26f..3d3687e5 100644 --- a/src/shrpx_ssl.cc +++ b/src/shrpx_ssl.cc @@ -396,7 +396,6 @@ SSL_CTX *create_ssl_context(const char *private_key_file, SSL_CTX_set_mode(ssl_ctx, SSL_MODE_AUTO_RETRY); SSL_CTX_set_mode(ssl_ctx, SSL_MODE_RELEASE_BUFFERS); - SSL_CTX_set_mode(ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); if (get_config()->private_key_passwd) { SSL_CTX_set_default_passwd_cb(ssl_ctx, ssl_pem_passwd_cb); SSL_CTX_set_default_passwd_cb_userdata(ssl_ctx, (void *)get_config()); @@ -505,7 +504,6 @@ SSL_CTX *create_ssl_client_context() { SSL_CTX_set_mode(ssl_ctx, SSL_MODE_AUTO_RETRY); SSL_CTX_set_mode(ssl_ctx, SSL_MODE_RELEASE_BUFFERS); - SSL_CTX_set_mode(ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); if (SSL_CTX_set_default_verify_paths(ssl_ctx) != 1) { LOG(WARN) << "Could not load system trusted ca certificates: " From 3572e7c6343cb85fc21f5667a7ed0902cf5305cf Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 15 May 2015 22:29:57 +0900 Subject: [PATCH 14/18] inflatehd: Fix crash if 'wire' value is not string Fixes GH-235 --- src/inflatehd.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/inflatehd.cc b/src/inflatehd.cc index 37077e85..98338bef 100644 --- a/src/inflatehd.cc +++ b/src/inflatehd.cc @@ -101,6 +101,11 @@ static int inflate_hd(json_t *obj, nghttp2_hd_inflater *inflater, int seq) { return -1; } + if (!json_is_string(wire)) { + fprintf(stderr, "'wire' value is not string at %d\n", seq); + return -1; + } + auto table_size = json_object_get(obj, "header_table_size"); if (table_size) { From e2c0a3e43b294715aad29528d975472071face40 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 15 May 2015 22:38:51 +0900 Subject: [PATCH 15/18] Retry finding jemalloc lib by je_malloc_stats_print Fixes GH-233 --- configure.ac | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index ba9749c7..675adeb4 100644 --- a/configure.ac +++ b/configure.ac @@ -362,9 +362,23 @@ if test "x${request_jemalloc}" != "xno"; then AC_SEARCH_LIBS([malloc_stats_print], [jemalloc], [have_jemalloc=yes], [], [$PTHREAD_LDFLAGS]) LIBS=$LIBS_OLD + + if test "x${have_jemalloc}" = "xyes"; then + jemalloc_libs=${ac_cv_search_malloc_stats_print} + else + # On Darwin, malloc_stats_print is je_malloc_stats_print + AC_SEARCH_LIBS([je_malloc_stats_print], [jemalloc], [have_jemalloc=yes], [], + [$PTHREAD_LDFLAGS]) + LIBS=$LIBS_OLD + + if test "x${have_jemalloc}" = "xyes"; then + jemalloc_libs=${ac_cv_search_je_malloc_stats_print} + fi + fi + if test "x${have_jemalloc}" = "xyes" && - test "x${ac_cv_search_malloc_stats_print}" != "xnone required"; then - JEMALLOC_LIBS=${ac_cv_search_malloc_stats_print} + test "x${jemalloc_libs}" != "xnone required"; then + JEMALLOC_LIBS=${jemalloc_libs} AC_SUBST([JEMALLOC_LIBS]) fi fi From 805f36d134dd0a9e7b83ab8172584a8f18fbafa5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 15 May 2015 22:59:00 +0900 Subject: [PATCH 16/18] Bump up version number to 0.7.15, LT revision to 13:4:8 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 675adeb4..ce1d551f 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ dnl Do not change user variables! dnl http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html AC_PREREQ(2.61) -AC_INIT([nghttp2], [0.7.15-DEV], [t-tujikawa@users.sourceforge.net]) +AC_INIT([nghttp2], [0.7.15], [t-tujikawa@users.sourceforge.net]) AC_USE_SYSTEM_EXTENSIONS LT_PREREQ([2.2.6]) @@ -48,7 +48,7 @@ AC_CONFIG_HEADERS([config.h]) dnl See versioning rule: dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html AC_SUBST(LT_CURRENT, 13) -AC_SUBST(LT_REVISION, 3) +AC_SUBST(LT_REVISION, 4) AC_SUBST(LT_AGE, 8) major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"` From 42ccea806c4f9d77dce6b20c1b729ba6e1a028c7 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 15 May 2015 23:01:19 +0900 Subject: [PATCH 17/18] Update man pages --- doc/h2load.1 | 2 +- doc/nghttp.1 | 2 +- doc/nghttpd.1 | 2 +- doc/nghttpx.1 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/h2load.1 b/doc/h2load.1 index e6acc547..2a86f58a 100644 --- a/doc/h2load.1 +++ b/doc/h2load.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "H2LOAD" "1" "May 13, 2015" "0.7.15-DEV" "nghttp2" +.TH "H2LOAD" "1" "May 15, 2015" "0.7.15" "nghttp2" .SH NAME h2load \- HTTP/2 benchmarking tool . diff --git a/doc/nghttp.1 b/doc/nghttp.1 index 1ec86b1e..4be668e6 100644 --- a/doc/nghttp.1 +++ b/doc/nghttp.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "NGHTTP" "1" "May 13, 2015" "0.7.15-DEV" "nghttp2" +.TH "NGHTTP" "1" "May 15, 2015" "0.7.15" "nghttp2" .SH NAME nghttp \- HTTP/2 experimental client . diff --git a/doc/nghttpd.1 b/doc/nghttpd.1 index 0da439b0..cb057ad4 100644 --- a/doc/nghttpd.1 +++ b/doc/nghttpd.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "NGHTTPD" "1" "May 13, 2015" "0.7.15-DEV" "nghttp2" +.TH "NGHTTPD" "1" "May 15, 2015" "0.7.15" "nghttp2" .SH NAME nghttpd \- HTTP/2 experimental server . diff --git a/doc/nghttpx.1 b/doc/nghttpx.1 index 34ae5be9..0fac2a86 100644 --- a/doc/nghttpx.1 +++ b/doc/nghttpx.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "NGHTTPX" "1" "May 13, 2015" "0.7.15-DEV" "nghttp2" +.TH "NGHTTPX" "1" "May 15, 2015" "0.7.15" "nghttp2" .SH NAME nghttpx \- HTTP/2 experimental proxy . From 92a20c76e6c9a4f457edc623bcad1384f6eaee5e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 15 May 2015 23:01:33 +0900 Subject: [PATCH 18/18] Update bash_completion --- doc/bash_completion/nghttpd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/bash_completion/nghttpd b/doc/bash_completion/nghttpd index 2115c410..6de3d267 100644 --- a/doc/bash_completion/nghttpd +++ b/doc/bash_completion/nghttpd @@ -8,7 +8,7 @@ _nghttpd() _get_comp_words_by_ref cur prev case $cur in -*) - COMPREPLY=( $( compgen -W '--error-gzip --push --header-table-size --trailer --htdocs --address --padding --verbose --version --help --hexdump --dh-param-file --daemon --verify-client --workers --no-tls --color --early-response --max-concurrent-streams ' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--error-gzip --push --header-table-size --trailer --htdocs --address --padding --verbose --version --help --hexdump --dh-param-file --daemon --verify-client --echo-upload --workers --no-tls --color --early-response --max-concurrent-streams ' -- "$cur" ) ) ;; *) _filedir