Commit Graph

278 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa d22573086f nghttpx: Add x-http2-push header field for pushed resource
Fixes GH-352
2015-09-14 00:28:19 +09:00
Tatsuhiro Tsujikawa 1148584526 nghttpx: Reserve room for required header fields for PUSH_PROMISE 2015-09-14 00:26:50 +09:00
Tatsuhiro Tsujikawa 57aee184ca Update doc 2015-09-12 18:33:07 +09:00
Tatsuhiro Tsujikawa 3ce1c1d39f nghttpx: Add date header field to error_reply and send_reply 2015-09-07 23:11:23 +09:00
Tatsuhiro Tsujikawa 1b63e6d478 nghttpx: Call request phase hook for pushed resource as well 2015-09-06 15:21:36 +09:00
Tatsuhiro Tsujikawa 28defbfb4a nghttpx: Allow link header server push for HTTP/2 backend as well 2015-09-06 15:12:20 +09:00
Tatsuhiro Tsujikawa 1df682140c nghttpx: Don't do mruby push with --no-server-push option 2015-09-06 00:06:48 +09:00
Tatsuhiro Tsujikawa ef1595672c nghttpx: Add Request#push in mruby scripting
Refactor Http2Upstream so that we can share code between link header
field based push and mruby push.
2015-09-06 00:05:07 +09:00
Tatsuhiro Tsujikawa 77958eab46 Merge branch 'master' into nghttpx-mruby 2015-09-05 19:04:04 +09:00
Tatsuhiro Tsujikawa 8f41accf41 nghttpx: Don't initiate push if client disabled push 2015-09-05 19:02:55 +09:00
Tatsuhiro Tsujikawa e19d5efced nghttpx: Allow absolute URI in Link header field for push 2015-09-05 19:01:02 +09:00
Tatsuhiro Tsujikawa a9338f1c0e nghttpx: Fix hang when error page is sent on response phase hook error 2015-09-04 22:34:40 +09:00
Tatsuhiro Tsujikawa 9e685a2734 nghttpx: Various test failures 2015-09-04 02:47:25 +09:00
Tatsuhiro Tsujikawa d044c58558 nghttpx: Detect mruby presence and guard mruby related code with ifdef 2015-09-04 00:54:41 +09:00
Tatsuhiro Tsujikawa 200217d8ea nghttpx: Store empty string to path for server-wide OPTIONS request
This change is required to show path attribute to mruby script.  It is
desirable to construct URI from parts.  Just checking method and path
is "*" is awkward.
2015-09-04 00:14:09 +09:00
Tatsuhiro Tsujikawa 02bb2c3e83 nghttpx: Create authority from host or authority-form for CONNECT request 2015-09-03 23:36:49 +09:00
Tatsuhiro Tsujikawa 65f2b16132 nghttpx: More freedom for custom response headers 2015-09-03 22:29:16 +09:00
Tatsuhiro Tsujikawa baadec5ef4 nghttpx: Add response mruby hook 2015-09-03 01:33:52 +09:00
Tatsuhiro Tsujikawa e06af02573 nghttpx: Add Response mruby object 2015-09-03 00:40:14 +09:00
Tatsuhiro Tsujikawa e436caf0bb nghttpx: Don't forward request if response was commited in mruby hook 2015-09-02 23:22:26 +09:00
Tatsuhiro Tsujikawa 1508c50a45 nghttpx: Add basic infrastructure for mruby support 2015-09-02 02:45:15 +09:00
Tatsuhiro Tsujikawa 0bbff5b738 nghttpx: Continue if push was failed 2015-07-31 21:25:43 +09:00
Tatsuhiro Tsujikawa 44cbc785fc nghttpx: Don't reuse backend connection if it is not clean 2015-07-22 21:41:16 +09:00
Tatsuhiro Tsujikawa 5dc060c1a2 src: Use C++11 value-initialization, instead of memset-ing 0 2015-07-19 17:55:37 +09:00
Tatsuhiro Tsujikawa ba31b990a2 nghttpx: Remove dead handling of Downstream::STREAM_CLOSED 2015-07-15 23:33:44 +09:00
Tatsuhiro Tsujikawa 6307f96fb3 nghttpx: Enable host-path backend routing in HTTP/2 backend
To achieve host-path backend routing, we changed behaviour of
--backend-http2-connections-per-worker.  It now sets the number of
HTTP/2 physical connections per pattern group if pattern is used in -b
option.

Fixes GH-292
2015-07-12 23:02:30 +09:00
Tatsuhiro Tsujikawa fa7069a273 nghttpx: Don't rewrite path if http2 proxy or client proxy is enabled
There are many requests which changes its meaning when we rewrite
path.  This is due to bad percent-encoding in URI; reserved characters
are just used without percent encoding.  It seems this is common in ad
services, but I suspect more to come.  For reverse proxying situation,
sane service most likely encodes URI properly, so probably this is not
an issue.
2015-07-11 17:50:58 +09:00
Tatsuhiro Tsujikawa 19e47a1922 nghttpx: Normalize path when setting it to Downstream 2015-07-11 16:12:35 +09:00
Tatsuhiro Tsujikawa 3119fc259c Select backend based on request host and path by extending -b option
-b option syntax is now <HOST>,<PORT>[;<PATTERN>[:...]].  The optional
<PATTERN>s specify the request host and path it is used for.  The
<PATTERN> can contain path, host + path or host.  The matching rule is
closely designed to ServeMux in Go programming language.
2015-07-11 00:15:52 +09:00
Tatsuhiro Tsujikawa 41dd5f6897 nghttpx: Tokenize request method
We share the same method value with http-parser.  This commit also
returns 501 for unknown request method on HTTP/2 and SPDY frontend.
2015-06-09 23:33:14 +09:00
Tatsuhiro Tsujikawa 9a0b9428da nghttpx: Fill request scheme in upstream
We may log before filling scheme in Downstream, so we leave
construct_absolute_request_uri as is.
2015-05-22 02:22:59 +09:00
Tatsuhiro Tsujikawa 890a10b216 nghttpx: Fix bug that PUSH_PROMISE is sent after associated response HEADERS 2015-05-22 00:53:02 +09:00
Tatsuhiro Tsujikawa e63d6e490a Merge branch 'master' into v1.0.0
Conflicts:
	lib/nghttp2_option.h
	lib/nghttp2_session.h
	src/HttpServer.cc
2015-05-08 19:21:51 +09:00
Tatsuhiro Tsujikawa 552f675466 nghttpx: Add --header-field-buffer and --max-header-fields options 2015-04-29 21:10:59 +09:00
Tatsuhiro Tsujikawa 5937b4b6f7 Merge branch 'master' into v1.0.0 2015-04-19 23:13:38 +09:00
Tatsuhiro Tsujikawa 97366bf55c nghttpx: Set content-length after complete request/response headers 2015-04-10 22:10:51 +09:00
Tatsuhiro Tsujikawa 9803f92e9c nghttpx: Set Downstream to stream user data on HTTP Upgrade to h2 2015-04-10 02:40:09 +09:00
Tatsuhiro Tsujikawa 44b4cda200 src: Check return value from nghttp2_session_get_stream_user_data 2015-04-10 00:21:31 +09:00
Tatsuhiro Tsujikawa cf0576253f Merge branch 'master' into v1.0.0 2015-04-08 18:10:04 +09:00
Tatsuhiro Tsujikawa 80743ddc7b nghttpx: Set promised Downstream as nghttp2 stream user data 2015-04-08 16:07:53 +09:00
Tatsuhiro Tsujikawa 36a8f24559 nghttpx: Finish incomplete incoming request with END_STREAM flag
Previously we send RST_STREAM when we send DATA with END_STREAM flag
set.  With this commit, we also do this when we send HEADERS with
END_STREAM flag set.
2015-04-08 16:07:13 +09:00
Tatsuhiro Tsujikawa 8c3b379b66 Pool Memchunk per worker 2015-04-08 00:10:48 +09:00
Tatsuhiro Tsujikawa d0c27d5229 Send 24 bytes client magic byte string by library
Previously nghttp2_session_send() and nghttp2_session_mem_send() did
not send 24 bytes client magic byte string (MAGIC).  We made
nghttp2_session_recv() and nghttp2_session_mem_recv() process MAGIC by
default, so it is natural to make library send MAGIC as well.  This
commit makes nghttp2_session_send() and nghttp2_session_mem_send()
send MAGIC.  This commit also replace "connection preface" with
"client magic", since we call MAGIC as "connection preface" but it is
just a part of connection preface.  NGHTTP2_CLIENT_CONNECTION_PREFACE
macro was replaced with NGHTTP2_CLIENT_MAGIC.  The already deprecated
NGHTTP2_CLIENT_CONNECTION_HEADER macro was removed permanently.
nghttp2_option_set_no_recv_client_preface() was renamed as
nghttp2_option_set_no_recv_client_magic().  NGHTTP2_ERR_BAD_PREFACE
was renamed as NGHTTP2_ERR_BAD_CLIENT_MAGIC.
2015-04-05 23:15:20 +09:00
Tatsuhiro Tsujikawa 01af6ea70c Remove ALTSVC related code
HTTP/2 and HPACK are going to be published as RFC, but ALTSVC is still
in draft state.  To make our API stable, it would be better to remove
ALTSVC API for 1.0.0 release.
2015-04-05 23:15:20 +09:00
Tatsuhiro Tsujikawa dc85623060 nghttpx: Fix PUSH_PROMISE header field corruption
Fixes GH-194
2015-03-26 22:52:51 +09:00
Tatsuhiro Tsujikawa 661fb2eb0e NULL-terminate name and value in nghttp2_nv
Guaranteeing NULL-termination is very useful when name or value are
used with C functions which requires NULL-terminated string.
2015-03-23 23:25:57 +09:00
Tatsuhiro Tsujikawa d46e50b112 nghttpx: Refactor DownstreamQueue to avoid expensive std::map 2015-03-12 01:13:55 +09:00
Tatsuhiro Tsujikawa 446de923f3 nghttpx: Support multiple HTTP/2 session per worker
Currently, we use same number of HTTP/2 sessions per worker with given
backend addresses.  New option to specify the number of HTTP/2 session
per worker will follow.
2015-03-10 23:20:21 +09:00
Tatsuhiro Tsujikawa 991baf9e69 nghttpx: Use http2::copy_headers_to_nva in trailer part handling 2015-03-08 17:32:01 +09:00
Tatsuhiro Tsujikawa 60c2fe5a2e nghttpx: Support trailer-part in h2 <- h2 path 2015-03-08 16:48:45 +09:00