Remove RFC 7540 priorities

Summary of the behavioral changes in public API functions:

- nghttp2_session_change_stream_priority: This function is noop.  It
  always returns 0.
- nghttp2_session_create_idle_stream: This function is noop.  It
  always returns 0.
- nghttp2_submit_request: pri_spec is ignored.
- nghttp2_submit_request2: pri_spec is ignored.
- nghttp2_submit_headers: pri_spec is ignored.
- nghttp2_submit_priority: This function is noop.  It always returns
  0.
- nghttp2_stream_get_parent: This function always returns NULL.
- nghttp2_stream_get_next_sibling: This function always returns NULL.
- nghttp2_stream_get_previous_sibling: This function always returns
  NULL.
- nghttp2_stream_get_first_child: This function always returns NULL.
- nghttp2_stream_get_weight: This function always returns
  NGHTTP2_DEFAULT_WEIGHT.
- nghttp2_stream_get_sum_dependency_weight: This function always
  returns 0.
This commit is contained in:
Tatsuhiro Tsujikawa
2024-03-25 18:46:03 +09:00
parent 8c83772f6c
commit 3dd61f8ec3
11 changed files with 163 additions and 4747 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -63,7 +63,6 @@ munit_void_test_decl(test_nghttp2_session_on_request_headers_received)
munit_void_test_decl(test_nghttp2_session_on_response_headers_received)
munit_void_test_decl(test_nghttp2_session_on_headers_received)
munit_void_test_decl(test_nghttp2_session_on_push_response_headers_received)
munit_void_test_decl(test_nghttp2_session_on_priority_received)
munit_void_test_decl(test_nghttp2_session_on_rst_stream_received)
munit_void_test_decl(test_nghttp2_session_on_settings_received)
munit_void_test_decl(test_nghttp2_session_on_push_promise_received)
@@ -81,9 +80,6 @@ munit_void_test_decl(test_nghttp2_session_send_rst_stream)
munit_void_test_decl(test_nghttp2_session_send_push_promise)
munit_void_test_decl(test_nghttp2_session_is_my_stream_id)
munit_void_test_decl(test_nghttp2_session_upgrade2)
munit_void_test_decl(test_nghttp2_session_reprioritize_stream)
munit_void_test_decl(
test_nghttp2_session_reprioritize_stream_with_idle_stream_dep)
munit_void_test_decl(test_nghttp2_submit_data)
munit_void_test_decl(test_nghttp2_submit_data_read_length_too_large)
munit_void_test_decl(test_nghttp2_submit_data_read_length_smallest)
@@ -100,7 +96,6 @@ munit_void_test_decl(test_nghttp2_submit_headers_push_reply)
munit_void_test_decl(test_nghttp2_submit_headers)
munit_void_test_decl(test_nghttp2_submit_headers_continuation)
munit_void_test_decl(test_nghttp2_submit_headers_continuation_extra_large)
munit_void_test_decl(test_nghttp2_submit_priority)
munit_void_test_decl(test_nghttp2_submit_settings)
munit_void_test_decl(test_nghttp2_submit_settings_update_local_window_size)
munit_void_test_decl(test_nghttp2_submit_settings_multiple_times)
@@ -115,7 +110,6 @@ munit_void_test_decl(test_nghttp2_submit_origin)
munit_void_test_decl(test_nghttp2_submit_priority_update)
munit_void_test_decl(test_nghttp2_submit_rst_stream)
munit_void_test_decl(test_nghttp2_session_open_stream)
munit_void_test_decl(test_nghttp2_session_open_stream_with_idle_stream_dep)
munit_void_test_decl(test_nghttp2_session_get_next_ob_item)
munit_void_test_decl(test_nghttp2_session_pop_next_ob_item)
munit_void_test_decl(test_nghttp2_session_reply_fail)
@@ -135,21 +129,8 @@ munit_void_test_decl(test_nghttp2_session_data_backoff_by_high_pri_frame)
munit_void_test_decl(test_nghttp2_session_pack_data_with_padding)
munit_void_test_decl(test_nghttp2_session_pack_headers_with_padding)
munit_void_test_decl(test_nghttp2_pack_settings_payload)
munit_void_test_decl(test_nghttp2_session_stream_dep_add)
munit_void_test_decl(test_nghttp2_session_stream_dep_remove)
munit_void_test_decl(test_nghttp2_session_stream_dep_add_subtree)
munit_void_test_decl(test_nghttp2_session_stream_dep_remove_subtree)
munit_void_test_decl(
test_nghttp2_session_stream_dep_all_your_stream_are_belong_to_us)
munit_void_test_decl(test_nghttp2_session_stream_attach_item)
munit_void_test_decl(test_nghttp2_session_stream_attach_item_subtree)
munit_void_test_decl(test_nghttp2_session_stream_get_state)
munit_void_test_decl(test_nghttp2_session_stream_get_something)
munit_void_test_decl(test_nghttp2_session_find_stream)
munit_void_test_decl(test_nghttp2_session_keep_closed_stream)
munit_void_test_decl(test_nghttp2_session_keep_idle_stream)
munit_void_test_decl(test_nghttp2_session_detach_idle_stream)
munit_void_test_decl(test_nghttp2_session_large_dep_tree)
munit_void_test_decl(test_nghttp2_session_graceful_shutdown)
munit_void_test_decl(test_nghttp2_session_on_header_temporal_failure)
munit_void_test_decl(test_nghttp2_session_recv_client_magic)
@@ -162,11 +143,7 @@ munit_void_test_decl(test_nghttp2_session_on_begin_headers_temporal_failure)
munit_void_test_decl(test_nghttp2_session_defer_then_close)
munit_void_test_decl(test_nghttp2_session_detach_item_from_closed_stream)
munit_void_test_decl(test_nghttp2_session_flooding)
munit_void_test_decl(test_nghttp2_session_change_stream_priority)
munit_void_test_decl(test_nghttp2_session_change_extpri_stream_priority)
munit_void_test_decl(test_nghttp2_session_create_idle_stream)
munit_void_test_decl(test_nghttp2_session_repeated_priority_change)
munit_void_test_decl(test_nghttp2_session_repeated_priority_submission)
munit_void_test_decl(test_nghttp2_session_set_local_window_size)
munit_void_test_decl(test_nghttp2_session_cancel_from_before_frame_send)
munit_void_test_decl(test_nghttp2_session_too_many_settings)
@@ -175,7 +152,6 @@ munit_void_test_decl(test_nghttp2_session_pause_data)
munit_void_test_decl(test_nghttp2_session_no_closed_streams)
munit_void_test_decl(test_nghttp2_session_set_stream_user_data)
munit_void_test_decl(test_nghttp2_session_no_rfc7540_priorities)
munit_void_test_decl(test_nghttp2_session_server_fallback_rfc7540_priorities)
munit_void_test_decl(test_nghttp2_session_stream_reset_ratelim)
munit_void_test_decl(test_nghttp2_http_mandatory_headers)
munit_void_test_decl(test_nghttp2_http_content_length)

View File

@@ -260,49 +260,9 @@ void bufs_large_init(nghttp2_bufs *bufs, size_t chunk_size) {
nghttp2_mem_default());
}
static nghttp2_stream *open_stream_with_all(nghttp2_session *session,
int32_t stream_id, int32_t weight,
uint8_t exclusive,
nghttp2_stream *dep_stream) {
nghttp2_priority_spec pri_spec;
int32_t dep_stream_id;
if (dep_stream) {
dep_stream_id = dep_stream->stream_id;
} else {
dep_stream_id = 0;
}
nghttp2_priority_spec_init(&pri_spec, dep_stream_id, weight, exclusive);
return nghttp2_session_open_stream(session, stream_id,
NGHTTP2_STREAM_FLAG_NONE, &pri_spec,
NGHTTP2_STREAM_OPENED, NULL);
}
nghttp2_stream *open_stream(nghttp2_session *session, int32_t stream_id) {
return open_stream_with_all(session, stream_id, NGHTTP2_DEFAULT_WEIGHT, 0,
NULL);
}
nghttp2_stream *open_stream_with_dep(nghttp2_session *session,
int32_t stream_id,
nghttp2_stream *dep_stream) {
return open_stream_with_all(session, stream_id, NGHTTP2_DEFAULT_WEIGHT, 0,
dep_stream);
}
nghttp2_stream *open_stream_with_dep_weight(nghttp2_session *session,
int32_t stream_id, int32_t weight,
nghttp2_stream *dep_stream) {
return open_stream_with_all(session, stream_id, weight, 0, dep_stream);
}
nghttp2_stream *open_stream_with_dep_excl(nghttp2_session *session,
int32_t stream_id,
nghttp2_stream *dep_stream) {
return open_stream_with_all(session, stream_id, NGHTTP2_DEFAULT_WEIGHT, 1,
dep_stream);
return nghttp2_session_open_stream(
session, stream_id, NGHTTP2_STREAM_FLAG_NONE, NGHTTP2_STREAM_OPENED, NULL);
}
nghttp2_outbound_item *create_data_ob_item(nghttp2_mem *mem) {
@@ -315,58 +275,26 @@ nghttp2_outbound_item *create_data_ob_item(nghttp2_mem *mem) {
}
nghttp2_stream *open_sent_stream(nghttp2_session *session, int32_t stream_id) {
nghttp2_priority_spec pri_spec;
nghttp2_priority_spec_init(&pri_spec, 0, NGHTTP2_DEFAULT_WEIGHT, 0);
return open_sent_stream3(session, stream_id, NGHTTP2_FLAG_NONE, &pri_spec,
return open_sent_stream3(session, stream_id, NGHTTP2_FLAG_NONE,
NGHTTP2_STREAM_OPENED, NULL);
}
nghttp2_stream *open_sent_stream2(nghttp2_session *session, int32_t stream_id,
nghttp2_stream_state initial_state) {
nghttp2_priority_spec pri_spec;
nghttp2_priority_spec_init(&pri_spec, 0, NGHTTP2_DEFAULT_WEIGHT, 0);
return open_sent_stream3(session, stream_id, NGHTTP2_FLAG_NONE, &pri_spec,
initial_state, NULL);
return open_sent_stream3(session, stream_id, NGHTTP2_FLAG_NONE, initial_state,
NULL);
}
nghttp2_stream *open_sent_stream3(nghttp2_session *session, int32_t stream_id,
uint8_t flags,
nghttp2_priority_spec *pri_spec_in,
nghttp2_stream_state initial_state,
void *stream_user_data) {
nghttp2_stream *stream;
assert(nghttp2_session_is_my_stream_id(session, stream_id));
stream = nghttp2_session_open_stream(session, stream_id, flags, pri_spec_in,
initial_state, stream_user_data);
session->last_sent_stream_id =
nghttp2_max_int32(session->last_sent_stream_id, stream_id);
session->next_stream_id =
nghttp2_max_uint32(session->next_stream_id, (uint32_t)stream_id + 2);
return stream;
}
nghttp2_stream *open_sent_stream_with_dep(nghttp2_session *session,
int32_t stream_id,
nghttp2_stream *dep_stream) {
return open_sent_stream_with_dep_weight(session, stream_id,
NGHTTP2_DEFAULT_WEIGHT, dep_stream);
}
nghttp2_stream *open_sent_stream_with_dep_weight(nghttp2_session *session,
int32_t stream_id,
int32_t weight,
nghttp2_stream *dep_stream) {
nghttp2_stream *stream;
assert(nghttp2_session_is_my_stream_id(session, stream_id));
stream = open_stream_with_all(session, stream_id, weight, 0, dep_stream);
stream = nghttp2_session_open_stream(session, stream_id, flags, initial_state,
stream_user_data);
session->last_sent_stream_id =
nghttp2_max_int32(session->last_sent_stream_id, stream_id);
session->next_stream_id =
@@ -376,56 +304,26 @@ nghttp2_stream *open_sent_stream_with_dep_weight(nghttp2_session *session,
}
nghttp2_stream *open_recv_stream(nghttp2_session *session, int32_t stream_id) {
nghttp2_priority_spec pri_spec;
nghttp2_priority_spec_init(&pri_spec, 0, NGHTTP2_DEFAULT_WEIGHT, 0);
return open_recv_stream3(session, stream_id, NGHTTP2_FLAG_NONE, &pri_spec,
return open_recv_stream3(session, stream_id, NGHTTP2_FLAG_NONE,
NGHTTP2_STREAM_OPENED, NULL);
}
nghttp2_stream *open_recv_stream2(nghttp2_session *session, int32_t stream_id,
nghttp2_stream_state initial_state) {
nghttp2_priority_spec pri_spec;
nghttp2_priority_spec_init(&pri_spec, 0, NGHTTP2_DEFAULT_WEIGHT, 0);
return open_recv_stream3(session, stream_id, NGHTTP2_FLAG_NONE, &pri_spec,
initial_state, NULL);
return open_recv_stream3(session, stream_id, NGHTTP2_FLAG_NONE, initial_state,
NULL);
}
nghttp2_stream *open_recv_stream3(nghttp2_session *session, int32_t stream_id,
uint8_t flags,
nghttp2_priority_spec *pri_spec_in,
nghttp2_stream_state initial_state,
void *stream_user_data) {
nghttp2_stream *stream;
assert(!nghttp2_session_is_my_stream_id(session, stream_id));
stream = nghttp2_session_open_stream(session, stream_id, flags, pri_spec_in,
initial_state, stream_user_data);
session->last_recv_stream_id =
nghttp2_max_int32(session->last_recv_stream_id, stream_id);
return stream;
}
nghttp2_stream *open_recv_stream_with_dep(nghttp2_session *session,
int32_t stream_id,
nghttp2_stream *dep_stream) {
return open_recv_stream_with_dep_weight(session, stream_id,
NGHTTP2_DEFAULT_WEIGHT, dep_stream);
}
nghttp2_stream *open_recv_stream_with_dep_weight(nghttp2_session *session,
int32_t stream_id,
int32_t weight,
nghttp2_stream *dep_stream) {
nghttp2_stream *stream;
assert(!nghttp2_session_is_my_stream_id(session, stream_id));
stream = open_stream_with_all(session, stream_id, weight, 0, dep_stream);
stream = nghttp2_session_open_stream(session, stream_id, flags, initial_state,
stream_user_data);
session->last_recv_stream_id =
nghttp2_max_int32(session->last_recv_stream_id, stream_id);

View File

@@ -78,18 +78,6 @@ void bufs_large_init(nghttp2_bufs *bufs, size_t chunk_size);
nghttp2_stream *open_stream(nghttp2_session *session, int32_t stream_id);
nghttp2_stream *open_stream_with_dep(nghttp2_session *session,
int32_t stream_id,
nghttp2_stream *dep_stream);
nghttp2_stream *open_stream_with_dep_weight(nghttp2_session *session,
int32_t stream_id, int32_t weight,
nghttp2_stream *dep_stream);
nghttp2_stream *open_stream_with_dep_excl(nghttp2_session *session,
int32_t stream_id,
nghttp2_stream *dep_stream);
nghttp2_outbound_item *create_data_ob_item(nghttp2_mem *mem);
/* Opens stream. This stream is assumed to be sent from |session|,
@@ -102,19 +90,9 @@ nghttp2_stream *open_sent_stream2(nghttp2_session *session, int32_t stream_id,
nghttp2_stream *open_sent_stream3(nghttp2_session *session, int32_t stream_id,
uint8_t flags,
nghttp2_priority_spec *pri_spec_in,
nghttp2_stream_state initial_state,
void *stream_user_data);
nghttp2_stream *open_sent_stream_with_dep(nghttp2_session *session,
int32_t stream_id,
nghttp2_stream *dep_stream);
nghttp2_stream *open_sent_stream_with_dep_weight(nghttp2_session *session,
int32_t stream_id,
int32_t weight,
nghttp2_stream *dep_stream);
/* Opens stream. This stream is assumed to be received by |session|,
and session->last_recv_stream_id will be adjusted accordingly. */
nghttp2_stream *open_recv_stream(nghttp2_session *session, int32_t stream_id);
@@ -124,17 +102,7 @@ nghttp2_stream *open_recv_stream2(nghttp2_session *session, int32_t stream_id,
nghttp2_stream *open_recv_stream3(nghttp2_session *session, int32_t stream_id,
uint8_t flags,
nghttp2_priority_spec *pri_spec_in,
nghttp2_stream_state initial_state,
void *stream_user_data);
nghttp2_stream *open_recv_stream_with_dep(nghttp2_session *session,
int32_t stream_id,
nghttp2_stream *dep_stream);
nghttp2_stream *open_recv_stream_with_dep_weight(nghttp2_session *session,
int32_t stream_id,
int32_t weight,
nghttp2_stream *dep_stream);
#endif /* NGHTTP2_TEST_HELPER_H */