nghttp2/src
Tatsuhiro Tsujikawa d42f31ca78 nghttpx: Fix bug that data buffered in SSL object are not read
This is same issue described in https://github.com/h2o/h2o/issues/268.
That is if SSL object has decrypted data buffered inside it, and
application does not read it for some reason (e.g., rate limit), we
have to check the existence of data using SSL_pending.  This is
because buffered data inside SSL is not notified by io watcher.  It is
obvious, but we totally missed it.

nghttpx code normally reads everything until SSL_read returns error
(want-read).  But if rate limit is involved, we stop reading early.
Also in HTTP/1 code, while processing one request, we just read until
buffer is filled up.  In these cases, we may suffer from this problem.

This commit fixes this problem, by performing SSL_pending() and if it
has buffered data and read io watcher is enabled, we feed event using
ev_feed_event().
2015-04-06 22:31:36 +09:00
..
includes Fix compile error "chosen constructor is explicit in copy-initialization" 2015-03-14 15:54:55 +09:00
.gitignore Refactor .gitignore files 2015-03-29 18:40:37 +09:00
HtmlParser.cc Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
HtmlParser.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
HttpServer.cc nghttpd, tiny-nghttpd: No need to check existence of stream 2015-04-05 23:13:29 +09:00
HttpServer.h Add nghttp2_send_data_callback to send DATA payload without copying 2015-04-04 21:23:50 +09:00
Makefile.am nghttpx: Add OCSP stapling feature 2015-03-30 23:58:28 +09:00
app_helper.cc NULL-terminate name and value in nghttp2_nv 2015-03-23 23:25:57 +09:00
app_helper.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
asio_client_request.cc asio: Add client::request::write_trailer() 2015-03-07 23:04:31 +09:00
asio_client_request_impl.cc asio: Add client::request::write_trailer() 2015-03-07 23:04:31 +09:00
asio_client_request_impl.h asio: Add client::request::write_trailer() 2015-03-07 23:04:31 +09:00
asio_client_response.cc asio: Make impl() const 2015-03-05 02:12:31 +09:00
asio_client_response_impl.cc Use header_map instead of wrapping it 2015-03-05 02:12:31 +09:00
asio_client_response_impl.h asio: Separate client API to asio_http2_client.h 2015-03-05 02:12:31 +09:00
asio_client_session.cc asio: Add noexcept for move constructor and move assignment operator 2015-03-07 01:10:49 +09:00
asio_client_session_impl.cc asio: Add client::request::write_trailer() 2015-03-07 23:04:31 +09:00
asio_client_session_impl.h asio: Add client::request::write_trailer() 2015-03-07 23:04:31 +09:00
asio_client_session_tcp_impl.cc asio: Pass connected address to connect_cb 2015-03-05 02:12:31 +09:00
asio_client_session_tcp_impl.h asio: Separate client API to asio_http2_client.h 2015-03-05 02:12:31 +09:00
asio_client_session_tls_impl.cc asio: Pass connected address to connect_cb 2015-03-05 02:12:31 +09:00
asio_client_session_tls_impl.h asio: Separate client API to asio_http2_client.h 2015-03-05 02:12:31 +09:00
asio_client_stream.cc asio: Fix compile error with gcc 2015-03-06 02:05:01 +09:00
asio_client_stream.h asio: Fix compile error with gcc 2015-03-06 02:05:01 +09:00
asio_client_tls_context.cc asio: client::configure_tls_context takes error_code 2015-03-07 01:10:49 +09:00
asio_client_tls_context.h asio: Separate client API to asio_http2_client.h 2015-03-05 02:12:31 +09:00
asio_common.cc asio: Add host_service_from_uri() to extract remote address from URI 2015-03-07 01:10:49 +09:00
asio_common.h asio: Rename *_reader as *_generator and read_cb as generator_cb 2015-03-06 01:47:55 +09:00
asio_io_service_pool.cc asio: Move server classes to dedicated files 2015-03-05 21:42:48 +09:00
asio_io_service_pool.h asio: Move server classes to dedicated files 2015-03-05 21:42:48 +09:00
asio_server.cc asio: Improve date header field precision 2015-03-07 01:10:49 +09:00
asio_server.h asio: Improve date header field precision 2015-03-07 01:10:49 +09:00
asio_server_connection.h asio: Move server classes to dedicated files 2015-03-05 21:42:48 +09:00
asio_server_http2.cc asio: Add noexcept for move constructor and move assignment operator 2015-03-07 01:10:49 +09:00
asio_server_http2_handler.cc asio: Add server::response::write_trailer() 2015-03-07 19:26:42 +09:00
asio_server_http2_handler.h asio: Add server::response::write_trailer() 2015-03-07 19:26:42 +09:00
asio_server_http2_impl.cc asio: Clean up server API to explicitly set error code 2015-03-07 01:10:49 +09:00
asio_server_http2_impl.h asio: Clean up server API to explicitly set error code 2015-03-07 01:10:49 +09:00
asio_server_request.cc asio: Add dtor to API classes 2015-03-05 21:51:44 +09:00
asio_server_request_handler.cc asio: Rewrite response body handling if response body is not expected 2015-03-06 21:36:40 +09:00
asio_server_request_handler.h asio: Make redirect_handler and status_handler part of public API 2015-03-05 23:32:21 +09:00
asio_server_request_impl.cc asio: Move server classes to dedicated files 2015-03-05 21:42:48 +09:00
asio_server_request_impl.h asio: Move server classes to dedicated files 2015-03-05 21:42:48 +09:00
asio_server_response.cc asio: Add server::response::write_trailer() 2015-03-07 19:26:42 +09:00
asio_server_response_impl.cc asio: Add server::response::write_trailer() 2015-03-07 19:26:42 +09:00
asio_server_response_impl.h Fix compile error "chosen constructor is explicit in copy-initialization" 2015-03-14 15:54:55 +09:00
asio_server_serve_mux.cc asio: Fix path matching in server 2015-03-07 01:10:49 +09:00
asio_server_serve_mux.h asio: Add serve_mux class to route incoming requet by path 2015-03-05 02:12:32 +09:00
asio_server_stream.cc asio: Fix compile error with gcc 2015-03-06 02:05:01 +09:00
asio_server_stream.h asio: Fix compile error with gcc 2015-03-06 02:05:01 +09:00
asio_server_tls_context.cc asio: Clean up server API to explicitly set error code 2015-03-07 01:10:49 +09:00
asio_server_tls_context.h asio: Clean up server API to explicitly set error code 2015-03-07 01:10:49 +09:00
base64.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
buffer.h src: Use std::copy_n 2015-02-06 21:35:03 +09:00
buffer_test.cc src: Remove ringbuf.h, use buffer.h instead 2015-02-06 23:40:34 +09:00
buffer_test.h nghttpx: Replace RingBuf with sequential Buffer 2015-01-29 22:57:56 +09:00
comp_helper.c Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
comp_helper.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
deflatehd.cc deflatehd: Fix crash 2014-12-19 23:23:42 +09:00
h2load.cc h2load: Remove unused fields in Client class 2015-03-28 20:17:30 +09:00
h2load.h h2load: Remove unused fields in Client class 2015-03-28 20:17:30 +09:00
h2load_http2_session.cc h2load: Fix compile error with Android NDK 2015-03-30 23:59:03 +09:00
h2load_http2_session.h h2load: Add request stats (time for request min, max, mean and sd) 2015-01-31 23:49:30 +09:00
h2load_session.h h2load: Add request stats (time for request min, max, mean and sd) 2015-01-31 23:49:30 +09:00
h2load_spdy_session.cc h2load: Add -d option to upload data to server 2015-03-26 19:53:42 +09:00
h2load_spdy_session.h h2load: Add request stats (time for request min, max, mean and sd) 2015-01-31 23:49:30 +09:00
http-parser.patch Add patch for http-parser to handle tunneling connection transparently 2012-12-20 01:05:51 +09:00
http2.cc nghttpx: Fix te header field is duplicated when forwarding HTTP/2 backend 2015-03-25 01:17:06 +09:00
http2.h asio: Rewrite response body handling if response body is not expected 2015-03-06 21:36:40 +09:00
http2_test.cc nghttpx: Fix te header field is duplicated when forwarding HTTP/2 backend 2015-03-25 01:17:06 +09:00
http2_test.h nghttpx: Support server push using Link header field 2015-02-08 16:10:00 +09:00
inflatehd.cc Support custom memory allocator 2014-12-08 00:55:55 +09:00
libevent_util.cc Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
libevent_util.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
libnghttp2_asio.pc.in Add C++ library libnghttp2_asio on top of libnghttp2 2014-09-24 00:45:40 +09:00
memchunk.h src: Use std::copy_n 2015-02-06 21:35:03 +09:00
memchunk_test.cc src: Move array_size to nghttp2 namespace 2015-02-06 22:44:09 +09:00
memchunk_test.h src: Add test for memchunk.h 2015-01-10 23:01:03 +09:00
nghttp.cc src: Use separator "--" to mark start of the footer without ambiguity 2015-03-31 00:21:52 +09:00
nghttp.h nghttp: Refactor function names 2015-03-28 20:07:12 +09:00
nghttp2_config.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
nghttp2_gzip.c Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
nghttp2_gzip.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
nghttp2_gzip_test.c Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
nghttp2_gzip_test.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
nghttpd.cc src: Use separator "--" to mark start of the footer without ambiguity 2015-03-31 00:21:52 +09:00
shrpx-unittest.cc asio: Make redirect_handler use passed uri as is and percent-encode path part 2015-03-05 23:23:17 +09:00
shrpx.cc nghttpx: Remove --tls-ctx-per-worker option 2015-03-31 00:42:21 +09:00
shrpx.h Compile with android NDK 2015-01-11 00:28:00 +09:00
shrpx_accept_handler.cc nghttpx: Disable acceptor temporarily when process runs out of fd 2015-03-10 21:25:20 +09:00
shrpx_accept_handler.h nghttpx: Rename ListenHandler as ConnectionHandler 2015-01-08 21:48:39 +09:00
shrpx_client_handler.cc nghttpx: Fix bug that data buffered in SSL object are not read 2015-04-06 22:31:36 +09:00
shrpx_client_handler.h nghttpx: Pin HTTP/2 upstream to one Http2Session to improve performance 2015-03-11 21:14:55 +09:00
shrpx_config.cc nghttpx: Remove --tls-ctx-per-worker option 2015-03-31 00:42:21 +09:00
shrpx_config.h nghttpx: Remove --tls-ctx-per-worker option 2015-03-31 00:42:21 +09:00
shrpx_config_test.cc nghttpx: Add --tls-ticket-key-file option 2015-01-08 01:26:30 +09:00
shrpx_config_test.h nghttpx: Add --tls-ticket-key-file option 2015-01-08 01:26:30 +09:00
shrpx_connect_blocker.cc nghttpx: Don't call ev_TYPE_set macro while watcher is active 2015-01-21 21:43:49 +09:00
shrpx_connect_blocker.h src: Use libev for rest of the applications 2015-01-03 00:19:41 +09:00
shrpx_connection.cc nghttpx: Fix bug that data buffered in SSL object are not read 2015-04-06 22:31:36 +09:00
shrpx_connection.h nghttpx: Fix bug that data buffered in SSL object are not read 2015-04-06 22:31:36 +09:00
shrpx_connection_handler.cc nghttpx: Remove --tls-ctx-per-worker option 2015-03-31 00:42:21 +09:00
shrpx_connection_handler.h nghttpx: Add OCSP stapling feature 2015-03-30 23:58:28 +09:00
shrpx_downstream.cc nghttpx: Simplify backend request line construction 2015-03-14 00:09:10 +09:00
shrpx_downstream.h nghttpx: Simplify backend request line construction 2015-03-14 00:09:10 +09:00
shrpx_downstream_connection.cc Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
shrpx_downstream_connection.h nghttpx: Support multiple HTTP/2 session per worker 2015-03-10 23:20:21 +09:00
shrpx_downstream_connection_pool.cc Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
shrpx_downstream_connection_pool.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
shrpx_downstream_queue.cc nghttpx: Refactor DownstreamQueue to avoid expensive std::map 2015-03-12 01:13:55 +09:00
shrpx_downstream_queue.h nghttpx: Refactor DownstreamQueue to avoid expensive std::map 2015-03-12 01:13:55 +09:00
shrpx_downstream_test.cc nghttpx: Fix location rewrite, take 2 2015-02-08 21:26:47 +09:00
shrpx_downstream_test.h nghttpd, nghttpx: Rework incoming header handling 2015-01-05 01:46:41 +09:00
shrpx_error.h Share I/O code with all upstreams/downstream objects 2015-02-05 03:05:34 +09:00
shrpx_http.cc src: Add missing dquote in HTML 2015-03-05 23:34:42 +09:00
shrpx_http.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
shrpx_http2_downstream_connection.cc nghttpx: Forward only "trailers" keyword in te when forwarding HTTP/2 backend 2015-03-25 01:20:41 +09:00
shrpx_http2_downstream_connection.h nghttpx: Use doubly linked list for dconns_ and streams_ 2015-03-11 21:35:47 +09:00
shrpx_http2_session.cc nghttpx: Rename Http2Session::on_connect as connection_made 2015-03-28 20:19:17 +09:00
shrpx_http2_session.h nghttpx: Rename Http2Session::on_connect as connection_made 2015-03-28 20:19:17 +09:00
shrpx_http2_upstream.cc nghttpx: Fix PUSH_PROMISE header field corruption 2015-03-26 22:52:51 +09:00
shrpx_http2_upstream.h nghttpx: Refactor DownstreamQueue to avoid expensive std::map 2015-03-12 01:13:55 +09:00
shrpx_http_downstream_connection.cc nghttpx: Add flag to track connection state in HTTP/1 backend 2015-03-29 01:47:22 +09:00
shrpx_http_downstream_connection.h nghttpx: Add flag to track connection state in HTTP/1 backend 2015-03-29 01:47:22 +09:00
shrpx_https_upstream.cc nghttpx: Simplify backend request line construction 2015-03-14 00:09:10 +09:00
shrpx_https_upstream.h nghttpx: Return 503 on hard disconnect in HTTP/2 backend 2015-01-21 23:30:48 +09:00
shrpx_io_control.cc nghttpx: Remove unused IOControl::set_lim 2015-01-03 00:19:41 +09:00
shrpx_io_control.h nghttpx: Remove unused IOControl::set_lim 2015-01-03 00:19:41 +09:00
shrpx_log.cc replacing thread_local, which does not exist on OS X, with pthread_getspecific call 2015-03-03 17:09:15 +01:00
shrpx_log.h replacing thread_local, which does not exist on OS X, with pthread_getspecific call 2015-03-03 17:09:15 +01:00
shrpx_log_config.cc Merge branch 'pthread-getspecific' of https://github.com/icing/nghttp2 into icing-pthread-getspecific 2015-03-05 02:04:56 +09:00
shrpx_log_config.h replacing thread_local, which does not exist on OS X, with pthread_getspecific call 2015-03-03 17:09:15 +01:00
shrpx_rate_limit.cc nghttpx: Fix bug that data buffered in SSL object are not read 2015-04-06 22:31:36 +09:00
shrpx_rate_limit.h nghttpx: Fix bug that data buffered in SSL object are not read 2015-04-06 22:31:36 +09:00
shrpx_spdy_upstream.cc nghttpx: Refactor DownstreamQueue to avoid expensive std::map 2015-03-12 01:13:55 +09:00
shrpx_spdy_upstream.h nghttpx: Refactor DownstreamQueue to avoid expensive std::map 2015-03-12 01:13:55 +09:00
shrpx_ssl.cc nghttpx: Add OCSP stapling feature 2015-03-30 23:58:28 +09:00
shrpx_ssl.h nghttpx: Add OCSP stapling feature 2015-03-30 23:58:28 +09:00
shrpx_ssl_test.cc src: Move array_size to nghttp2 namespace 2015-02-06 22:44:09 +09:00
shrpx_ssl_test.h src: Use C++ style comments for C++ source code 2014-05-14 23:22:23 +09:00
shrpx_upstream.h nghttpx: Return 503 on hard disconnect in HTTP/2 backend 2015-01-21 23:30:48 +09:00
shrpx_worker.cc nghttpx: Support multiple HTTP/2 session per worker 2015-03-10 23:20:21 +09:00
shrpx_worker.h nghttpx: Support multiple HTTP/2 session per worker 2015-03-10 23:20:21 +09:00
ssl.cc Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
ssl.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
template.h nghttpx: Refactor DownstreamQueue to avoid expensive std::map 2015-03-12 01:13:55 +09:00
timegm.c Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
timegm.h Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
util.cc nghttpx: Add OCSP stapling feature 2015-03-30 23:58:28 +09:00
util.h nghttp, nghttpd: Add --hexdump option to hexdump incoming traffic 2015-03-24 02:30:51 +09:00
util_test.cc nghttpx: Add OCSP stapling feature 2015-03-30 23:58:28 +09:00
util_test.h asio: Make redirect_handler use passed uri as is and percent-encode path part 2015-03-05 23:23:17 +09:00