Commit Graph

83 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa ab2dc5967d Replace HTTP/2.0 with HTTP/2 2014-03-30 19:26:37 +09:00
Tatsuhiro Tsujikawa 0a80b0c1aa nghttpd: Set write timeout for stream blocked by flow controll only
This change also reset read timeout when we have sent HEADERS,
PUSH_PROMISE or DATA.
2014-03-22 00:41:01 +09:00
Tatsuhiro Tsujikawa fac42788bc nghttpd: Rename Request as Stream 2014-03-21 23:26:53 +09:00
Tatsuhiro Tsujikawa 464fef7c6e nghttpd: Add HTTP/2 stream read/write timeout 2014-03-21 23:07:20 +09:00
Tatsuhiro Tsujikawa c048ac5eff nghttpd: Avoid to use bufferevent for connection 2014-03-18 00:09:59 +09:00
Tatsuhiro Tsujikawa fef01a3c39 nghttpd: Honor server's cipher preferece order 2014-03-15 16:11:30 +09:00
Tatsuhiro Tsujikawa a7eb6502a9 src: Use large transmission buffer to reduce SSL/TLS overhead 2014-03-15 16:10:42 +09:00
Tatsuhiro Tsujikawa 0620052f50 src: Use std::numeric_limits<>::max() instead of INT64_MAX 2014-03-14 00:54:10 +09:00
Tatsuhiro Tsujikawa 27e161dc31 src: Add EvbufferBuffer class to simplify the code base 2014-03-05 00:23:33 +09:00
Tatsuhiro Tsujikawa 3ca4539f99 nghttpd: Only emit content-encoding: gzip when error-gzip is on 2014-03-04 23:37:42 +09:00
Tatsuhiro Tsujikawa a61ca763df nghttpd: Add -e option to toggle gzipped error response 2014-03-04 23:29:30 +09:00
Tatsuhiro Tsujikawa caeeba681f nghttpd: Add multi threading support 2014-03-04 23:14:26 +09:00
Tatsuhiro Tsujikawa f3183efe04 nghttpd: Emit protocol id error only when verbose output is enabled 2014-03-03 23:51:46 +09:00
Tatsuhiro Tsujikawa b5341ebac6 nghttpd: More SSL_CTX options and support EDCHE cipher 2014-03-03 23:49:13 +09:00
Tatsuhiro Tsujikawa e34b8ac7fb src: Avoid to call costly evbuffer_add() repeatedly
The profiler and benchmarking showed that calling evbuffer_add()
repeatedly is very costly. To avoid this, we buffer up small writes
into one large chunk and call evbuffer_add() less times.
2014-03-03 23:45:57 +09:00
Tatsuhiro Tsujikawa d1c1deaf03 Add promised_stream_user_data parameter to nghttp2_submit_push_promise
This is very useful to associate application specific data to promised
stream.

nghttp2_nv_array_copy now does not complain the header field is large.
2014-02-25 00:26:12 +09:00
Tatsuhiro Tsujikawa fc25143418 Remove END_PUSH_PROMISE in favor of END_HEADERS 2014-02-21 21:23:51 +09:00
Tatsuhiro Tsujikawa bbc09b005b nghttpd: Use nghttp2_session_mem_recv and nghttp2_session_mem_send 2014-02-19 23:27:53 +09:00
Tatsuhiro Tsujikawa 1fd5fdd54a src: Remove redundant SETTINGS_ENABLE_PUSH from server side 2014-02-16 16:05:26 +09:00
Tatsuhiro Tsujikawa 7504d89f9b src: Add at most N bytes as padding if --padding option is used 2014-02-15 16:40:32 +09:00
Tatsuhiro Tsujikawa cd3eae3dd2 src: Fix select_padding_callback which returns value greater than max_payload 2014-02-11 19:19:00 +09:00
Tatsuhiro Tsujikawa 39fe7a5cfa Don't set select_padding_callback if padding_boundary is 0 or not set 2014-02-11 16:48:27 +09:00
Tatsuhiro Tsujikawa 78d202ac30 Callback based padding from application
Now previous padding options are removed and instead we added
select_padding_callback to select padding length for each frame
by application. If this callback is not implemented by application,
no padding is added.

This change also fixes the broken session_detect_idle_stream()
if stream_id is our side.
2014-02-11 15:28:44 +09:00
Tatsuhiro Tsujikawa 68b5ffc1dc Rename padding related names 2014-02-09 21:46:15 +09:00
Tatsuhiro Tsujikawa 1db2195389 Implement padding for HEADERS and CONTINUATION 2014-02-09 15:17:26 +09:00
Tatsuhiro Tsujikawa 814d0f76f3 Implement DATA frame padding 2014-02-08 00:23:18 +09:00
Tatsuhiro Tsujikawa c79adf6997 Remove flow control disabling feature 2014-02-06 00:23:20 +09:00
Tatsuhiro Tsujikawa e186e01933 Replace on_end_headers_callback with on_begin_headers_callback
Previously, there is inconsistency when on_frame_recv_callback
is called between HEADERS/PUSH_PROMISE and the other frames.
For former case, it is called before header block, in latter
case, it is called after whole frame is received. To make it
consistent, we call on_frame_recv_callback for HEADERS/PUSH_PROMISE
after its frame is fully received. Since on_frame_recv_callback
can signal the end of header block, we replaced on_end_headers_callback
with on_begin_headers_callback, which is called when the reception
of the header block is started.
2014-01-29 21:23:13 +09:00
Tatsuhiro Tsujikawa ce434d56a7 src: Print header emission with stream_id
Since all headers are not always longer available on one
nghttp2_session_mem_recv call, received headers may be interleaved
with transmission log of the other frames. To make it clear that
each header belongs to which stream, each header is printed with
stream_id.
2014-01-28 00:20:48 +09:00
Tatsuhiro Tsujikawa a3082b7c1e Remove nghttp2_on_data_recv_callback and nghttp2_on_data_send_callback
nghttp2_data is added to nghttp2_frame union. When DATA is
received, nghttp2_on_frame_recv_callback is called. When DATA is
sent, nghttp2_on_frame_send_callback is called.
2014-01-27 22:16:05 +09:00
Tatsuhiro Tsujikawa 545f24bc1b Remove nghttp2_on_frame_recv_parse_error_callback 2014-01-26 23:23:07 +09:00
Tatsuhiro Tsujikawa dfbea797bd src: Use static_cast instead of reinterpret_cast if possible 2014-01-19 21:18:37 +09:00
Tatsuhiro Tsujikawa 707a0b4103 Move name/value validation functions to src
nghttp2 library itself now accept octet header/value pairs,
completely not restricted by HTTP/1 header name/value rule.
The applications may impose restriction about them using
validators.
2014-01-17 02:16:53 +09:00
Tatsuhiro Tsujikawa 0e4b3d435e Emit header name/value pair using callback functions
Now, in nghttp2_on_frame_recv_callback, nva and nvlen in
HEADERS and PUSH_PROMISE frames are always NULL and 0 respectively.
The header name/value pairs are emitted successive
nghttp2_on_header_callback functions. The end of header fields are
signaled with nghttp2_on_end_headers_callback function.

Since NGHTTP2_ERR_PAUSE for nghttp2_on_frame_recv_callback is
introduced to handle header block, it is now deprecated.
Instead, nghttp2_on_header_callback can be paused using
NGHTTP2_ERR_PAUSE.
2014-01-17 01:49:43 +09:00
Tatsuhiro Tsujikawa 88d31ada75 src: Handle PUSH_PROMISE from client and request HEADERS from server
They are just RST_STREAMed for now
2014-01-09 23:47:21 +09:00
Tatsuhiro Tsujikawa c36ce28f69 src: Call SSL_set_shutdown(ssl, SSL_RECEIVED_SHUTDOWN) 2014-01-08 23:32:47 +09:00
Tatsuhiro Tsujikawa 78e5149495 src: Support ALPN
Requires unreleased OpenSSL >= 1.0.2
2014-01-02 00:15:08 +09:00
Tatsuhiro Tsujikawa c0726036b1 nghttpd: Use -1 as backlog 2013-12-27 00:02:43 +09:00
Tatsuhiro Tsujikawa 9cb8754d09 Rename nghttp2_session_fail_session as nghttp2_session_terminate_session 2013-12-26 00:23:07 +09:00
Tatsuhiro Tsujikawa 04e496d7bd nghttpd: Use nghttp2_session_fail_session instead of nghttp2_submit_goaway 2013-12-25 00:40:57 +09:00
Tatsuhiro Tsujikawa bb70cdf6ad src: Rename verbose callback functions 2013-12-20 23:48:56 +09:00
Tatsuhiro Tsujikawa c3a361fb52 nghttpd: Create Request object in hd_before_frame_send_callback
This is pathological case, but we may get RST_STREAM to the promised
stream while we are sending PUSH_PROMISE. To handle this case,
instantiate Request object before transmission.
2013-12-09 00:22:01 +09:00
Tatsuhiro Tsujikawa ed1d7cdea4 nghttpd: Fix allow_push is not used 2013-12-09 00:04:54 +09:00
Tatsuhiro Tsujikawa 47f53940da nghttpd: Add -p, --push option to configure server push
The option syntax is <PATH>=<PUSH_PATH,...>.
Push resources PUSH_PATHs when PATH is requested. This option can be used
repeatedly to specify multiple push configurations. For example,
  -p/=/foo.png -p/doc=/bar.css
PATH and PUSH_PATHs are relative to document root.
2013-12-09 00:00:12 +09:00
Tatsuhiro Tsujikawa 658b7d0727 src: Replace MAKE_NV macros with function templates 2013-12-08 22:31:43 +09:00
Tatsuhiro Tsujikawa 6c77cec270 Remove nghttp2_submit_* API functions which has char **nv parameter
The nghttp2_submit_{request,response}2 functions are renamed as
nghttp2_submit_{request, response}.
2013-12-08 21:39:43 +09:00
Tatsuhiro Tsujikawa 6ea91e57e0 Adjust struct/class alignment 2013-12-06 23:17:38 +09:00
Tatsuhiro Tsujikawa e596385fc0 src: Split NULL-separated values 2013-12-05 21:54:36 +09:00
Tatsuhiro Tsujikawa 40347487c9 Don't sort headers in library code
Remove sorting headers from library code. The application must sort
them if necessary. nghttpx and nghttpd do the sorting of the headers
in stable way if names are equal.
2013-11-13 23:56:02 +09:00
Tatsuhiro Tsujikawa e684b8149b nghttpd: Fix -c option 2013-11-06 23:32:32 +09:00