mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-10 20:18:52 +08:00
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.
This commit is contained in:
@@ -97,7 +97,8 @@ void test_nghttp2_frame_pack_headers()
|
||||
nghttp2_frame_headers_init(&frame,
|
||||
NGHTTP2_FLAG_END_STREAM |
|
||||
NGHTTP2_FLAG_END_HEADERS,
|
||||
1000000007, &pri_spec, nva, nvlen);
|
||||
1000000007, NGHTTP2_HCAT_REQUEST,
|
||||
&pri_spec, nva, nvlen);
|
||||
rv = nghttp2_frame_pack_headers(&bufs, &frame, &deflater);
|
||||
|
||||
nghttp2_bufs_rewind(&bufs);
|
||||
@@ -194,7 +195,8 @@ void test_nghttp2_frame_pack_headers_frame_too_large(void)
|
||||
nghttp2_hd_deflate_init(&deflater);
|
||||
nghttp2_frame_headers_init(&frame,
|
||||
NGHTTP2_FLAG_END_STREAM|NGHTTP2_FLAG_END_HEADERS,
|
||||
1000000007, NULL, nva, nvlen);
|
||||
1000000007, NGHTTP2_HCAT_REQUEST,
|
||||
NULL, nva, nvlen);
|
||||
rv = nghttp2_frame_pack_headers(&bufs, &frame, &deflater);
|
||||
CU_ASSERT(NGHTTP2_ERR_HEADER_COMP == rv);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user