Commit Graph

200 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa bae37e3e4a nghttpx: Add custom memory allocator mainly for header related objects 2016-03-09 21:16:28 +09:00
Tatsuhiro Tsujikawa fe6ccd16da nghttpx: Change read timeout reset timing 2016-03-05 19:11:36 +09:00
Tatsuhiro Tsujikawa e302cc9c16 src: Simplify function parameter using StringRef 2016-03-04 00:38:43 +09:00
Tatsuhiro Tsujikawa 06921f35f3 nghttpx: Restructure mode settings
It is very hard to support multiple protocols in backend while
retaining multiple mode settings.  Therefore, we dropped modes except
for default and HTTP/2 proxy mode.  The other removed modes can be
emulated using combinations of options.  Now the backend connection is
not encrypted by default.  To enable encryption on backend connection,
use --backend-tls option.
2016-02-28 21:35:26 +09:00
Tatsuhiro Tsujikawa 1832f78684 nghttpx: Move downstream proto to DownstreamAddrGroup 2016-02-28 16:56:14 +09:00
Tatsuhiro Tsujikawa aafcc55006 nghttpx: Deprecate --http2-max-concurrent-streams option
We added 2 new option instead: --frontend-http2-max-concurrent-streams
and --backend-http2-max-concurrent-streams.
2016-02-28 00:19:18 +09:00
Tatsuhiro Tsujikawa 9678daa46a nghttpx: Rename index_headers() as parse_content_length() 2016-02-20 23:30:02 +09:00
Tatsuhiro Tsujikawa 23ecfd412d nghttpx: Fix mruby compile error, clean up add_header interface 2016-02-20 23:30:02 +09:00
Tatsuhiro Tsujikawa 1703201084 nghttpx: Get rid of hdidx 2016-02-20 23:30:02 +09:00
Tatsuhiro Tsujikawa 17758126fa nghttpx: Add headers given in add-response-headers for mruby response 2016-02-13 22:31:38 +09:00
Tatsuhiro Tsujikawa b440f585bc nghttpx: Use Header to store custom request/response header fields 2016-02-13 22:19:05 +09:00
Tatsuhiro Tsujikawa ee07694783 nghttpx: Add request-header-field-buffer and max-request-header-fields options
This commit adds request-header-field-buffer and
max-request-header-fields, and deprecates header-field-buffer and
max-header-fields options.
2016-02-06 17:22:23 +09:00
Tatsuhiro Tsujikawa 85bb37ab7c Enable ConstructorInitializerAllOnOneLineOrOnePerLine for better diff 2016-01-27 21:14:07 +09:00
Tatsuhiro Tsujikawa 98253b1d0d nghttpx: Use DefaultMemchunks as HTTP/2 and SPDY frontend response buffer 2016-01-27 15:28:01 +09:00
Tatsuhiro Tsujikawa eb8649bf9b nghttpx: Don't greedily read data from backend
This might help throughput, but it interfere stream priority.  The
throughput issue is generally caused by the small buffer size to store
response body, which was 16K.  We increased it to 128K to compensate
this change.
2016-01-20 11:20:15 +09:00
Tatsuhiro Tsujikawa 0402481be4 nghttpx: Organize connection related configuration into struct 2016-01-19 16:56:12 +09:00
Tatsuhiro Tsujikawa 16549bb276 nghttpx: Structured configurations for http and http2 2016-01-18 17:00:20 +09:00
Tatsuhiro Tsujikawa ef5d981ab1 nghttpx: Simplify 2016-01-17 17:04:16 +09:00
Tatsuhiro Tsujikawa d16ff1f519 nghttpx: Use StringAdaptor for Config::server_name 2016-01-17 01:15:11 +09:00
Tatsuhiro Tsujikawa b202e066fd nghttpx: Don't allow certain characters in host and :scheme header field
For HTTP/2, we do this validation in libnghttp2.  http-parser does
this partially, when it parses URI, but it does not do anything for
Host header field.  libspdylay does not perform anything.  So do some
additional validation for HTTP/1 and SPDY cases.  integration tests
were also added to make sure they work.
2016-01-16 16:00:05 +09:00
Tatsuhiro Tsujikawa f8472f4709 nghttpx: Remove backend priority handling code
Currently, this does not do anything useful.
2016-01-15 00:17:40 +09:00
Tatsuhiro Tsujikawa 5a8cf94361 nghttpx: Refactor Downstream::response_sent_bodylen_ 2016-01-14 23:54:28 +09:00
Tatsuhiro Tsujikawa fa31d0940c nghttpx: Refactor Downstream::request_datalen_ 2016-01-14 23:36:47 +09:00
Tatsuhiro Tsujikawa e7e52b11ce nghttpx: Refactor Downstream::response_bodylen_ 2016-01-14 23:20:44 +09:00
Tatsuhiro Tsujikawa bdef0e0b1a nghttpx: Refactor Downstream::request_bodylen_ 2016-01-14 23:14:58 +09:00
Tatsuhiro Tsujikawa 3b8889a2a1 nghttpx: Extract response related fields to Response struct 2016-01-14 01:05:10 +09:00
Tatsuhiro Tsujikawa 919f08eb38 nghttpx: Extract request related fields to Request struct
Header field related functions are now gathered into FieldStore class.
This commit only handles request.  Subsequent commit will do the same
thing for response.
2016-01-14 01:04:32 +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 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 c6ef1c02b9 Switch to clang-format-3.6 2015-11-13 00:53:29 +09:00
Tatsuhiro Tsujikawa da89f9c150 nghttpx: Refactor client handler write
Move write buffer to Upstream objects
2015-10-03 11:09:42 +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 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 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 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 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 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 39f89f4a60 src: Use user-defined literals for k, m, and g. 2015-06-21 14:32:47 +09:00
Tatsuhiro Tsujikawa 5b51320dc5 nghttpx: Validate :path on SPDY frontend
Unless method is CONNECT, we require that :path starts with "/",
except for OPTIONS method, which can take "*" as :path (server-wide
OPTIONS request).
2015-06-16 00:09:22 +09:00
Tatsuhiro Tsujikawa 2952706b53 Fix scan-build error 2015-06-10 00:29:03 +09:00