Commit Graph

1290 Commits

Author SHA1 Message Date
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
Tatsuhiro Tsujikawa 0676535caf Do async-resove in ctor 2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa dd741a58ae Use header_map instead of wrapping it 2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa 26304546c4 [WIP] Add asio client interface 2015-03-05 02:12:31 +09:00
Tatsuhiro Tsujikawa c2426bc732 Merge branch 'pthread-getspecific' of https://github.com/icing/nghttp2 into icing-pthread-getspecific 2015-03-05 02:04:56 +09:00
Tatsuhiro Tsujikawa 08d0cdfd31 Fix typo 2015-03-04 02:48:20 +09:00
Stefan Eissing 1fd44b1567 replacing thread_local, which does not exist on OS X, with pthread_getspecific call 2015-03-03 17:09:15 +01:00
acesso 6a2e6b744f Update shrpx_config.cc
declaration of make_socket_closeonexec need the proper scope here, it was there per request at https://github.com/tatsuhiro-t/nghttp2/pull/142 , not sure why is was removed.
2015-03-02 17:14:09 -03:00
Tatsuhiro Tsujikawa 4de8db523f nghttpx: Check frame type in HTTP/2 backend on_begin_headers_callback 2015-03-02 00:53:48 +09:00
Tatsuhiro Tsujikawa cf5ac0f363 nghttpx: Fix broken server push after HTTP upgrade 2015-03-01 11:03:48 +09:00
Tatsuhiro Tsujikawa 185ebd7b79 nghttpx: Fix crash when upgrading HTTP/2 failed 2015-03-01 10:11:45 +09:00
Tatsuhiro Tsujikawa f3a0ab6552 nghttpd: Fix help output so that it can be generated in man/html nicely 2015-02-27 00:56:26 +09:00
Tatsuhiro Tsujikawa 1c2c5bdd05 Revert "nghttpx: Add missing Downstream::end_upload_data() call in HTTP/2 and SPDY"
This reverts commit ef090d425e.
2015-02-27 00:32:48 +09:00
Tatsuhiro Tsujikawa 3715a89655 Merge branch 'bcard/address-nghttp2-server' of https://github.com/bcard/nghttp2 into bcard-bcard/address-nghttp2-server
Conflicts:
	src/nghttp.cc
2015-02-27 00:02:45 +09:00
Tatsuhiro Tsujikawa ef090d425e nghttpx: Add missing Downstream::end_upload_data() call in HTTP/2 and SPDY
This ensures that all frontend code calls
Downstream::end_upload_data() when request was all received.
2015-02-26 23:50:21 +09:00
Tatsuhiro Tsujikawa e1bb06d8ab nghttpx: Remove unused error check 2015-02-26 23:46:42 +09:00
Brian Card 1bdf664f4d Changing signature of numeric_name from numeric_name(addrinfo *addr)
to numeric_name(const struct sockaddr *sa, socklen_t salen) to remove
dependency on addrinfo struct.
2015-02-26 08:59:25 -05:00
Tatsuhiro Tsujikawa 1c0d617742 nghttpx: Rename WorkerConfig as LogConfig
This is a sign that we only use thread-local storage for logging only.
2015-02-26 00:02:29 +09:00
Tatsuhiro Tsujikawa b161dfe573 nghttpx: Move graceful_shutdown flag from WorkerConfig to Worker
A part of an effort to eliminate thread_local WorkerConfig
2015-02-25 22:53:53 +09:00
Brian Card b773d63b92 Moving nghttp's numeric_name function to util.cc and using this to generate the address name in HttpServer.cc 2015-02-24 09:50:18 -05:00
Tatsuhiro Tsujikawa 66b6787fbe src: Use "sensitive" to indicate "never indexed" header field 2015-02-24 23:12:12 +09:00
Tatsuhiro Tsujikawa 1a2bccd71c nghttpx: Share nghttp2_session_callbacks between objects 2015-02-24 15:21:10 +09:00
Tatsuhiro Tsujikawa 8417275368 nghttpx: Code cleanup 2015-02-24 15:11:09 +09:00
Tatsuhiro Tsujikawa c98cf045d6 nghttpx: Use omit minor version in case of HTTP/2 in via header and accesslog 2015-02-24 14:43:01 +09:00
Brian Card 933b9636e5 removing additional space after option variable 2015-02-23 07:15:54 -05:00