Commit Graph

1125 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa 8dd8d68b83 src: Make index of header int16_t 2015-02-08 16:10:01 +09:00
Tatsuhiro Tsujikawa c55d7343ca nghttpx: Support server push using Link header field
nghttpx server push is initiated by looking for Link header field from
backend server response.  Currently we only enable server push for
HTTP/1 backend and without HTTP/2 proxy mode.  The URIs which have
rel=preload are eligible to resource to be pushed.
2015-02-08 16:10:00 +09:00
Tatsuhiro Tsujikawa 4dea318b5b nghttpx: Fix compile error if SOCK_NONBLOCK is undefined 2015-02-08 00:49:56 +09:00
Tatsuhiro Tsujikawa 795a22a320 src: Remove ringbuf.h, use buffer.h instead 2015-02-06 23:40:34 +09:00
Tatsuhiro Tsujikawa b4b2ddad3b src: Rewrite defer function template 2015-02-06 23:27:15 +09:00
Tatsuhiro Tsujikawa 6ff67ae869 src: Move array_size to nghttp2 namespace 2015-02-06 22:44:09 +09:00
Tatsuhiro Tsujikawa 33879219ff Refactor ALPN/NPN protocol selection and introduce NGHTTP2_PROTO_ALPN macro 2015-02-06 22:35:30 +09:00
Tatsuhiro Tsujikawa 4956bdc4da src: Use std::copy_n 2015-02-06 21:35:03 +09:00
Tatsuhiro Tsujikawa b165775811 nghttpx: Refactor CertLookupTree 2015-02-06 21:25:43 +09:00
Tatsuhiro Tsujikawa 90746cdd0e nghttpx: Fix compile error with OpenSSL 1.0.2 2015-02-06 21:14:04 +09:00
Tatsuhiro Tsujikawa 4cda09beff src: Prefer std::array 2015-02-06 00:15:43 +09:00
Tatsuhiro Tsujikawa 9a2d36fc6c src: Use std::copy instead of std::copy_n since gcc-4.7 does not have it 2015-02-06 00:15:43 +09:00
Tatsuhiro Tsujikawa ab6663c785 src: Use std::array instead of std::vector if size is compile time constant 2015-02-06 00:15:43 +09:00
Tatsuhiro Tsujikawa 54851ef7a6 src: Move make_unique to nghttp2 namespace 2015-02-06 00:15:43 +09:00
Tatsuhiro Tsujikawa f8f9b36acd http2: Use std::array for indexing headers 2015-02-06 00:15:43 +09:00
Tatsuhiro Tsujikawa 6774fa6e07 buffer: Refactor 2015-02-06 00:15:43 +09:00
Tatsuhiro Tsujikawa 7baf6f781e memchunk: Refactor 2015-02-06 00:15:42 +09:00
Tatsuhiro Tsujikawa 2349a03882 nghttpx: Fix regression HTTP/2 upgrade does not work 2015-02-06 00:15:13 +09:00
Tatsuhiro Tsujikawa 3904550d5d nghttpd: Shut up travis 2015-02-05 22:49:19 +09:00
Tatsuhiro Tsujikawa be3ee91e90 nghttpd: Fix compile error on travis 2015-02-05 21:50:20 +09:00
Tatsuhiro Tsujikawa d4f87ce29f nghttpd: Fix multiple push configuration does not work 2015-02-05 21:31:16 +09:00
Tatsuhiro Tsujikawa 1216d7d912 nghttpx: Connection: Explicit assignment to double field 2015-02-05 21:26:55 +09:00
Tatsuhiro Tsujikawa f3b247e4c8 nghttpx: Add missing rev start in HTTP/2 backend 2015-02-05 03:05:34 +09:00
Tatsuhiro Tsujikawa 7c75d9db98 nghttpx: Set nghttp2_option_set_peer_max_concurrent_streams for HTTP/2 backend 2015-02-05 03:05:34 +09:00
Tatsuhiro Tsujikawa b2fb888363 Share I/O code with all upstreams/downstream objects 2015-02-05 03:05:34 +09:00
Tatsuhiro Tsujikawa a4d729d36b nghttpx: Return HTTP error on downstream parser failure on HTTPS upstream 2015-02-04 21:30:05 +09:00
Tatsuhiro Tsujikawa a68c4c1e3c nghttpx: Add --no-host-rewrite option 2015-02-04 01:42:26 +09:00
Tatsuhiro Tsujikawa 82f90f9030 nghttpx: Rewrite :authority and host header field
We don't rewrite them if -s or -p is used
2015-02-04 01:42:19 +09:00
Tatsuhiro Tsujikawa b707cfe986 nghttpx: Fix busy loop when HTTP/2 backend reset after connection established
We have now Downstream retry count to be limited to 5 times.  At 6th
failure, we send 503 message to client.
2015-02-03 01:47:04 +09:00
Tatsuhiro Tsujikawa d37fc8f3a6 src: Fix compiler warning 2015-02-02 22:40:41 +09:00
Tatsuhiro Tsujikawa 9f5f724147 nghttpd, nghttpx: Don't log error NGHTTP2_ERR_BAD_PREFACE 2015-02-02 00:20:44 +09:00
Tatsuhiro Tsujikawa 36e216d24a src: Delete unused source files 2015-02-01 18:12:57 +09:00
Tatsuhiro Tsujikawa cabb7c73cd nghttp: Widen column for complete and request to account for + 2015-02-01 18:07:53 +09:00
Tatsuhiro Tsujikawa 3a37ed97f4 nghttp: Rewrite statistics output with -s option
Now timing information (completion, request, processing), status code
and request path are listed in the order by completion time.  This
ordering is very convenient to check resource prioritization
validation.
2015-02-01 17:59:49 +09:00
Tatsuhiro Tsujikawa 0f14c93fa4 nghttp: Refactor 2015-02-01 17:21:13 +09:00
Tatsuhiro Tsujikawa f321ee5a61 nghttp: Record request time just before transmission of request 2015-02-01 16:58:58 +09:00
Tatsuhiro Tsujikawa 17de036d85 h2load: Code cleanup 2015-01-31 23:54:03 +09:00
Tatsuhiro Tsujikawa a91e0de06c h2load: Add request stats (time for request min, max, mean and sd) 2015-01-31 23:49:30 +09:00
Tatsuhiro Tsujikawa f1049a66e2 nghttpx: Detach DownstreamConnection early 2015-01-31 01:11:55 +09:00
Tatsuhiro Tsujikawa 5a497b9f30 nghttpx: Update doc 2015-01-30 21:33:18 +09:00
Tatsuhiro Tsujikawa b4ad0a30af Fix typo 2015-01-30 21:32:41 +09:00
Tatsuhiro Tsujikawa 1816738b3c nghttpx: Change frontend write buffer size to 32768 2015-01-30 21:32:21 +09:00
Tatsuhiro Tsujikawa 0a0618baac nghttpx: Add test for util::duration_str, rename util::parse_duration_with_unit 2015-01-29 23:28:47 +09:00
Tatsuhiro Tsujikawa e03f36eeeb nghttpx: Use <DURATION> instead of <T> 2015-01-29 23:23:30 +09:00
Tatsuhiro Tsujikawa 6b1ef95d3f nghttpx: Replace RingBuf with sequential Buffer
It turns out that we don't need circular buffer functionality.  We
replaced RingBuf with simple sequential Buffer.
2015-01-29 22:57:56 +09:00
Tatsuhiro Tsujikawa 147bc45658 nghttpx: Refactor memchunk a bit 2015-01-29 21:18:30 +09:00
Tatsuhiro Tsujikawa 00555dc7bb nghttpx: Use TCP_DEFER_ACCEPT if available 2015-01-29 21:14:44 +09:00
Tatsuhiro Tsujikawa d1a4002b22 nghttpx: Remove --accept-delay and --num-accept options 2015-01-29 20:58:47 +09:00
Tatsuhiro Tsujikawa 8ddad1a53d nghttpx: Remove shrinking memchunks for now
It requires more careful optimization.  Remove it for now.
2015-01-28 21:25:22 +09:00
Tatsuhiro Tsujikawa 96e66b1a81 nghttpx: Make num_accept 0 on graceful shutdown
Make num_accept unlimited so that we can accept all pending
connections waiting in listen queue.
2015-01-28 21:02:31 +09:00
Tatsuhiro Tsujikawa 19429abd07 nghttpx: Make --accept-delay default to 10ms 2015-01-28 21:00:47 +09:00
Fabian Möller 3167aa4081 nghttpx: set the supplementary group access list 2015-01-28 20:56:05 +09:00
Tatsuhiro Tsujikawa 93daa98608 src: Make option suggestion work with unknown option followed by '=' 2015-01-28 00:58:42 +09:00
Tatsuhiro Tsujikawa f8765be817 nghttpx: Make --backend-keep-alive-timeout default to 2s 2015-01-28 00:47:09 +09:00
Tatsuhiro Tsujikawa f0c7839f25 nghttpx: Clarify --num-accept=0 case 2015-01-28 00:39:56 +09:00
Tatsuhiro Tsujikawa 6a39de0ae5 nghttpx: Accept s or ms as unit for <T> argument 2015-01-28 00:36:44 +09:00
Tatsuhiro Tsujikawa 402ebb277f nghttpx: Add --num-accept and --accept-delay options 2015-01-27 23:47:56 +09:00
Tatsuhiro Tsujikawa 4e68ca8233 integration: Add tests about via header field manipulation
This test reveals bug in SPDY upstream code, and contains its fix.
2015-01-27 00:19:57 +09:00
Tatsuhiro Tsujikawa b99b83812b nghttpd: RST_STREAM if te header field contains value other than trailers 2015-01-25 22:58:43 +09:00
Tatsuhiro Tsujikawa 0b48448270 nghttpx: RST_STREAM for invalid request header values 2015-01-25 22:58:43 +09:00
Tatsuhiro Tsujikawa 2a56a3d9ea nghttpx: Fix te request header handling
Checking against "trailers" is enough for now.
2015-01-25 22:58:43 +09:00
Tatsuhiro Tsujikawa b9c6162cd5 nghttp: Use compatible cipher list 2015-01-25 17:53:17 +09:00
Tatsuhiro Tsujikawa 68510f1282 nghttpx: SpdyUpstream: Handle error from error_reply 2015-01-25 15:37:09 +09:00
Tatsuhiro Tsujikawa 4b58b25c19 nghttpx: Refactor code to build cert_tree, add SNI test 2015-01-25 15:36:14 +09:00
Tatsuhiro Tsujikawa fbd9bcb00e Use _LDADD to specify libraries instead of _LDFLAGS
This is because _LDFLAGS comes before _LDADD.  If we specify a library
and another library in _LDADD depends on it, we get undefined
reference error.
2015-01-25 00:58:30 +09:00
Tatsuhiro Tsujikawa 434e80dc7b nghttpx: Reset stream if TE header field contains other than trailer 2015-01-24 15:31:59 +09:00
Tatsuhiro Tsujikawa 6b4b7bef23 nghttpx: Reset stream if request header field name is malformed 2015-01-24 00:37:26 +09:00
Tatsuhiro Tsujikawa 9a89db575a nghttpx: Reject multiple Content-Length even if their values are identical 2015-01-24 00:07:28 +09:00
Tatsuhiro Tsujikawa 0f4b0966ef nghttpx: Merge all options settings in one SSL_CTX_set_options 2015-01-23 23:32:01 +09:00
Tatsuhiro Tsujikawa ecfd593076 nghttpx: Call ConnectBlocker::on_success when connection is established 2015-01-23 23:00:18 +09:00
acesso 7ea8037ee1 Use fcntl and FD_CLOEXEC if O_CLOEXEC is undefined
Same reported at #87 but at src/shrpx_config.cc src/instead of util.cc
2015-01-23 21:17:06 +09:00
Tatsuhiro Tsujikawa a0028ea8ef nghttpx: Add logging when downstream connect is blocked by connect_blocker 2015-01-23 00:15:38 +09:00
Tatsuhiro Tsujikawa d174ffeb00 memchunk: Rename append_cstr as append
We may later add append(const T &), where we require T for .size() and
.data().  We can coexist former append_cstr and new one.  If we pass
string literal, append(const (&)[N]) is selected.
2015-01-22 23:54:30 +09:00
Tatsuhiro Tsujikawa 5a93bedf72 nghttpx: Make error page modern 2015-01-22 23:51:22 +09:00
Tatsuhiro Tsujikawa 4a0dba08b9 nghttpx: Set Connection: close after graceful shutdown in HTTP/1 upstream 2015-01-22 23:46:35 +09:00
Tatsuhiro Tsujikawa b685747643 Add nghttp2_submit_shutdown_notice() to start graceful shutdown
nghttp2_submit_shutdown_notice() is used to notify the client that
graceful shutdown is started.  We expect that after this call, the
server application should send another GOAWAY using
nghttp2_submit_goaway() with appropriate last_stream_id.  In this
commit, we also added nghttp2_session_get_last_proc_stream_id(), which
can be used as last_stream_id parameter.

This commit implements graceful shutdown in nghttpx.  The integration
test for graceful shutdown is also added.
2015-01-22 23:21:58 +09:00
Tatsuhiro Tsujikawa 76a97b9718 nghttpx: Update last_write_time_ after SSL_write
SSL_write may return error indicating blocking until all given data
are written.  Because of this, it is preferable to update
last_write_time_ after SSL_write regardless of its return value.
2015-01-22 21:14:16 +09:00
Tatsuhiro Tsujikawa ac1cc56fbb nghttpx: Stop wev_ on h1 backend connect failure 2015-01-22 21:13:34 +09:00
Tatsuhiro Tsujikawa f604cbae70 nghttpx: Fix shutdown too early with QUIT signal if num_worker == 1 2015-01-22 01:46:25 +09:00
Tatsuhiro Tsujikawa 91ae5291cc nghttpx: Cache string representation of time for logging 2015-01-21 23:52:30 +09:00
Tatsuhiro Tsujikawa 5770c6bd04 nghttpx: Return 503 on hard disconnect in HTTP/2 backend 2015-01-21 23:30:48 +09:00
Tatsuhiro Tsujikawa 7492f628aa nghttpx: Use ConnectBlocker on h1 backend connect attempt failure 2015-01-21 23:11:47 +09:00
Tatsuhiro Tsujikawa 2f788aa214 nghttpx: Return 503 when h1 backend connect attempt failed 2015-01-21 23:08:13 +09:00
Tatsuhiro Tsujikawa cee22df073 nghttpx: Always close connection in HttpsUpstream::error_reply 2015-01-21 23:03:39 +09:00
Tatsuhiro Tsujikawa e219d6a94f nghttpx: Clarify error_reply upstream method
There is no application level failure in h1 upstream.  For h2, SPDY
upstreams, don't call DIE(), instead return -1 to delete handler.
2015-01-21 22:55:00 +09:00
Tatsuhiro Tsujikawa 41e72064e0 nghttpx: Log error in INFO level when frame cannot be sent 2015-01-21 22:49:00 +09:00
Tatsuhiro Tsujikawa c0fc726955 nghttpx: Call signal_write in HttpsUpstream::on_downstream_abort_request 2015-01-21 22:45:52 +09:00
Tatsuhiro Tsujikawa 041d9863c2 nghttpx: Set request_start_time_ at Downstream ctor
.. so that we can avoid the problem that request_start_time_ is 0
2015-01-21 22:28:15 +09:00
Tatsuhiro Tsujikawa 3c5ca63b6f nghttpx: Fix TLS write limit does not work 2015-01-21 21:47:25 +09:00
Tatsuhiro Tsujikawa 53a41c953d nghttpx: Don't call ev_TYPE_set macro while watcher is active 2015-01-21 21:43:49 +09:00
Tatsuhiro Tsujikawa 9938a4e952 Remove AM_EXTRA_RECURSIVE_TARGETS since travis automake is too old 2015-01-21 02:07:16 +09:00
Tatsuhiro Tsujikawa 8997e4369d nghttpx: Adjust backend buffers 2015-01-21 01:47:43 +09:00
Tatsuhiro Tsujikawa 5a6d6ccbd4 nghttpx: Read from backend eagerly in all upstreams 2015-01-21 01:41:17 +09:00
Tatsuhiro Tsujikawa 16e91746d9 nghttpx: Return 400 error if multiple CLs are received in SPDY upstream
This change adds SPDY upstream tests.
2015-01-21 01:03:56 +09:00
Tatsuhiro Tsujikawa b9a9a23b1e nghttpx: Close connection when error_reply is used for HTTP/1 upstream 2015-01-20 23:37:00 +09:00
Tatsuhiro Tsujikawa 8059380fb0 nghttpx: Don't need to set response state to MSG_COMPLETE after error_reply 2015-01-20 23:33:45 +09:00
Tatsuhiro Tsujikawa b9f41e34ef nghttpx: Return error when downstream HTTP/1 connection attempt failed 2015-01-20 23:27:30 +09:00
Tatsuhiro Tsujikawa ca7288ae38 nghttpx: Return 502 if HTTP/1 downstream receives multiple CLs 2015-01-20 23:11:54 +09:00
Tatsuhiro Tsujikawa f1bec6f05c nghttpx: Return 400 for multiple CLs for HTTP/1 upstream 2015-01-20 22:55:01 +09:00
Tatsuhiro Tsujikawa daec7c16d3 nghttpx: Don't discard data on HTTP/1 backend EOF
Also HTTP/1 frontend testing method was added.
2015-01-20 22:19:28 +09:00