Commit Graph

799 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa 2878e1e258 Refactor storage of settings
Now local and remote settings values are stored in dedicated structure
nghttp2_settings_storage.
2014-06-10 21:29:19 +09:00
Tatsuhiro Tsujikawa 4596f73ee0 Fix unused header_cb_arg structure 2014-06-09 23:21:55 +09:00
Tatsuhiro Tsujikawa caf3e1c035 Fix compile error with --enable-debug 2014-06-09 23:21:30 +09:00
Tatsuhiro Tsujikawa dacc9b2f1c Separate extension frames from core frames
ALTSVC and BLOCKED frames are now extension frames.  To add new
extension frame without modifying nghttp2_frame union, which causes so
name bump, we separated extension frames from core frames.
nghttp2_frame includes generic nghttp2_extension.  The payload member
of nghttp2_extension will point to the structure of extension frame
payload.  The frame types of extension frames are defined in
nghttp2_ext_frame_type.
2014-06-09 23:16:54 +09:00
Tatsuhiro Tsujikawa 317b8baa4f Set HTTP/2 protocol id to h2-13 for now 2014-06-07 19:39:14 +09:00
Tatsuhiro Tsujikawa d4602a0991 Remove reserved field from ALTSVC frame 2014-06-07 19:10:09 +09:00
Tatsuhiro Tsujikawa 3daeadcb07 Remove bogus comments 2014-06-07 18:51:20 +09:00
Tatsuhiro Tsujikawa 19729962a3 Check stream_id is nonzero for DATA, HEADERS, PRIORITY, RST_STREAM, PUSH_PROMISE 2014-06-07 18:48:37 +09:00
Tatsuhiro Tsujikawa bfaab30733 Allow transmission and reception of PRIORITY frame to a closed stream 2014-06-07 18:36:58 +09:00
Tatsuhiro Tsujikawa c46d3dafc6 Remove PAD_HIGH and Pad High field
CONTINUATION now doesn't have padding.
2014-06-07 18:15:36 +09:00
Tatsuhiro Tsujikawa 70c86979e8 Ignore unknown settings ID 2014-06-07 16:41:36 +09:00
Tatsuhiro Tsujikawa d402ba6fa2 Make settings_id 2 bytes field 2014-06-07 16:37:29 +09:00
Tatsuhiro Tsujikawa 458ccb3681 Ignore unknown frame types
Unexpected CONTINUATION frame is handled separately as connection
error.
2014-06-07 16:30:55 +09:00
Tatsuhiro Tsujikawa 3db8935e20 Remove per-frame compression 2014-06-07 16:04:43 +09:00
Tatsuhiro Tsujikawa eb0a894ede Merge branch 'Wshadow' of https://github.com/alagoutte/nghttp2 into alagoutte-Wshadow 2014-06-04 23:34:04 +09:00
Alexis La Goutte 6b08534ffc Fix declaration of ‘index’ shadows a global declaration [-Werror=shadow]
I have this error with some old gcc (4.6) release (Ubuntu 12.04 or Travis...)
2014-06-03 10:20:05 +02:00
Tatsuhiro Tsujikawa 99aaaccf03 Update doc 2014-06-02 22:33:23 +09:00
Tatsuhiro Tsujikawa 4f7223e89f Add note to manual how to submit frames to new stream ID 2014-05-31 22:01:18 +09:00
Tatsuhiro Tsujikawa 88b69bb669 Reduce huffman decoding table
Previously we have uint16_t as state member variable in
nghttp2_huff_decode structure to express -1 as failure.  This is
because we have 256 valid states.  However, we can express failed
state using flags member variable and make state uint8_t.  This commit
does this and as a result the size of decoding table is reduced.
2014-05-31 00:19:30 +09:00
Tatsuhiro Tsujikawa 832f2fc00f Call on_data_chunk_recv_callback only when stream is active 2014-05-29 22:18:52 +09:00
Tatsuhiro Tsujikawa d113055899 nghttp2_hd: Use single buffer for an name/value pair
Previously we use 2 separate buffer for each name and value.  The
problem is we would waste buffer space for name because it is usually
small.  Also tuning buffer size for each buffer separately is not
elegant and current HTTP server practice is that one buffer for 1
name/value pair.  This commit unifies 2 buffers into 1.
2014-05-28 23:33:37 +09:00
Tatsuhiro Tsujikawa 5e6a2fa256 Assert ctx->state >= 0 in huffman decoding 2014-05-28 00:30:11 +09:00
Tatsuhiro Tsujikawa d733c87567 Make state in nghttp2_hd_huff_decode_context int16_t to make compiler happy 2014-05-26 21:50:54 +09:00
Tatsuhiro Tsujikawa 589d3e71a3 Merge branch 'misc' of https://github.com/alagoutte/nghttp2 into alagoutte-misc 2014-05-26 21:48:30 +09:00
Alexis La Goutte db354b228a Remove unused include (stdint.h) 2014-05-26 08:58:15 +02:00
Tatsuhiro Tsujikawa 9677788317 Don't count closed streams in nghttp2_session_want_{read,write} 2014-05-23 22:23:38 +09:00
Tatsuhiro Tsujikawa 78a55935ac Define constant for the length of priority related fields 2014-05-22 21:41:43 +09:00
Tatsuhiro Tsujikawa 2aa84019c7 Define constants for ALTSVC frame parsing 2014-05-22 21:36:12 +09:00
Tatsuhiro Tsujikawa 1ac028e166 Take into account that pending_local_max_concurrent_stream could be too large
pending_local_max_concurrent_stream is, once local settings applied,
becomes NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS, which is very large
number.  When adjusting number of streams, we have to take min of
local effective SETTINGS_MAX_CONCURRENT_STREAMS and pending one.
2014-05-16 22:32:08 +09:00
Tatsuhiro Tsujikawa 2778e4aafc Remove useless debug code in nghttp2_stream_roots_add() 2014-05-16 22:30:59 +09:00
Tatsuhiro Tsujikawa 7b9a8acc22 Add HPACK deflation API 2014-05-13 23:42:55 +09:00
Tatsuhiro Tsujikawa 062d6a8398 Remove outdated comment 2014-05-12 22:58:05 +09:00
Tatsuhiro Tsujikawa ad4a4ee567 Add missing library error code to nghttp2_error() 2014-05-12 22:58:04 +09:00
Tatsuhiro Tsujikawa ab76468971 Return NGHTTP2_ERR_BUFFER_ERROR from nghttp2_hd_{deflate,inflate}_hd
It is generally useful to know what is the cause of the error.  Since
we expose HPACK API, it is friendly to tell application the
insufficient buffer size is a culprit.
2014-05-12 22:58:04 +09:00
Tatsuhiro Tsujikawa bc6d952361 Check max SETTINGS_HEADER_TABLE_SIZE in nghttp2_iv_check()
Hide NGHTTP2_MAX_HEADER_TABLE_SIZE from public API.  Now it is defined
as ((1u << 31) - 1) in nghttp2_frame.h, which is sufficiently big
enough.
2014-05-12 21:28:49 +09:00
Tatsuhiro Tsujikawa f85c592818 Fix compile error with clang -Wunreachable-code 2014-05-12 21:11:27 +09:00
Tatsuhiro Tsujikawa 9683f88e6a Add NGHTTP2_DEFAULT_HEADER_TABLE_SIZE macro
Use this macro in Python sources.  Python module constant
HD_DEFLATE_HD_TABLE_BUFSIZE_MAX was renamed as
DEFLATE_MAX_HEADER_TABLE_SIZE since the previous name was awkward.
2014-05-11 21:38:30 +09:00
Tatsuhiro Tsujikawa 2e5c7f598f Fix bug HPACK deflater does not send context update after table size change 2014-05-11 21:25:27 +09:00
Tatsuhiro Tsujikawa 4fffd23dd3 Code cleanup 2014-05-11 13:53:42 +09:00
Tatsuhiro Tsujikawa b187895e1d nghttp2_bufs_remove: Prevent NULL from being passed to memcpy 2014-05-11 13:51:46 +09:00
Tatsuhiro Tsujikawa dc791a641d Update doc 2014-05-10 21:43:16 +09:00
Tatsuhiro Tsujikawa 0707720b11 Code cleanup 2014-05-10 18:27:53 +09:00
Tatsuhiro Tsujikawa 4c8d4f8a85 Code cleanup 2014-05-10 00:13:40 +09:00
Tatsuhiro Tsujikawa 3ebb3faf32 Remove nghttp2_ prefix from static function, part 2 2014-05-08 23:54:07 +09:00
Tatsuhiro Tsujikawa 65bbdf56cd Remove nghttp2_ prefix from static function 2014-05-08 23:37:56 +09:00
Tatsuhiro Tsujikawa 3e3d51842b Interleave stream DATA more naturally
We simulate resource sharing by decreasing weight.  The thing is if
weight is wrapped, that item continues to send DATA until its weight
gets lowered under the other items.  This commits fix this issue.
2014-05-08 23:07:29 +09:00
Tatsuhiro Tsujikawa d2890dfb91 Remove adjust_priority_callback
Since we have stream ID immediately available from nghttp2_submit_*,
we don't need adjust_priority_callback.
2014-05-07 23:43:45 +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 51e79c5a3d Remove debug output 2014-05-07 23:23:43 +09:00
Alexis La Goutte 8e22eadc76 Fix typo 2014-05-06 17:05:47 +02:00