Commit Graph

143 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa 7b9a8acc22 Add HPACK deflation API 2014-05-13 23:42:55 +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 855f39743a Fix crash when indexed repr index=0 2014-05-01 09:06:54 +09:00
Tatsuhiro Tsujikawa 853c9888d9 Distribute effective weight among only streams with marked as top
If stream with dpri value of no_data, we check any its descendant has
stream with dpri value of top.  If so, we have to distribute of its
portion of weight to its descendants.
2014-04-24 23:37:40 +09:00
Tatsuhiro Tsujikawa aa4d43f31e Allow exclusive dependency to stream 0 2014-04-17 21:18:18 +09:00
Tatsuhiro Tsujikawa ac86b51e37 Implement simplified dependency based priority 2014-04-15 22:55:07 +09:00
Tatsuhiro Tsujikawa 7877b676e3 Honor NGHTTP2_NV_FLAG_NO_INDEX in deflater and inflater 2014-04-02 01:25:44 +09:00
Tatsuhiro Tsujikawa f785e56dba Implement ALTSVC frame 2014-04-01 21:47:51 +09:00
Tatsuhiro Tsujikawa ab2dc5967d Replace HTTP/2.0 with HTTP/2 2014-03-30 19:26:37 +09:00
Tatsuhiro Tsujikawa 74daa16a1c Retain incoming closed streams for dependency tree
The number of closed stream to keep is limited by
MAX_CONCURRENT_STREAMS - current active stream.
2014-03-30 17:41:54 +09:00
Tatsuhiro Tsujikawa f7162ab702 Implement dependency based priority 2014-03-30 01:24:16 +09:00
Tatsuhiro Tsujikawa 2ec4b10805 Add nghttp2_buf tests 2014-03-14 21:40:14 +09:00
Tatsuhiro Tsujikawa 0666a73e10 Remove nghttp2_buffer 2014-03-11 21:20:51 +09:00
Tatsuhiro Tsujikawa 358b4386d3 Introduce nghttp2_buf to ease buffer management 2014-03-11 01:47:38 +09:00
Tatsuhiro Tsujikawa 54dab50015 Support END_SEGMENT in nghttp2_submit_data() 2014-03-06 00:19:02 +09:00
Tatsuhiro Tsujikawa 1e95c8b313 Allow always max 1024 padding for HEADERS
We need paddings regardless of payload and frame boundary to mitigate
certain attacks.

Since we handles CONTINUATION internally, we don't show FLAG_PAD_HIGH
and PAD_LOW flags of HEADERS in nghttp/nghttpd. We just show the
total paddings in HEADERS + CONTINUATION.
2014-02-15 01:34:04 +09:00
Tatsuhiro Tsujikawa fd88c6160d HPACK post -05 updates
* Use 1 Huffman code table for both request and response
* Remove complicated deflater side table size management
* Add encoding context update
* Fix memory leak in inflater
2014-02-13 23:22:52 +09:00
Tatsuhiro Tsujikawa 7822bbd7e8 Fix PAD_HIGH and PAD_LOW are not counted in flow control 2014-02-11 21:30:44 +09:00
Tatsuhiro Tsujikawa e78a2100ec Merge branch 'master' into draft-10 2014-02-11 16:03:42 +09:00
Tatsuhiro Tsujikawa cacf4ecf26 Fix premature header block is not treated as connection error 2014-02-11 16:00:59 +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 945c57c335 Add test for nghttp2_frame_pack_headers with padding 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 8be17f077a Add nghttp2_check_header_name and nghttp2_check_header_value APIs
These are promoted to public API from src/http2.h
2014-02-01 19:31:50 +09:00
Tatsuhiro Tsujikawa ab684a9f30 Remove nghttp2_on_request_recv_callback
It is easy enough to check the end of incoming data by evaluating
frame->hd.flags & NGHTTP2_FLAG_END_STREAM in on_frame_recv_callback
2014-01-29 21:56:01 +09:00
Tatsuhiro Tsujikawa 9314e30987 Support transmission of CONTINUATION, change nghttp2_frame_hd
The maximum frame size including header block is still limited
to NGHTTP2_HD_MAX_BUFFER_LENGTH, which is 32KB.
2014-01-26 23:10:33 +09:00
Tatsuhiro Tsujikawa 91401cfe26 Support CONTINUATION frame reception 2014-01-26 20:31:28 +09:00
Tatsuhiro Tsujikawa 8317559090 nghttp2_hd: Implement stream header inflater
This stream inflater can inflate incoming header block in streaming
fashion. Currently, we buffer up single name/value pair, but we chose
far more smaller buffer size than HTTP/2 frame size.
2014-01-25 18:24:15 +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 dfcdea894b Move header name/value pair validation to on_*_received functions 2013-12-25 23:38:55 +09:00
Tatsuhiro Tsujikawa 7c4dbb6ffc nghttp2_hd: Don't malloc if huffman encoded string has 0 length 2013-12-19 23:19:14 +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 40a666e7d1 Add nghttp2_submit_response2 tests 2013-11-28 21:47:10 +09:00
Tatsuhiro Tsujikawa 3d863ed254 nghttp2_hd: Clear reference set with index 0 2013-11-16 17:05:18 +09:00
Tatsuhiro Tsujikawa 8cd2b57f8a tests: Add test for header compression without indexing 2013-11-03 18:30:57 +09:00
Tatsuhiro Tsujikawa 2e7bc014e1 Return 0 if recv_window_size is negative; add tests 2013-10-30 01:58:38 +09:00
Tatsuhiro Tsujikawa 6c99ff12c9 nghttp2_hd: Rename local as deflate 2013-10-29 00:42:08 +09:00
Tatsuhiro Tsujikawa 67ce60544e Change maximum frame length to 16383 2013-10-27 21:17:09 +09:00
Tatsuhiro Tsujikawa cbdd44c4ae nghttp2_hd: Implement local header table size limit for encoder 2013-10-26 18:49:23 +09:00
Tatsuhiro Tsujikawa 8cf3731802 Experiment HPACK with upcoming changes
* remove substitution
* reversed insertion and removal from header table
* unified initial static table
2013-10-12 21:49:01 +09:00
Tatsuhiro Tsujikawa 21d76dcc75 Add nghttp2_session_continue API function
The NGHTTP2_ERR_PAUSE library error code is introduced to pause
the execution of nghttp2_session_mem_recv() when that error code
is returned from nghttp2_on_frame_recv_callback or
nghttp2_on_data_chunk_recv_callback. If this happens, the parameters
available for both callbacks are retained until the application
calls nghttp2_session_continue(). The application must retain
input bytes which was used to produce the frame.
After successful call of nghttp2_session_continue, the application
can continue to call nghttp2_session_mem_recv() to process
additional data.
2013-09-28 17:59:24 +09:00
Tatsuhiro Tsujikawa 94263216fb Add nghttp2_submit_request2
This function is similar to nghttp2_submit_request and the
difference is it takes an array of nghttp2_nv as name/value pairs.
It is useful if name/value pairs is not NULL-terminated in the
application code.
2013-09-11 00:55:35 +09:00
Tatsuhiro Tsujikawa 2c127b5cb6 Remove unused functions/macros 2013-09-07 15:48:16 +09:00
Tatsuhiro Tsujikawa 4dcf9ad4f2 Make hd encoder ordering aware and one-pass
The encoder algorithm is simplified and it now preserves ordering
of the headers. It also becomes one-pass encoder.
2013-09-06 21:53:28 +09:00
Tatsuhiro Tsujikawa 83b0c89e3c Handle indexing entry greater than header table limit without error 2013-08-28 23:16:23 +09:00
Tatsuhiro Tsujikawa b37f99ca03 Connection error if payload size is strictly greater than (1 << 14) - 1
It would be desired to add option to make this limit configurable.
Fix scripted_recv_callback in tests.
2013-08-28 02:13:57 +09:00
Tatsuhiro Tsujikawa 82b9f78fc7 Check incoming header field name strictly
The validation rule is described in
http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-02#section-4.1.2
2013-08-25 17:39:29 +09:00
Tatsuhiro Tsujikawa 005e60a5ed Rework header compression 2013-08-23 23:38:28 +09:00
Tatsuhiro Tsujikawa 346fafde3f Implement draft-ietf-httpbis-header-compression-02 2013-08-23 03:33:05 +09:00