Commit Graph

135 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 db8de490a0 nghttpx: Omit Forwarded for and by parameter if UNIX domain socket is used 2016-01-19 23:26:04 +09:00
Tatsuhiro Tsujikawa 0402481be4 nghttpx: Organize connection related configuration into struct 2016-01-19 16:56:12 +09:00
Tatsuhiro Tsujikawa 919e9eee63 nghttpx: It is enough to check "chunked" in the suffix 2016-01-17 16:34:56 +09:00
Tatsuhiro Tsujikawa 7b2d4b6ae6 nghttpx: Optimize logging further 2016-01-17 15:04:09 +09:00
Tatsuhiro Tsujikawa 74c77926a8 nghttpx: Refactor and simplify Downstream::rewrite_location_response_header 2016-01-16 12:49:18 +09:00
Tatsuhiro Tsujikawa 3c7038dfe1 nghttpx: Simplify
We only change req_.upgrade_request once, so just using else is
suffice.
2016-01-15 00:22:11 +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 3218c160be nghttpx: Refactor Downstream::response_datalen_ 2016-01-14 23:49:21 +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 0a76b45eca nghttpx: Fix bug that key_prev is not updated 2016-01-14 01:05:10 +09:00
Tatsuhiro Tsujikawa 6d6a00f1f5 nghttpx: Return assemble cookie on the fly 2016-01-14 01:05:10 +09:00
Tatsuhiro Tsujikawa 3b8889a2a1 nghttpx: Extract response related fields to Response struct 2016-01-14 01:05:10 +09:00
Tatsuhiro Tsujikawa a7fd37ffdf nghttpx: Remove FieldStore::set_last_{header,trailer}_value
Use FieldStore::append_last_{header,trailer}_value instead.
2016-01-14 01:04:53 +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 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 1aa8e8cd9f nghttpx: Simplify add_header 2015-10-28 02:57:31 +09:00
Tatsuhiro Tsujikawa 777e1ee2c5 nghttpx: Use send_data_callback for higher throughput 2015-10-03 17:56:37 +09:00
Tatsuhiro Tsujikawa 4ac7152f94 nghttpx: Fix build failure without mruby 2015-09-05 01:32:26 +09:00
Tatsuhiro Tsujikawa bddc4a0a04 nghttpx: Rewrite API; introduce Env object 2015-09-05 00:53:42 +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 e06af02573 nghttpx: Add Response mruby object 2015-09-03 00:40:14 +09:00
Tatsuhiro Tsujikawa 45cdb10c46 nghttpx: Use ruby block to run request hook 2015-09-02 22:25:04 +09:00
Tatsuhiro Tsujikawa 1508c50a45 nghttpx: Add basic infrastructure for mruby support 2015-09-02 02:45:15 +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 fc062976a1 nghttpx: Delete DownstreamConnection from Downstream explicitly 2015-07-15 23:31:32 +09:00
Tatsuhiro Tsujikawa e63e775fea nghttpx: Simplify BlockedLink management 2015-07-15 20:44:44 +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 323fc8c552 nghttpx: Make WebSocket upgrade work
This commit makes sure that WebSocket upgrade works for HTTP/1.1
frontend and backend pair.  Actually, this implementation probably
supports other upgrade as well, other than HTTP/2 Upgrade, which is
handled specially in other place.
2015-05-26 22:26:17 +09:00
Tatsuhiro Tsujikawa 326b4c467b nghttpx: Fix bug that END_STREAM is not set in backend for POST with Upgrade 2015-05-26 00:00:11 +09:00
Tatsuhiro Tsujikawa b20abfc11a nghttpx: Allow HTTP Upgrade from POST request if response header was not sent 2015-05-22 01:59:40 +09:00
Tatsuhiro Tsujikawa 9dc5259593 nghttpx: Take into account request URI in header size in https frontend 2015-04-29 22:23:25 +09:00
Tatsuhiro Tsujikawa 8c3b379b66 Pool Memchunk per worker 2015-04-08 00:10:48 +09:00
Tatsuhiro Tsujikawa 46e3be7b5b nghttpx: Simplify backend request line construction
It turns out that the cause of complication in backend request line
construction is a absolute-form in HTTP/1 request.  In HTTP/2, we have
separated pseudo-header fields and no problem at all.  In this commit,
we parse request URI in HTTP/1 frontend and extract values from it to
make backend logic simpler.  This patch removes host header field
emission in HTTP/2 backend if :authority is emitted.  It also rewrites
host header field with authority part in absolute-form URI as per RFC
7230.
2015-03-14 00:09:10 +09:00
Tatsuhiro Tsujikawa d46e50b112 nghttpx: Refactor DownstreamQueue to avoid expensive std::map 2015-03-12 01:13:55 +09:00
Tatsuhiro Tsujikawa 8483225839 nghttpx: Don't rewrite host for CONNECT method 2015-03-10 00:44:35 +09:00
Tatsuhiro Tsujikawa b9d6fff962 nghttpx: Allow accepting trailer part in h1 frontend
Downstream's headers mutation functions have been rewritten to share
code.
2015-03-08 18:39:45 +09:00
Tatsuhiro Tsujikawa 6ad63a06b0 nghttpx: Support response trailer part handling in h1 backend 2015-03-08 17:20:38 +09:00
Tatsuhiro Tsujikawa 60c2fe5a2e nghttpx: Support trailer-part in h2 <- h2 path 2015-03-08 16:48:45 +09:00
Tatsuhiro Tsujikawa 41b5077330 nghttpx: Support trailer part in h2 -> h2 path 2015-03-08 16:33:40 +09:00
Tatsuhiro Tsujikawa 196d7da53f nghttpx: Use http2::expect_response_body() 2015-03-07 15:50:52 +09:00
Tatsuhiro Tsujikawa 9302e3edf4 src: Use util::streq_l to compare against string literal 2015-02-20 23:57:40 +09:00
Tatsuhiro Tsujikawa d1a1e882bf nghttpx: Fix request re-submission bug in HTTP/2 backend 2015-02-17 23:15:53 +09:00
Tatsuhiro Tsujikawa 799778af69 Revert "nghttpx: Fix request resubmit bug on HTTP/2 backend connection check"
This reverts commit d45f5a51e4.
2015-02-17 22:28:03 +09:00