Tatsuhiro Tsujikawa
89b8039466
nghttp, nghttpd: Add --hexdump option to hexdump incoming traffic
...
The output format is similar to `hexdump -C`
2015-03-24 02:30: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
6893608ae2
Use literal instead of computed value in token lookup
2015-03-21 23:03:37 +09:00
mod-h2-dev
076eefbed6
fix for segfault by reserving correct worker count
2015-03-16 17:42:22 +02:00
Tatsuhiro Tsujikawa
08ec5b3fc0
nghttp: Restore same message displayed when some requests failed
2015-03-14 18:32:53 +09:00
Tatsuhiro Tsujikawa
4219fe7822
Bump up libnghttp2_asio LT revision to 1:0:0
2015-03-14 18:20:00 +09:00
Tatsuhiro Tsujikawa
8ea26fddfd
Fix compile error "chosen constructor is explicit in copy-initialization"
2015-03-14 15:54:55 +09:00
Tatsuhiro Tsujikawa
98add63cdf
nghttp: Treat stream as success if we see END_STREAM from peer
2015-03-14 00:09:10 +09:00
Tatsuhiro Tsujikawa
7b90404072
nghttpx: Omit well-known port from hostport in downstream request
2015-03-14 00:09:10 +09:00
Tatsuhiro Tsujikawa
de0543f684
nghttpx: Refactor a bit
2015-03-14 00:09:10 +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
0f87cedc2d
nghttpx: Use doubly linked list for dconns_ and streams_
2015-03-11 21:35:47 +09:00
Tatsuhiro Tsujikawa
d34095cf49
nghttpx: Pin HTTP/2 upstream to one Http2Session to improve performance
2015-03-11 21:14:55 +09:00
Tatsuhiro Tsujikawa
4877f72a75
nghttpx: Optimize a bit
2015-03-11 00:42:18 +09:00
Tatsuhiro Tsujikawa
274b3a2296
nghttpx: Reset connection check timer on successful write while not checking
2015-03-11 00:27:51 +09:00
Tatsuhiro Tsujikawa
93013f4205
nghttpx: Remove --backend-http2-connection-check option, enable it by default
2015-03-11 00:22:05 +09:00
Tatsuhiro Tsujikawa
a0524ef05d
Fix busy loop
2015-03-11 00:11:51 +09:00
Tatsuhiro Tsujikawa
0e3ae63965
nghttpx: Add --backend-http2-connections-per-worker
2015-03-10 23:43:25 +09:00
Tatsuhiro Tsujikawa
3e14261ebf
nghttpx: Setting failure mode in on_connect() may affect other backends
2015-03-10 23:21:48 +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
c5860fc6f4
nghttpx: Support multiple -b option for HTTP/2 backend
2015-03-10 21:54:29 +09:00
Tatsuhiro Tsujikawa
6b714030dd
nghttpx: Disable acceptor temporarily when process runs out of fd
2015-03-10 21:25:20 +09:00
Tatsuhiro Tsujikawa
8483225839
nghttpx: Don't rewrite host for CONNECT method
2015-03-10 00:44:35 +09:00
Tatsuhiro Tsujikawa
585af93828
nghttpx: Remove last write/read fields for TLS
...
It seems that we don't care about this since we don't change buffer
pointer between would-block write/read and next write/read. Somehow
we decided we need these fields. As a precaution, we set
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER in SSL_set_mode() for both server
and client contexts.
2015-03-10 00:11:11 +09:00
Tatsuhiro Tsujikawa
41e266181e
nghttpx: Attempt to improve HTTP/2 backend connection check
...
It turns out that writing successfully to network is not enough.
After apparently successful network write, read fails and then we
first know network has been lost (at least my android mobile network).
In this change, we say connection check is successful only when
successful read. We already send PING in this case, so we just wait
PING ACK with short timeout. If timeout has expired, drop connection.
Since waiting for PING ACK could degrade performance for fast reliably
connected network, we decided to disable connection check by default.
Use --backend-http2-connection-check to enable it.
2015-03-09 23:37:54 +09:00
Kazuho Oku
2a4f347dbc
do not send pseudo-headers when in HTTP/1
2015-03-09 11:40:13 +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
9ffbc45ba6
nghttpx: Allow sending trailer part in h1 backend link
2015-03-08 17:58:00 +09:00
Tatsuhiro Tsujikawa
961f41d7ce
nghttp, nghttpd: Add trailer header field when sending trailer part
2015-03-08 17:52:36 +09:00
Tatsuhiro Tsujikawa
928d3e5f3f
nghttpx: Allow sending trailer header field
2015-03-08 17:51:52 +09:00
Tatsuhiro Tsujikawa
42eeebc7f6
nghttpx: Add function to send trailer part in h1 frontend
2015-03-08 17:32:38 +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
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
d10dc4bb9b
nghttp, nghttpd: Clean up around NGHTTP2_DATA_FLAG_NO_END_STREAM
2015-03-08 16:28:23 +09:00
Tatsuhiro Tsujikawa
c4b487be05
asio: Add client::request::write_trailer()
2015-03-07 23:04:31 +09:00
Tatsuhiro Tsujikawa
c976a0fcd1
asio: Add server::response::write_trailer()
2015-03-07 19:26:42 +09:00
Tatsuhiro Tsujikawa
80a7523b49
nghttpd: Add --trailer to send trailer header fields
2015-03-07 17:50:03 +09:00
Tatsuhiro Tsujikawa
4c55a2340b
nghttp: Add --trailer optiont to send trailer header fields with -d option
2015-03-07 17:45:46 +09:00
Tatsuhiro Tsujikawa
196d7da53f
nghttpx: Use http2::expect_response_body()
2015-03-07 15:50:52 +09:00
Tatsuhiro Tsujikawa
6824319fe6
asio: Link with http-parser
2015-03-07 15:48:38 +09:00
Tatsuhiro Tsujikawa
66d00954a5
asio: Quote ServeMux documents in http2::handle()
2015-03-07 03:17:13 +09:00
Tatsuhiro Tsujikawa
a043230371
asio: Fix crach in client code
2015-03-07 01:38:59 +09:00
Tatsuhiro Tsujikawa
c2f49fa478
nghttpd: Fix bug that date header field value is not updated
2015-03-07 01:10:49 +09:00
Tatsuhiro Tsujikawa
773b108eeb
asio: Add noexcept for move constructor and move assignment operator
2015-03-07 01:10:49 +09:00
Tatsuhiro Tsujikawa
36a9cbf41f
asio: Use large window size for client
2015-03-07 01:10:49 +09:00
Tatsuhiro Tsujikawa
f8182333b4
asio: Improve date header field precision
2015-03-07 01:10:49 +09:00
Tatsuhiro Tsujikawa
c3265de625
asio: Remove signal handling from server
2015-03-07 01:10:49 +09:00
Tatsuhiro Tsujikawa
fa21b95274
asio: Provide move constructor and move assignment operator to server::http2
2015-03-07 01:10:49 +09:00
Tatsuhiro Tsujikawa
5dccc88a7c
asio: Add host_service_from_uri() to extract remote address from URI
2015-03-07 01:10:49 +09:00
Tatsuhiro Tsujikawa
2cadd38b6b
asio: Fix path matching in server
2015-03-07 01:10:49 +09:00
Tatsuhiro Tsujikawa
d7cfe464a2
asio: client::configure_tls_context takes error_code
2015-03-07 01:10:49 +09:00
Tatsuhiro Tsujikawa
018e9eaf6d
asio: Clean up server API to explicitly set error code
2015-03-07 01:10:49 +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
05a847b6b8
asio: Use passed URI for request
2015-03-06 02:35:44 +09:00
Tatsuhiro Tsujikawa
38788d707b
asio: Don't send response body if it is not expected by status code or method
2015-03-06 02:15:34 +09:00
Tatsuhiro Tsujikawa
44c0d32a1b
asio: Fix compile error with gcc
2015-03-06 02:05:01 +09:00
Tatsuhiro Tsujikawa
36aae8c310
asio: Move server::http2 to its own file
2015-03-06 01:58:56 +09:00
Tatsuhiro Tsujikawa
34ac90443f
asio: Rename http2::listen as http2::listen_and_serve
2015-03-06 01:54:28 +09:00
Tatsuhiro Tsujikawa
992c14e354
asio: Rename *_reader as *_generator and read_cb as generator_cb
2015-03-06 01:47:55 +09:00
Tatsuhiro Tsujikawa
529fc937dc
asio: Document public APIs
2015-03-06 01:41:06 +09:00
Tatsuhiro Tsujikawa
05b8d8c5b7
asio: Start sending response header when write_head is called
2015-03-06 00:06:53 +09:00
Tatsuhiro Tsujikawa
a1c937a007
src: Add missing dquote in HTML
2015-03-05 23:34:42 +09:00
Tatsuhiro Tsujikawa
8baec366f0
asio: Make redirect_handler and status_handler part of public API
2015-03-05 23:32:21 +09:00
Tatsuhiro Tsujikawa
c64bb62ffe
asio: Make redirect_handler use passed uri as is and percent-encode path part
2015-03-05 23:23:17 +09:00
Tatsuhiro Tsujikawa
6020b727d8
asio: Add signal_write() to server::http2_handler to avoid scattered ifs
2015-03-05 22:00:14 +09:00
Tatsuhiro Tsujikawa
7f04968950
asio: Add dtor to API classes
2015-03-05 21:51:44 +09:00
Tatsuhiro Tsujikawa
ca1f43dfca
asio: Export session_impl* from stream rather than delegating everything
2015-03-05 21:48:37 +09:00
Tatsuhiro Tsujikawa
9efb62f40b
asio: Move server classes to dedicated files
2015-03-05 21:42:48 +09:00
Tatsuhiro Tsujikawa
f1c7d3edfd
asio: Rename server::http2_stream as server::stream
2015-03-05 21:03:03 +09:00
Tatsuhiro Tsujikawa
7ff38eeb2e
asio: Start writing on cancel
2015-03-05 03:00:18 +09:00
Tatsuhiro Tsujikawa
e4ce595ebb
asio: Add serve_mux class to route incoming requet by path
...
serve_mux is direct port of ServeMux from go
2015-03-05 02:12:32 +09:00
Tatsuhiro Tsujikawa
8accf3898a
asio: Add client::request::resume() member function
2015-03-05 02:12:32 +09:00
Tatsuhiro Tsujikawa
690a1622aa
asio: Add const qualifier to client::session member functions
2015-03-05 02:12:32 +09:00
Tatsuhiro Tsujikawa
aaef798566
asio: Add server::response::io_service()
2015-03-05 02:12:32 +09:00
Tatsuhiro Tsujikawa
0753fcd6e5
asio: Add error_code parameter to cancel()
2015-03-05 02:12:32 +09:00
Tatsuhiro Tsujikawa
a14029744c
asio:: Add cancel() and on_close() to server::response
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
7e46d0b142
asio: Call signal_write() on session_impl::cancel()
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
726e6c087d
asio: server: Move push member function to response object
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
ff0eaf8399
asio: Indicate EOF by passing 0 to the second parameter to data_cb
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
7fb7575f78
asio: read_cb: Use similar semantics with nghttp2_data_source_read_callback
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
44642af227
asio: Remove unused struct header
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
e7d052100c
asio: Utilize aggregate or value-initialization for header_value
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
fc2170e488
asio: Use uri_ref in server code
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
0cda2282dd
asio: Assign values to uri_ref directly
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
6753b6d61e
asio: Use header_map in server code
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
35817876fe
asio: Move server API to asio_http2_server.h
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
7d753d779e
asio: Fix resource leak (socket not closed) in server code
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
f6f908a541
asio: Make impl() const
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
b0c1986a46
asio: Avoid shared_ptr for request and response
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
9671eaa850
asio: Set stream pointer to request and response in stream ctor
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
062b42918c
asio: Remove threaded task runner
...
This is too complicated and not suitable for event driven server. We
plan to expose io_service instead.
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
2fa28e790d
asio: Separate client API to asio_http2_client.h
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
76eab3faa0
asio: Pass connected address to connect_cb
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
70ea774f23
asio: Clear up TLS peer verification
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
e15d302985
asio: Introduce uri_ref
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
b2196f215a
asio: Use boost::system::error_code for on_error callback
2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa
8afd75ca47
Make request, response const
2015-03-05 02:12:31 +09:00