Commit Graph

70 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa 85bb37ab7c Enable ConstructorInitializerAllOnOneLineOrOnePerLine for better diff 2016-01-27 21:14:07 +09:00
Tatsuhiro Tsujikawa 497ffc6387 nghttpx: Change pushed stream's priority
By default, as RFC 7540 calls for, pushed stream depends on its
associated (parent) stream.  There are some situations that this is
sub-optimal.  For example, if associated stream is HTML, and server is
configured to push css and javascript files which are in critical
rendering path.  Then the default priority scheme is sub-optimal,
since browser typically blocks rendering while waiting for critical
resources.  In this case, it is better to at least give pushed stream
the same priority of associated stream, and interleave these streams.

This change gives pushed stream the same priority of associated stream
if pushed stream has content-type "application/javascript" or
"text/css".  The pushed stream now depends on the stream which
associated stream depends on.  We use the same weight of associated
stream.
2016-01-21 21:11:57 +09:00
Tatsuhiro Tsujikawa 4f07db8bcb src: Rename our new string classes 2016-01-17 11:33:45 +09:00
Tatsuhiro Tsujikawa 34d5382d66 nghttpx: Use VString for DownstreamAddr::host and hostport to remember size 2016-01-17 00:52:41 +09:00
Tatsuhiro Tsujikawa 5c3f74b424 nghttpx: Add RFC 7239 Forwarded header field support 2016-01-16 11:32:14 +09:00
Tatsuhiro Tsujikawa ba9e912cf6 src: Rename isAlpha, isDigit, and isHexDigit as is_... 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 c6ef1c02b9 Switch to clang-format-3.6 2015-11-13 00:53:29 +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 02adaac368 nghttpx: Write h1 header into downstream buffer directly 2015-09-11 23:49:47 +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 e06af02573 nghttpx: Add Response mruby object 2015-09-03 00:40:14 +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 878b873c69 src: Use using instead of typedef 2015-06-21 19:37:50 +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 34efc6b7a4 More constexpr 2015-05-29 22:36:05 +09:00
Tatsuhiro Tsujikawa 94ca9705ef asio: Rewrite response body handling if response body is not expected 2015-03-06 21:36:40 +09:00
Tatsuhiro Tsujikawa 08d0cdfd31 Fix typo 2015-03-04 02:48:20 +09:00
Tatsuhiro Tsujikawa d151759f8a nghttpx: Fix location rewrite, take 2 2015-02-08 21:26:47 +09:00
Tatsuhiro Tsujikawa 9e723b6b1d src: Rename LinkHeader.url as LinkHeader.uri 2015-02-08 17:29:38 +09:00
Tatsuhiro Tsujikawa 88f0bc70c4 nghttpx: Reworkd inherited request headers in PUSH_PROMISE 2015-02-08 16:10:01 +09:00
Tatsuhiro Tsujikawa b14cfaf308 src: Store token in Header object to avoid additional lookups 2015-02-08 16:10:01 +09:00
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 f8f9b36acd http2: Use std::array for indexing headers 2015-02-06 00:15: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 434e80dc7b nghttpx: Reset stream if TE header field contains other than trailer 2015-01-24 15:31:59 +09:00
Tatsuhiro Tsujikawa b11e1afc91 nghttpx: Remove unused noop function 2015-01-15 23:14:25 +09:00
Tatsuhiro Tsujikawa aa1c8d1fa4 nghttpx: Don't forward Trailer header field 2015-01-14 21:33:22 +09:00
Tatsuhiro Tsujikawa 3ae44ef2f3 nghttpd, nghttpx: Rework incoming header handling 2015-01-05 01:46:41 +09:00
Tatsuhiro Tsujikawa 8e3406ad20 nghttpd: Use faster request header handling 2015-01-03 00:19:41 +09:00
Tatsuhiro Tsujikawa 9a35dbc4ab src: Just check emptiness for value since spaces around value are stripped 2014-12-15 23:14:07 +09:00
Tatsuhiro Tsujikawa 6f70a53da6 src: http2::add_header: strip white spaces in value 2014-12-15 23:04:45 +09:00
Tatsuhiro Tsujikawa b1f807abd1 Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
Tatsuhiro Tsujikawa e217e789de nghttp: Support non-final response and check pseudo headers 2014-08-08 23:03:12 +09:00
Tatsuhiro Tsujikawa d4d56e1846 nghttpd, nghttpx: Check that pseudo headers come before normal headers 2014-08-08 20:52:32 +09:00
Tatsuhiro Tsujikawa d496c42dc9 Revert "nghttpx, nghttpd: Check pseudo header fields come before normal header fields"
This reverts commit cc24b9aaf0.
2014-08-08 20:17:03 +09:00
Tatsuhiro Tsujikawa cc24b9aaf0 nghttpx, nghttpd: Check pseudo header fields come before normal header fields 2014-08-07 22:49:34 +09:00
Tatsuhiro Tsujikawa 9fb2bc8468 src: Remove http2::sort_nva
This function is no longer necessary because 0x00 concatenation rule
is gone.
2014-08-07 21:55:30 +09:00
Tatsuhiro Tsujikawa 6e027ad830 nghttpd, nghttpx: Check allowed pseudo headers 2014-07-31 23:05:53 +09:00
Tatsuhiro Tsujikawa af5fd2019d src: Remove 0x00 concatenation for headers
Now concatenating header values with 0x00 as delimiter is not
necessary because HPACK reference set is removed and the order of
header field fed into HPACK encoder is preserved when they are
decoded.
2014-07-31 23:05:52 +09:00
Tatsuhiro Tsujikawa 660c536275 Extend namelen and valuelen in nghttp2_nv to size_t 2014-04-30 23:08:34 +09:00
Tatsuhiro Tsujikawa a8a2236da9 nghttpx: Add --add-response-header option 2014-04-26 14:56:08 +09:00
Tatsuhiro Tsujikawa b1edb1f3ae Don't index name/value pair bearing NO_INDEX flag when forwarding it 2014-04-03 11:22:11 +09:00
Tatsuhiro Tsujikawa 24cb90806d Add flags to nghttp2_nv structure
This is preliminary change for upcoming HPACK updates.  The flags are
used to determine the name/value pair is indexable or not.
2014-04-01 23:17:50 +09:00
Tatsuhiro Tsujikawa ab2dc5967d Replace HTTP/2.0 with HTTP/2 2014-03-30 19:26:37 +09:00
Tatsuhiro Tsujikawa 8be17f077a Add nghttp2_check_header_name and nghttp2_check_header_value APIs
These are promoted to public API from src/http2.h
2014-02-01 19:31:50 +09:00
Tatsuhiro Tsujikawa 864789ca65 nghttpx: Limit the maximum header block size (again) 2014-01-28 01:17:54 +09:00