Commit Graph

115 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa 0cd26d6f3b nghttp: Remove garbage for deprecated per-stream compression which cause leak 2014-06-19 23:35:58 +09:00
Tatsuhiro Tsujikawa 1ee847c21a nghttp: Code cleanup 2014-06-12 22:48:40 +09:00
Tatsuhiro Tsujikawa 3db8935e20 Remove per-frame compression 2014-06-07 16:04:43 +09:00
Tatsuhiro Tsujikawa 8c67bbe3a8 src: Avoid copy in evbuffer_pullup()
Previously, we use evbuffer_pullup(buf, -1) to linearize the memory
region and it may cause buffer copy.  To avoid this, we use the return
value of evbuffer_get_contiguous_space() as 2nd parameter.  According
to the libevent manual, by doing so evbuffer_pullup() will not copy or
modify any data in evbuffer.
2014-06-01 21:01:01 +09:00
Tatsuhiro Tsujikawa 3b5b5ce254 Update http-parser to 8d9e5db981b623fffc93657abacdc80270cbee58 2014-05-16 00:23:03 +09:00
Tatsuhiro Tsujikawa 2ae1da113e src: Use C++ style comments for C++ source code 2014-05-14 23:22:23 +09:00
Tatsuhiro Tsujikawa 1bd43e094a nghttp: Remove streams from HttpClient 2014-05-08 00:29:46 +09:00
Tatsuhiro Tsujikawa e8de437d5c Return new stream ID from nghttp2_submit_{request, headers, push_promise}
Previously stream ID was assigned just before HEADERS or PUSH_PROMISE
was serialized and nghttp2_submit_{request, headers, push_promise} did
not return stream ID.  The application has to check assigned stream ID
using before_frame_send_callback.  Now it is apparent that priority is
meant to DATA transfer only.  Also application can reorder the
requests if it wants. Therefore we can assign stream ID in
nghttp2_submit_* functions and return stream ID from them.  With this
change, now application does not have to check stream ID using
before_frame_send_callback and its code will be simplified.
2014-05-07 23:24:07 +09:00
Tatsuhiro Tsujikawa 4f027c1562 libnghttp2: Remove dependency to zlib
We inherited gzip compression API from spdylay codebase.  In spdylay,
the cost of having such API is almost free because spdylay requires
zlib for header compression.  nghttp2 no longer uses gzip to header
compression.  zlib dependency exists just for gzip compression API,
which is not an essential.  So we decided to move gzip code to under
src and remove zlib dependency from libnghttp2 itself.  As nghttp2
package, we depend on zlib to compile tools under src.
2014-05-06 23:10:50 +09:00
Tatsuhiro Tsujikawa 9125499dd0 src: Implement per-frame DATA compression
Currently, nghttpd server only compresses files whose extensions are
one of .html, .js, .css and .txt.  nghttp advertises its support of
per-frame compression in SETTINGS frame.  To implement this feature,
we added 2 public API: nghttp2_session_get_remote_settings() and
nghttp2_gzip_inflate_finished().
2014-05-03 00:02:17 +09:00
Tatsuhiro Tsujikawa abe74f869f Ditto 7730b13e5a 2014-04-30 22:44:51 +09:00
Tatsuhiro Tsujikawa bc50062964 nghttp: Fix crash on PUSH_PROMISE 2014-04-29 15:08:57 +09:00
Tatsuhiro Tsujikawa 6d5f402380 Add nghttp2_adjust_priority_callback
Callback function invoked to adjust priority value for request
HEADERS.

Since the application doesn’t know stream ID when it submits
requests, it may not be able to add correct priority value to HEADERS
frame and forced to use follwing PRIORITY frame. The purpose of this
callback is give the chance to the application to adjust priority
value with the latest information it has just before transmission so
that correct priority is included in HEADERS frame and it doesn’t
have to send additional PRIORITY frame.
2014-04-27 14:48:43 +09:00
Tatsuhiro Tsujikawa 293b717b04 nghttp: Fix bug that -H does not allow single letter header name 2014-04-26 14:53:03 +09:00
Tatsuhiro Tsujikawa 078b1de12e nghttp: Fix uninitialized pri_spec 2014-04-25 21:23:47 +09:00
Tatsuhiro Tsujikawa ac86b51e37 Implement simplified dependency based priority 2014-04-15 22:55:07 +09:00
Tatsuhiro Tsujikawa c2bb9c01a6 nghttp: Update doc for -p option and improve error handling for it 2014-04-05 19:15:45 +09:00
Tatsuhiro Tsujikawa e7ad3633c7 nghttp2_data_source_read_callback: Replace eof with uint32_t *data_flags
Replace int *eof with uint32_t *data_flags so that we can easily
extend functionality if we have to (but we don't do if possible).
2014-04-05 17:59:24 +09:00
Tatsuhiro Tsujikawa d668d2448b Hide session option from public API
To make adding new option easier, we decided to make the details of
option struct private and hide it from public API.  We provide
functions to set individual option value.
2014-04-04 21:57:47 +09:00
Tatsuhiro Tsujikawa 1d38df0a31 nghttp: Don't index authorization header field for debugging purpose 2014-04-03 11:33:15 +09:00
Tatsuhiro Tsujikawa b1edb1f3ae Don't index name/value pair bearing NO_INDEX flag when forwarding it 2014-04-03 11:22:11 +09:00
Tatsuhiro Tsujikawa c9f90924a9 Add flags parameter to nghttp2_on_header_callback 2014-04-02 02:10:35 +09:00
Tatsuhiro Tsujikawa 34581d830d Define NGHTTP2_CLEARTEXT_PROTO_VERSION_ID
This identifier string is used if HTTP/2 is used over cleartext TCP.
2014-03-30 21:30:47 +09:00
Tatsuhiro Tsujikawa 60a2c260a5 Define NGHTTP2_CLIENT_CONNECTION_PREFACE macro
NGHTTP2_CLIENT_CONNECTION_PREFACE has the same content with
NGHTTP2_CLIENT_CONNECTION_HEADER, which is now obsoleted by
NGHTTP2_CLIENT_CONNECTION_PREFACE.
2014-03-30 21:02:25 +09:00
Tatsuhiro Tsujikawa ab2dc5967d Replace HTTP/2.0 with HTTP/2 2014-03-30 19:26:37 +09:00
Tatsuhiro Tsujikawa f7162ab702 Implement dependency based priority 2014-03-30 01:24:16 +09:00
Tatsuhiro Tsujikawa a457d2a138 h2load, nghttp: Use SNI field for non-numeric host 2014-03-15 15:32:38 +09:00
Tatsuhiro Tsujikawa 7ffa594d4c nghttp: Use raw-literal string for help output 2014-03-14 01:53:28 +09:00
Tatsuhiro Tsujikawa 27e161dc31 src: Add EvbufferBuffer class to simplify the code base 2014-03-05 00:23:33 +09:00
Tatsuhiro Tsujikawa a85455ed0b src: Zero clear http_parser_url struct 2014-02-27 22:11:31 +09:00
Tatsuhiro Tsujikawa 227a48cea1 src: Move http_parser_url related functions to util 2014-02-27 21:53:52 +09:00
Tatsuhiro Tsujikawa 9cc7f9fb36 nghttp: Wait for pushed resources to complete
The statistics of pushed resources are also calculated.
2014-02-25 01:16:47 +09:00
Tatsuhiro Tsujikawa 1e1e77ad5e nghttp: Use nghttp2_session_mem_recv and nghttp2_session_mem_send 2014-02-19 23:27:52 +09:00
Tatsuhiro Tsujikawa f5342494f4 src: Format help message and add --version to make man page generation easier 2014-02-16 19:39:41 +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 118ed09da5 Allow disabling padding 2014-02-09 23:53:53 +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 be9d5efa4c nghttp: Add --continuation option to test CONTINUATION 2014-02-08 00:23:18 +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 878afd7df1 nghttp: Fix bad handling of addrinfo 2014-01-28 01:40:00 +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 1f4577adb9 nghttp: Use getaddrnfo directly instead of using evdns_base
evdns_base uses /etc/resolve.conf for *nix like systems,
but all platforms don't have the file (e.g., android device).
For such platforms, address resolution fails.
To fix this problem we use getaddrinfo() directly.
2014-01-23 00:29:09 +09:00
Tatsuhiro Tsujikawa 9cd90bcff2 nghttp: Fix host to connect when SSL/TLS is used 2014-01-22 21:55:30 +09:00