Commit Graph

755 Commits

Author SHA1 Message Date
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
Tatsuhiro Tsujikawa 9228e223fa Remove NGHTTP2_ERR_GZIP error code 2014-05-06 23:42:57 +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 704f362804 nghttp2.h: Use hex style flag definition 2014-05-06 18:49:24 +09:00
Tatsuhiro Tsujikawa e2535df505 Code cleanup 2014-05-06 18:39:04 +09:00
Tatsuhiro Tsujikawa f207089604 Update doc 2014-05-06 18:34:48 +09:00
Tatsuhiro Tsujikawa 7b7b0ebcca Update doc 2014-05-06 18:08:41 +09:00
Tatsuhiro Tsujikawa 8289943a58 nghttp2_frame: Add assertion to available buffer size in first buffer 2014-05-06 18:06:46 +09:00
Tatsuhiro Tsujikawa 56d6784d8d nghttp2_frame: Return NGHTTP2_ERR_FRAME_SIZE_ERROR instead of .._BUFFER_ERROR
Also updates docs
2014-05-06 18:02:26 +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 3fc1d2dfaa Merge branch 'gcc' of https://github.com/alagoutte/nghttp2 into alagoutte-gcc 2014-05-01 10:29:40 +09:00
Tatsuhiro Tsujikawa 855f39743a Fix crash when indexed repr index=0 2014-05-01 09:06:54 +09:00
Tatsuhiro Tsujikawa 3c431da6aa Fix bug that server treats reception of ENABLE_PUSH=0 as connection error 2014-05-01 08:38:28 +09:00
Alexis La Goutte 33a6851abe Fix GCC build with -Werror
nghttp2_session.c:1615:9: error: C++ style comments are not allowed in ISO C90 [-Werror]
2014-04-30 17:09:06 +02:00
Alexis La Goutte 763cdc3499 Fix GCC when use -Wpedantic
nghttp2_stream.h:94:43: error: comma at end of enumerator list [-Werror=pedantic]
2014-04-30 17:09:05 +02:00
Alexis La Goutte 0f5c28ac46 Fix GCC when use -Wpedantic
nghttp2_hd.h:115:30: error: comma at end of enumerator list [-Werror=pedantic]
2014-04-30 17:09:05 +02:00
Alexis La Goutte 941236948f Fix GCC when use -Wpedantic
nghttp2_int.h:50:33: error: comma at end of enumerator list [-Werror=pedantic]
2014-04-30 17:09:05 +02:00
Tatsuhiro Tsujikawa 660c536275 Extend namelen and valuelen in nghttp2_nv to size_t 2014-04-30 23:08:34 +09:00
Tatsuhiro Tsujikawa 52b74144ee Fix 0 size malloc, part 2 2014-04-30 22:40:43 +09:00
Tatsuhiro Tsujikawa 1b79114d2d Fix compiler warnings 2014-04-30 22:16:21 +09:00
Tatsuhiro Tsujikawa ab634853df Fix 0 size malloc 2014-04-30 22:09:02 +09:00
Tatsuhiro Tsujikawa d2e64317ba Code cleanup, include nghttp2_int.h explicitly to ensure debug macro 2014-04-30 22:08:32 +09:00
Alexis La Goutte b2f07b1d8c Fix Dead Store (Dead assignement/Dead increment) warning found by Clang Analyzer 2014-04-30 22:06:42 +09:00
Alexis La Goutte eff5c7d0d0 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang Analyzer 2014-04-30 22:06:42 +09:00
Alexis La Goutte e00b8f1f73 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang Analyzer 2014-04-30 22:06:42 +09:00
Tatsuhiro Tsujikawa fe6b541233 Handle hd inflate buffer allocation failure 2014-04-30 11:32:05 +09:00
Tatsuhiro Tsujikawa 167a1102e0 Remove unused NGHTTP2_HD_MAX_BUFFER_LENGTH macro 2014-04-30 10:55:43 +09:00
Tatsuhiro Tsujikawa d61208b394 Update doc 2014-04-30 10:49:19 +09:00
Tatsuhiro Tsujikawa 4cf023d94c Update doc 2014-04-30 10:28:50 +09:00
Tatsuhiro Tsujikawa 3b4aedd566 Add HPACK decoder public API 2014-04-29 15:53:46 +09:00
Tatsuhiro Tsujikawa 8c5db539b3 Change NGHTTP2_MAX_HEADER_TABLE_SIZE to 256MiB 2014-04-28 22:50:43 +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 cc7929bdcc Fix possible SIGFPE 2014-04-27 14:40:10 +09:00
Tatsuhiro Tsujikawa 59e42c1c69 Update doc 2014-04-25 01:39:40 +09:00
Tatsuhiro Tsujikawa d49733a5c9 Declare h2-12 for now 2014-04-25 01:33:29 +09:00
Tatsuhiro Tsujikawa 052be3296c Implement compressed DATA
The library interface supports compressed DATA.  The library does not
deflate nor inflate data payload.  When sending data, an application
has to compress data and set NGHTTP2_DATA_FLAG_COMPRESSED to
data_flags parameter in nghttp2_data_source_read_callback.  On
receiving, flags parameter in nghttp2_on_data_chunk_recv_callback
includes NGHTTP2_FLAG_COMPRESSED.  An application should check the
flags and inflate data as necessary.  Since compression context is per
frame, when DATA is seen in nghttp2_on_frame_recv_callback, an
application should reset compression context.
2014-04-25 01:27:18 +09:00
Tatsuhiro Tsujikawa 6bb410d603 Implement BLOCKED frame 2014-04-25 00:38:24 +09:00
Tatsuhiro Tsujikawa 2d4b92fc2b Merge branch 'priority' 2014-04-24 23:48:37 +09:00
Tatsuhiro Tsujikawa ee26469cd9 Handle circular dependency
Handle the situation if a stream is told to depend on its descendant.
This is what
http://tools.ietf.org/html/draft-ietf-httpbis-http2-12#section-5.3.3
says.
2014-04-24 23:44:34 +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 5aa0a0d099 Check protocol length so that scanner don't overrun buffer 2014-04-22 23:20:33 +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 27a91fc30e Allow NGHTTP2_PRIORITY_TYPE_NONE in nghttp2_submit_{request,headers} 2014-04-10 23:29:56 +09:00
Tatsuhiro Tsujikawa ece6521d26 Check stream availability when sending ALTSVC with stream_id != 0 2014-04-10 23:27:10 +09:00