Commit Graph

1855 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa b64fc3ac49 nghttpd: Add --no-content-length option to omit content-length in response 2016-01-07 22:51:47 +09:00
Tatsuhiro Tsujikawa 027256d0b1 h2load: Distribute MAX_SAMPLES across workers 2016-01-07 22:41:37 +09:00
Tatsuhiro Tsujikawa 425c794f89 h2load: Rename MAX_STATS as MAX_SAMPLES 2016-01-07 22:21:39 +09:00
Tatsuhiro Tsujikawa acac5ec6ea h2load: Remove "auto" for -m option
Because http/1.1 support, default "auto" behaviour of -m option is not
desirable, since it is used as HTTP pipelining, and it is not used in
practice.
2016-01-06 23:16:53 +09:00
Tatsuhiro Tsujikawa 13bd566eb7 h2load: Remove RequestStat ctor 2016-01-06 23:10:46 +09:00
Tatsuhiro Tsujikawa a52920cec0 h2load: Perform Sampling for client as well 2016-01-06 23:03:37 +09:00
Tatsuhiro Tsujikawa 9cbb8174bb h2load: Refactor systematic sampling method 2016-01-06 22:43:09 +09:00
Tatsuhiro Tsujikawa 23ac0429be h2load: Show progress in rate mode 2016-01-06 00:04:14 +09:00
Tatsuhiro Tsujikawa 7ed26afe75 h2load: Delete Client when it finished 2016-01-06 00:04:14 +09:00
Tatsuhiro Tsujikawa 60bbb5cae0 h2load: Perform sampling for request timings to reduce memory consumption 2016-01-06 00:04:14 +09:00
Tatsuhiro Tsujikawa 2f50bc1b3c nghttpx: Take into account of trailers when applying max_header_fields 2016-01-05 16:47:44 +09:00
Tatsuhiro Tsujikawa 848f8fbe54 nghttpx: Don't apply max_header_fields and header_field_buffer limit to response
We modeled max_header_fields and header_field_buffer limit from Apache
configuration directives.  In Apache, they are only applied to request
header fields, while we applied both request and response.  Since
nghttpx is used as reverse proxy and backend server is relatively
"trusted", this commit removes the application to response header
fields.
2016-01-05 16:44:44 +09:00
Tatsuhiro Tsujikawa dd4d549dc1 asio: Rename http2::get_io_services() as http2::io_services()
The naming convention in asio lib does not use get_something.
2015-12-25 21:06:25 +09:00
Tatsuhiro Tsujikawa 486dba8d8a nghttpx: Strict validation for header fields given in configuration 2015-12-25 20:57:24 +09:00
ayanamist 5ec6066fdd header value should not be inp_strlower
http header keys are case-insensitive, but header values are case-sensitive, so it should not be changed.
2015-12-25 11:03:55 +08:00
Tatsuhiro Tsujikawa 8919c8c139 Check initgroups with AC_CHECK_DECLS for cygwin 2015-12-24 21:15:46 +09:00
Tatsuhiro Tsujikawa 5de2c7a8c1 Detect availability of initgroups 2015-12-23 14:21:31 +09:00
Tatsuhiro Tsujikawa 7c5ef0613d asio: Add configurable connect/read timeout for client
This commit includes backward incompatible change, since we change
private field in public API class.
2015-12-23 00:08:55 +09:00
Tatsuhiro Tsujikawa 1ee1122d40 asio: Add configurable tls handshake/read timeout to server 2015-12-23 00:08:16 +09:00
Tatsuhiro Tsujikawa 09bd9c94a3 asio: client: Should call shutdown_socket() on read error 2015-12-22 00:40:22 +09:00
Tatsuhiro Tsujikawa 6c1a76af6e asio: Use std::move for remote_endpoint assignment 2015-12-20 14:00:58 +09:00
Tatsuhiro Tsujikawa dd93b29397 clang-format 2015-12-20 12:48:39 +09:00
Tatsuhiro Tsujikawa e71948d611 Merge branch 'master' of https://github.com/apohl79/nghttp2 into apohl79-master 2015-12-19 23:33:33 +09:00
Tatsuhiro Tsujikawa 5a2d75551d h2load: Remove "(client)" from per-client req/s stat for simplicity 2015-12-19 22:56:10 +09:00
Andreas Pohl 9f2d064d7c libnghttp2_asio: Optimized remote endpoint interface to const ref where possible 2015-12-19 14:08:15 +01:00
Tatsuhiro Tsujikawa 2d2188e77b src: Add 451 status code
https://datatracker.ietf.org/doc/draft-ietf-httpbis-legally-restricted-status/
2015-12-19 18:35:01 +09:00
Andreas Pohl a30dad4f5e libnghttp2_asio: Added access to a requests remote endpoint 2015-12-16 18:38:21 +01:00
Tatsuhiro Tsujikawa ef7d6e8a0c nghttpx: Loose HTTP Upgrade condition 2015-12-16 00:38:30 +09:00
Tatsuhiro Tsujikawa 71012fe83a nghttpx: Add constexpr 2015-12-15 22:47:05 +09:00
Tatsuhiro Tsujikawa 248a64f0b2 Compile with OpenSSL 1.1.0-pre1 2015-12-14 21:12:25 +09:00
Andreas Pohl a4392d4a7f libnghttp2_asio: Make io_service accessors const 2015-12-09 23:11:40 +01:00
Andreas Pohl 924fef1f32 libnghttp2_asio: Added io_service accessors
To allow the asio wrapper to work with boost.fiber it is required
to access the underlying io_service objects.
2015-12-08 15:54:22 +01:00
Tatsuhiro Tsujikawa 7ca9ead36b nghttp: Update doc for default value of -M 2015-12-04 23:08:58 +09:00
Sunpoet Po-Chuan Hsieh 90b5a5856b Fix build when OpenSSL 1.0.2 is not available 2015-12-04 17:38:04 +08:00
Tatsuhiro Tsujikawa a151a44caf Set max number of outgoing concurrent streams to 100 by default
Instead of using nonsensical large value for max outgoing concurrent
streams, use more sensible value, 100.
2015-12-03 23:45:03 +09:00
Tatsuhiro Tsujikawa 6beaf4d9f3 h2load: Add req/s min, max, mean and sd for clients 2015-12-01 23:54:21 +09:00
Tatsuhiro Tsujikawa d1d1c83e56 h2load: Fix broken connection times 2015-12-01 22:29:30 +09:00
Tatsuhiro Tsujikawa cbad05e0de src: Fix compile error with gcc-4.7 2015-12-01 21:21:50 +09:00
Tatsuhiro Tsujikawa ba9e912cf6 src: Rename isAlpha, isDigit, and isHexDigit as is_... 2015-11-28 00:42:51 +09:00
Tatsuhiro Tsujikawa d867fe64e3 src: Rename endsWith as ends_with 2015-11-28 00:42:51 +09:00
Tatsuhiro Tsujikawa de247f7d33 src: Rename startsWith as starts_with 2015-11-28 00:42:51 +09:00
Tatsuhiro Tsujikawa 1ba28bef1f util: Remove unused functions; rename regacy camel-case function names 2015-11-28 00:42:51 +09:00
Tatsuhiro Tsujikawa c0858d8c1a src: Minor optimization for appending single character 2015-11-28 00:03:16 +09:00
Tatsuhiro Tsujikawa 863493766d Fix in_attr_char(); cleanup const char array iteration 2015-11-27 23:54:07 +09:00
Tatsuhiro Tsujikawa ba9e96b829 h2load: Avoid copy of h1 request 2015-11-26 22:04:31 +09:00
Tatsuhiro Tsujikawa bd041bcbb0 h2load: Add --h1 option to force http/1.1 for both http and https URI 2015-11-26 21:33:27 +09:00
Tatsuhiro Tsujikawa 8e06e37375 h2load: Fix crash when dealing connection: close with HTTP/1.1 server 2015-11-26 21:26:00 +09:00
Tatsuhiro Tsujikawa c44ee44cc3 nghttpd: Fix compile error due to incomplete FileEntry 2015-11-23 21:25:12 +09:00
Tatsuhiro Tsujikawa 84e23bff10 h2load: clang-format 2015-11-23 20:05:40 +09:00
Kit Chan 718f7a5f7e h2load goes into infinite loop when timing script file starts with 0.0 in first line 2015-11-23 09:58:38 +00:00
Tatsuhiro Tsujikawa dff2a19950 nghttpx: Don't send RST_STREAM to h2 backend if backend is disconnected state
This avoid establishing HTTP/2 backend connection again w/o pending
request.

See GH-431
2015-11-22 15:49:11 +09:00
Tatsuhiro Tsujikawa c7304317d4 nghttpd: Check validity of cached file descriptor periodically
This commit adds ability to check status of cached file descriptor to
make sure that it can be reused.  We inspect last modification time
and number of hard links.  If last modification is changed from the
last validation time, or number of hard links gets 0, we don't reuse
file descriptor.  We also capped upper limit of the cached file
descriptors.  If the limit is reached, we will close file descriptor
which is least recently used, and its usecount is 0.
2015-11-21 16:05:08 +09:00
Tatsuhiro Tsujikawa 63aa3466e9 nghttpd: Fix crash with CONNECT request 2015-11-21 12:54:04 +09:00
Tatsuhiro Tsujikawa ab1e8305a1 asio: client: call on_error when connection is dropped
When connection is dropped, we get "nonzero" error code ec in
read_socket callback.  We can just call on_error callback if ec is
nonzero.  But there is a problem when we did ordered shutdown.  In
this case, we also get EOF in ec, but we don't want to call on_error
because it is not an error.  To workaround this, we check return value
of should_stop().  If it is true, then we assume that HTTP/2 session
cleanly ended, and we don't call on_error.
2015-11-19 00:04:10 +09:00
Tatsuhiro Tsujikawa 8b4f6f1778 nghttpd: Defered eviction of cached fd using timer
To make use cache fd more robust manner (e.g. among several
connections), eviction of cached file descriptor now takes place using
timer.  The timer is started when there is no handler (no
connections).  The timeout value is hard-coded and 2 seconds.
2015-11-18 23:21:57 +09:00
Tatsuhiro Tsujikawa 8c94341c18 h2load: Override user-agent with -H option
This commit allows user to override user-agent with -H option.  We
also enabled custom header support for http/1.1 requests.  We also did
minor optimizations (std::vector::reserve).
2015-11-18 22:25:02 +09:00
Tatsuhiro Tsujikawa 1753bea692 nghttpx: Support server push from HTTP/2 backend
This commits enables HTTP/2 server push from HTTP/2 backend to be
relayed to HTTP/2 frontend.  To use this feature, --http2-bridge or
--client is required.  Server push via Link header field contiues to
work.
2015-11-16 23:12:25 +09:00
Tatsuhiro Tsujikawa c3459c9e86 nghttpx: Clarify return value of nghttp2_submit_push_promise is stream ID 2015-11-16 21:44:36 +09:00
Tatsuhiro Tsujikawa fe8720341d nghttpx: Fix crash on non-final response from backend server 2015-11-13 23:59:36 +09:00
Tatsuhiro Tsujikawa c6ef1c02b9 Switch to clang-format-3.6 2015-11-13 00:53:29 +09:00
Tatsuhiro Tsujikawa c711a80411 src: Fix typo
Apply typo fixes to the original source files in the previous commit
which were done in generated text.
2015-11-09 21:43:25 +09:00
Tatsuhiro Tsujikawa dbbed64146 nghttpx: Fix bug that causes connection failure with backend proxy URI
This is a regression when we introduced SSL/TLS session resumption in
HTTP/2 backend.  Before the introduction of session resumption,
conn_.tls.ssl is always nullptr when connection is made to proxy.  But
we have to keep conn_.tls.ssl to enable session resumption, so our
code breaks when it is reused.  This commit fixes this issue.

See GH-421
2015-11-09 21:35:53 +09:00
Tatsuhiro Tsujikawa 9b18e47671 nghttpx: Use --backend-tls-sni-field to verify certificate hostname 2015-11-08 00:22:44 +09:00
Tatsuhiro Tsujikawa b89f1f5869 asio: ALPN support 2015-11-07 22:53:25 +09:00
Tatsuhiro Tsujikawa eaefce3792 nghttp: Record request method to output it in har correctly 2015-11-07 16:13:06 +09:00
Tatsuhiro Tsujikawa 558934cee5 src: Use nghttp2_session_upgrade2 2015-11-07 16:13:06 +09:00
Tatsuhiro Tsujikawa 6958d0b55d nghttp: Use method given in -H with ":method" in HTTP Upgrade 2015-11-07 11:14:28 +09:00
Tatsuhiro Tsujikawa 7755c2827c nghttpx: Reserve headers vector 2015-11-05 23:47:22 +09:00
Tatsuhiro Tsujikawa ac41946533 nghttpx: Use NGHTTP2_NV_FLAG_NO_COPY_NAME and NGHTTP2_NV_FLAG_NO_COPY_VALUE
For both HTTP/2 frontend and backend.

Also adds http2::stringify_status to optimize status code
serialization.
2015-11-05 23:47:11 +09:00
Tatsuhiro Tsujikawa cb73fa1d3b h2load: Return SSL_TLSEXT_ERR_NOACK if there is protocol list overlap in NPN 2015-11-05 21:26:38 +09:00
Tatsuhiro Tsujikawa 0dc7fee713 h2load: Print "space savings" to measure header compression efficiency 2015-11-04 01:04:56 +09:00
Tatsuhiro Tsujikawa be0d0e2995 Rename nghttp2_session_request_allowed as nghttp2_session_check_request_allowed 2015-10-30 22:48:27 +09:00
Tatsuhiro Tsujikawa 1e7f0d833e nghttpd: Don't show read error if mime types file is not set by user manually 2015-10-29 23:08:52 +09:00
Tatsuhiro Tsujikawa 1c37abc0dd Add nghttp2_session_request_allowed() API function
This function is useful for the client application to know that there
is a chance that request can be sent.  If this function returns 0,
there is zero chance to make a request.

This commit also set error_code passed to
nghttp2_on_stream_close_callback to NGHTTP2_REFUSED_STREAM if request
is not sent.
2015-10-29 22:53:30 +09:00
Tatsuhiro Tsujikawa ad395f0603 h2load: Handle request submission failure
If request submission is failed, make all remaining requests for that
client fail.
2015-10-29 22:31:03 +09:00
Tatsuhiro Tsujikawa e3878b619f h2load: Update doc 2015-10-29 21:16:47 +09:00
Tatsuhiro Tsujikawa 3641b123f3 h2load: Stream error should be counted toward `errored` 2015-10-29 21:15:22 +09:00
Tatsuhiro Tsujikawa f29ccc9c20 nghttpd: Read /etc/mime.types to set content-type header field
User can change file name using --mime-types-file option.
2015-10-29 00:21:36 +09:00
Tatsuhiro Tsujikawa ecb4a208fb nghttpx: Use ev_feed_event to signal write for HTTP backend
It seems that using ev_feed_event to signal write operation is much
faster than starting watcher.  This is probably due to the fact that
we don't need to wait in event loop.  The same thing cannot be done in
HTTP/2 frontend, since this will raise write operation for each stream
HEADER/DATA write, which leads to very small packets, hurting
performance.  Interestingly, HTTP/1 frontend also suffers the same
performance hit.
2015-10-28 23:26:41 +09:00
Tatsuhiro Tsujikawa d9f73c36c3 nghttpx: Log :authority as $http_host if available 2015-10-28 23:12:16 +09:00
Lucas Pardue 76df93fdf4 h2load: do not overwrite protocol value 2015-10-28 11:04:09 +00:00
Tatsuhiro Tsujikawa 1aa8e8cd9f nghttpx: Simplify add_header 2015-10-28 02:57:31 +09:00
Tatsuhiro Tsujikawa b051ddec2a h2load: Show application protocol with OpenSSL < 1.0.2
This commit also fixes the problem that application protocol is not
shown if cleartext spdy is used.
2015-10-28 02:40:04 +09:00
Tatsuhiro Tsujikawa 6b0bde6c31 Update doc so that we can use hyperlink to referred options 2015-10-25 17:10:41 +09:00
Tatsuhiro Tsujikawa 9231a4ba57 nghttpx: Replace old script file options with --mruby-file 2015-10-25 17:05:15 +09:00
Tatsuhiro Tsujikawa 0b2c139eaa clang-format-3.5 2015-10-25 17:04:54 +09:00
Tatsuhiro Tsujikawa b832caccd4 Fix typo 2015-10-25 11:31:55 +09:00
Tatsuhiro Tsujikawa 907798707c nghttpx: Fix compile error with Android NDK 2015-10-24 19:31:09 +09:00
Tatsuhiro Tsujikawa d1b8f60776 nghttp: Allow multiple -c option occurrence, and take min and last value 2015-10-24 18:11:47 +09:00
Tatsuhiro Tsujikawa 7eddf1975e src: Fix Memchunks move ctor 2015-10-23 01:03:43 +09:00
Tatsuhiro Tsujikawa d3475f5fe2 nghttp: Remove redundant std::move 2015-10-23 00:17:00 +09:00
Tatsuhiro Tsujikawa ce74a30990 Use -fvisibility=hidden for internal functions
This will improve performance since we can avoid indirect call of
internal functions.  The downside is we now require libnghttp2 static
library to run unit tests.
2015-10-23 00:08:15 +09:00
Tatsuhiro Tsujikawa fad1def7b9 Merge branch 'nghttpx-tls-dyn-rec-config' of https://github.com/LPardue/nghttp2 into LPardue-nghttpx-tls-dyn-rec-config 2015-10-22 23:50:07 +09:00
Lucas Pardue dcc9aaaa24 Add TLS dynamic record size behaviour command line options 2015-10-22 14:07:18 +00:00
Tatsuhiro Tsujikawa 20ac0e3e48 src: Print out exception type 2015-10-22 01:34:01 +09:00
Tatsuhiro Tsujikawa e3c95265a4 nghttpd: Fix leak when server failed to listen to given port 2015-10-21 22:27:15 +09:00
Tatsuhiro Tsujikawa f0bf2233d2 Remove the word "experimental" since HTTP/2 has been finalized 2015-10-20 00:19:49 +09:00
Tatsuhiro Tsujikawa 48edbc8687 nghttpx: Reduce default timeouts for read sockets to 1m 2015-10-18 00:15:58 +09:00
Tatsuhiro Tsujikawa b9a9e3a596 src: s/custom/unknown/ 2015-10-18 00:10:08 +09:00
Tatsuhiro Tsujikawa eff3dfd50b src: Move exception handling code to one function 2015-10-17 23:34:05 +09:00