diff --git a/examples/client.c b/examples/client.c index 6fc2f9e7..4e951db4 100644 --- a/examples/client.c +++ b/examples/client.c @@ -318,7 +318,8 @@ static int on_stream_close_callback(nghttp2_session *session, req = nghttp2_session_get_stream_user_data(session, stream_id); if(req) { int rv; - rv = nghttp2_submit_goaway(session, NGHTTP2_NO_ERROR, NULL, 0); + rv = nghttp2_submit_goaway(session, NGHTTP2_FLAG_NONE, NGHTTP2_NO_ERROR, + NULL, 0); if(rv != 0) { diec("nghttp2_submit_goaway", rv); } @@ -350,7 +351,8 @@ static int on_data_chunk_recv_callback(nghttp2_session *session, uint8_t flags, int rv; rv = nghttp2_gzip_inflate(req->inflater, out, &outlen, data, &tlen); if(rv == -1) { - nghttp2_submit_rst_stream(session, stream_id, NGHTTP2_INTERNAL_ERROR); + nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, stream_id, + NGHTTP2_INTERNAL_ERROR); break; } fwrite(out, 1, outlen, stdout); diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index ead216c6..3808dbfb 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -1831,6 +1831,9 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags, * Submits PRIORITY frame to change the priority of stream |stream_id| * to the priority value |pri|. * + * The |flags| is currently ignored and should be + * :enum:`NGHTTP2_FLAG_NONE`. + * * This function returns 0 if it succeeds, or one of the following * negative error codes: * @@ -1841,8 +1844,8 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags, * :enum:`NGHTTP2_ERR_STREAM_CLOSED` * The stream is already closed or does not exist. */ -int nghttp2_submit_priority(nghttp2_session *session, int32_t stream_id, - int32_t pri); +int nghttp2_submit_priority(nghttp2_session *session, uint8_t flags, + int32_t stream_id, int32_t pri); /** * @function @@ -1850,13 +1853,17 @@ int nghttp2_submit_priority(nghttp2_session *session, int32_t stream_id, * Submits RST_STREAM frame to cancel/reject the stream |stream_id| * with the error code |error_code|. * + * The |flags| is currently ignored and should be + * :enum:`NGHTTP2_FLAG_NONE`. + * * This function returns 0 if it succeeds, or one of the following * negative error codes: * * :enum:`NGHTTP2_ERR_NOMEM` * Out of memory. */ -int nghttp2_submit_rst_stream(nghttp2_session *session, int32_t stream_id, +int nghttp2_submit_rst_stream(nghttp2_session *session, uint8_t flags, + int32_t stream_id, nghttp2_error_code error_code); /** @@ -1866,6 +1873,9 @@ int nghttp2_submit_rst_stream(nghttp2_session *session, int32_t stream_id, * pointer to the array of :type:`nghttp2_settings_entry`. The |niv| * indicates the number of :type:`nghttp2_settings_entry`. * + * The |flags| is currently ignored and should be + * :enum:`NGHTTP2_FLAG_NONE`. + * * This function does not take ownership of the |iv|. This function * copies all the elements in the |iv|. * @@ -1882,7 +1892,7 @@ int nghttp2_submit_rst_stream(nghttp2_session *session, int32_t stream_id, * :enum:`NGHTTP2_ERR_NOMEM` * Out of memory. */ -int nghttp2_submit_settings(nghttp2_session *session, +int nghttp2_submit_settings(nghttp2_session *session, uint8_t flags, const nghttp2_settings_entry *iv, size_t niv); @@ -1934,6 +1944,9 @@ int nghttp2_submit_push_promise(nghttp2_session *session, uint8_t flags, * received PING frame. The library automatically submits PING frame * in this case. * + * The |flags| is currently ignored and should be + * :enum:`NGHTTP2_FLAG_NONE`. + * * If the |opaque_data| is non ``NULL``, then it should point to the 8 * bytes array of memory to specify opaque data to send with PING * frame. If the |opaque_data| is ``NULL``, zero-cleared 8 bytes will @@ -1945,13 +1958,17 @@ int nghttp2_submit_push_promise(nghttp2_session *session, uint8_t flags, * :enum:`NGHTTP2_ERR_NOMEM` * Out of memory. */ -int nghttp2_submit_ping(nghttp2_session *session, uint8_t *opaque_data); +int nghttp2_submit_ping(nghttp2_session *session, uint8_t flags, + uint8_t *opaque_data); /** * @function * * Submits GOAWAY frame with the error code |error_code|. * + * The |flags| is currently ignored and should be + * :enum:`NGHTTP2_FLAG_NONE`. + * * If the |opaque_data| is not ``NULL`` and |opaque_data_len| is not * zero, those data will be sent as additional debug data. The * library makes a copy of the memory region pointed by |opaque_data| @@ -1965,7 +1982,7 @@ int nghttp2_submit_ping(nghttp2_session *session, uint8_t *opaque_data); * :enum:`NGHTTP2_ERR_NOMEM` * Out of memory. */ -int nghttp2_submit_goaway(nghttp2_session *session, +int nghttp2_submit_goaway(nghttp2_session *session, uint8_t flags, nghttp2_error_code error_code, uint8_t *opaque_data, size_t opaque_data_len); @@ -1974,7 +1991,8 @@ int nghttp2_submit_goaway(nghttp2_session *session, * * Submits WINDOW_UPDATE frame. * - * The |flags| is currently ignored. + * The |flags| is currently ignored and should be + * :enum:`NGHTTP2_FLAG_NONE`. * * If the |window_size_increment| is positive, the WINDOW_UPDATE with * that value as window_size_increment is queued. If the diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 048b0a2a..5ccc3073 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -90,7 +90,8 @@ int nghttp2_session_fail_session(nghttp2_session *session, if(session->goaway_flags & NGHTTP2_GOAWAY_SEND) { return 0; } - return nghttp2_submit_goaway(session, error_code, NULL, 0); + return nghttp2_submit_goaway(session, NGHTTP2_FLAG_NONE, error_code, + NULL, 0); } int nghttp2_session_is_my_stream_id(nghttp2_session *session, @@ -3476,7 +3477,7 @@ int nghttp2_session_upgrade(nghttp2_session *session, frame.settings.niv = niv; rv = nghttp2_session_on_settings_received(session, &frame); } else { - rv = nghttp2_submit_settings(session, iv, niv); + rv = nghttp2_submit_settings(session, NGHTTP2_FLAG_NONE, iv, niv); } free(iv); if(rv != 0) { diff --git a/lib/nghttp2_submit.c b/lib/nghttp2_submit.c index ac248e2b..d47ce738 100644 --- a/lib/nghttp2_submit.c +++ b/lib/nghttp2_submit.c @@ -154,13 +154,14 @@ int nghttp2_submit_headers(nghttp2_session *session, uint8_t flags, } -int nghttp2_submit_ping(nghttp2_session *session, uint8_t *opaque_data) +int nghttp2_submit_ping(nghttp2_session *session, uint8_t flags, + uint8_t *opaque_data) { return nghttp2_session_add_ping(session, NGHTTP2_FLAG_NONE, opaque_data); } -int nghttp2_submit_priority(nghttp2_session *session, int32_t stream_id, - int32_t pri) +int nghttp2_submit_priority(nghttp2_session *session, uint8_t flags, + int32_t stream_id, int32_t pri) { int r; nghttp2_frame *frame; @@ -190,13 +191,14 @@ int nghttp2_submit_priority(nghttp2_session *session, int32_t stream_id, return 0; } -int nghttp2_submit_rst_stream(nghttp2_session *session, int32_t stream_id, +int nghttp2_submit_rst_stream(nghttp2_session *session, uint8_t flags, + int32_t stream_id, nghttp2_error_code error_code) { return nghttp2_session_add_rst_stream(session, stream_id, error_code); } -int nghttp2_submit_goaway(nghttp2_session *session, +int nghttp2_submit_goaway(nghttp2_session *session, uint8_t flags, nghttp2_error_code error_code, uint8_t *opaque_data, size_t opaque_data_len) { @@ -204,7 +206,7 @@ int nghttp2_submit_goaway(nghttp2_session *session, error_code, opaque_data, opaque_data_len); } -int nghttp2_submit_settings(nghttp2_session *session, +int nghttp2_submit_settings(nghttp2_session *session, uint8_t flags, const nghttp2_settings_entry *iv, size_t niv) { nghttp2_frame *frame; diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 8db78a4b..39652b3f 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -358,7 +358,7 @@ int Http2Handler::on_connect() entry[niv].value = 1; ++niv; } - r = nghttp2_submit_settings(session_, entry, niv); + r = nghttp2_submit_settings(session_, NGHTTP2_FLAG_NONE, entry, niv); if(r != 0) { return r; } @@ -701,14 +701,15 @@ int hd_on_frame_recv_callback int32_t stream_id = frame->hd.stream_id; if(!http2::check_http2_headers(frame->headers.nva, frame->headers.nvlen)) { - nghttp2_submit_rst_stream(session, stream_id, NGHTTP2_PROTOCOL_ERROR); + nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, stream_id, + NGHTTP2_PROTOCOL_ERROR); return 0; } for(size_t i = 0; REQUIRED_HEADERS[i]; ++i) { if(!http2::get_unique_header(frame->headers.nva, frame->headers.nvlen, REQUIRED_HEADERS[i])) { - nghttp2_submit_rst_stream(session, stream_id, + nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, stream_id, NGHTTP2_PROTOCOL_ERROR); return 0; } diff --git a/src/nghttp.cc b/src/nghttp.cc index 938c7ea1..91d99a2d 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -685,7 +685,7 @@ struct HttpClient { if(!need_upgrade()) { nghttp2_settings_entry iv[16]; auto niv = populate_settings(iv); - rv = nghttp2_submit_settings(session, iv, niv); + rv = nghttp2_submit_settings(session, NGHTTP2_FLAG_NONE, iv, niv); if(rv != 0) { return -1; } @@ -1012,7 +1012,8 @@ int on_data_chunk_recv_callback size_t tlen = len; int rv = nghttp2_gzip_inflate(req->inflater, out, &outlen, data, &tlen); if(rv != 0) { - nghttp2_submit_rst_stream(session, stream_id, NGHTTP2_INTERNAL_ERROR); + nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, stream_id, + NGHTTP2_INTERNAL_ERROR); break; } if(!config.null_out) { @@ -1140,7 +1141,8 @@ int on_stream_close_callback (*itr).second->record_complete_time(); ++client->complete; if(client->all_requests_processed()) { - nghttp2_submit_goaway(session, NGHTTP2_NO_ERROR, nullptr, 0); + nghttp2_submit_goaway(session, NGHTTP2_FLAG_NONE, NGHTTP2_NO_ERROR, + nullptr, 0); } } return 0; diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index 7be268a3..a9b3af20 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -443,8 +443,9 @@ Http2Upstream::Http2Upstream(ClientHandler *handler) entry[1].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE; entry[1].value = initial_window_size_; - rv = nghttp2_submit_settings - (session_, entry, sizeof(entry)/sizeof(nghttp2_settings_entry)); + rv = nghttp2_submit_settings(session_, NGHTTP2_FLAG_NONE, + entry, + sizeof(entry)/sizeof(nghttp2_settings_entry)); assert(rv == 0); // Set large connection-level window size to effectively disable // connection-level flow control. @@ -715,8 +716,8 @@ int Http2Upstream::rst_stream(Downstream *downstream, << error_code; } int rv; - rv = nghttp2_submit_rst_stream(session_, downstream->get_stream_id(), - error_code); + rv = nghttp2_submit_rst_stream(session_, NGHTTP2_FLAG_NONE, + downstream->get_stream_id(), error_code); if(rv < NGHTTP2_ERR_FATAL) { ULOG(FATAL, this) << "nghttp2_submit_rst_stream() failed: " << nghttp2_strerror(rv); diff --git a/src/shrpx_spdy_downstream_connection.cc b/src/shrpx_spdy_downstream_connection.cc index bdc01c64..1c37d089 100644 --- a/src/shrpx_spdy_downstream_connection.cc +++ b/src/shrpx_spdy_downstream_connection.cc @@ -145,8 +145,7 @@ int SpdyDownstreamConnection::submit_rst_stream(Downstream *downstream) << downstream << ", stream_id=" << downstream->get_downstream_stream_id(); } - rv = spdy_->submit_rst_stream(this, - downstream->get_downstream_stream_id(), + rv = spdy_->submit_rst_stream(downstream->get_downstream_stream_id(), NGHTTP2_INTERNAL_ERROR); } } diff --git a/src/shrpx_spdy_session.cc b/src/shrpx_spdy_session.cc index 7a58385f..40848a1f 100644 --- a/src/shrpx_spdy_session.cc +++ b/src/shrpx_spdy_session.cc @@ -577,8 +577,7 @@ int SpdySession::submit_request(SpdyDownstreamConnection *dconn, return 0; } -int SpdySession::submit_rst_stream(SpdyDownstreamConnection *dconn, - int32_t stream_id, +int SpdySession::submit_rst_stream(int32_t stream_id, nghttp2_error_code error_code) { assert(state_ == CONNECTED); @@ -588,7 +587,8 @@ int SpdySession::submit_rst_stream(SpdyDownstreamConnection *dconn, << " with error_code=" << error_code; } - int rv = nghttp2_submit_rst_stream(session_, stream_id, error_code); + int rv = nghttp2_submit_rst_stream(session_, NGHTTP2_FLAG_NONE, + stream_id, error_code); if(rv != 0) { SSLOG(FATAL, this) << "nghttp2_submit_rst_stream() failed: " << nghttp2_strerror(rv); @@ -750,15 +750,13 @@ int on_frame_recv_callback auto sd = reinterpret_cast (nghttp2_session_get_stream_user_data(session, frame->hd.stream_id)); if(!sd || !sd->dconn) { - nghttp2_submit_rst_stream(session, frame->hd.stream_id, - NGHTTP2_INTERNAL_ERROR); + spdy->submit_rst_stream(frame->hd.stream_id, NGHTTP2_INTERNAL_ERROR); break; } auto downstream = sd->dconn->get_downstream(); if(!downstream || downstream->get_downstream_stream_id() != frame->hd.stream_id) { - nghttp2_submit_rst_stream(session, frame->hd.stream_id, - NGHTTP2_INTERNAL_ERROR); + spdy->submit_rst_stream(frame->hd.stream_id, NGHTTP2_INTERNAL_ERROR); break; } auto nva = frame->headers.nva; @@ -766,8 +764,7 @@ int on_frame_recv_callback // Assuming that nva is sorted by name. if(!http2::check_http2_headers(nva, nvlen)) { - nghttp2_submit_rst_stream(session, frame->hd.stream_id, - NGHTTP2_PROTOCOL_ERROR); + spdy->submit_rst_stream(frame->hd.stream_id, NGHTTP2_PROTOCOL_ERROR); downstream->set_response_state(Downstream::MSG_RESET); call_downstream_readcb(spdy, downstream); return 0; @@ -782,8 +779,7 @@ int on_frame_recv_callback auto status = http2::get_unique_header(nva, nvlen, ":status"); if(!status || http2::value_lws(status)) { - nghttp2_submit_rst_stream(session, frame->hd.stream_id, - NGHTTP2_PROTOCOL_ERROR); + spdy->submit_rst_stream(frame->hd.stream_id, NGHTTP2_PROTOCOL_ERROR); downstream->set_response_state(Downstream::MSG_RESET); call_downstream_readcb(spdy, downstream); return 0; @@ -855,8 +851,7 @@ int on_frame_recv_callback } rv = upstream->on_downstream_header_complete(downstream); if(rv != 0) { - nghttp2_submit_rst_stream(session, frame->hd.stream_id, - NGHTTP2_PROTOCOL_ERROR); + spdy->submit_rst_stream(frame->hd.stream_id, NGHTTP2_PROTOCOL_ERROR); downstream->set_response_state(Downstream::MSG_RESET); } call_downstream_readcb(spdy, downstream); @@ -899,8 +894,7 @@ int on_frame_recv_callback << frame->hd.stream_id; } // We just respond with RST_STREAM. - nghttp2_submit_rst_stream(session, frame->hd.stream_id, - NGHTTP2_REFUSED_STREAM); + spdy->submit_rst_stream(frame->hd.stream_id, NGHTTP2_REFUSED_STREAM); break; default: break; @@ -920,12 +914,12 @@ int on_data_chunk_recv_callback(nghttp2_session *session, auto sd = reinterpret_cast (nghttp2_session_get_stream_user_data(session, stream_id)); if(!sd || !sd->dconn) { - nghttp2_submit_rst_stream(session, stream_id, NGHTTP2_INTERNAL_ERROR); + spdy->submit_rst_stream(stream_id, NGHTTP2_INTERNAL_ERROR); return 0; } auto downstream = sd->dconn->get_downstream(); if(!downstream || downstream->get_downstream_stream_id() != stream_id) { - nghttp2_submit_rst_stream(session, stream_id, NGHTTP2_INTERNAL_ERROR); + spdy->submit_rst_stream(stream_id, NGHTTP2_INTERNAL_ERROR); return 0; } @@ -940,8 +934,7 @@ int on_data_chunk_recv_callback(nghttp2_session *session, << ", initial_window_size=" << spdy->get_initial_window_size(); } - nghttp2_submit_rst_stream(session, stream_id, - NGHTTP2_FLOW_CONTROL_ERROR); + spdy->submit_rst_stream(stream_id, NGHTTP2_FLOW_CONTROL_ERROR); downstream->set_response_state(Downstream::MSG_RESET); call_downstream_readcb(spdy, downstream); return 0; @@ -951,7 +944,7 @@ int on_data_chunk_recv_callback(nghttp2_session *session, auto upstream = downstream->get_upstream(); rv = upstream->on_downstream_body(downstream, data, len); if(rv != 0) { - nghttp2_submit_rst_stream(session, stream_id, NGHTTP2_INTERNAL_ERROR); + spdy->submit_rst_stream(stream_id, NGHTTP2_INTERNAL_ERROR); downstream->set_response_state(Downstream::MSG_RESET); } call_downstream_readcb(spdy, downstream); @@ -964,20 +957,20 @@ int before_frame_send_callback(nghttp2_session *session, const nghttp2_frame *frame, void *user_data) { + auto spdy = reinterpret_cast(user_data); if(frame->hd.type == NGHTTP2_HEADERS && frame->headers.cat == NGHTTP2_HCAT_REQUEST) { auto sd = reinterpret_cast (nghttp2_session_get_stream_user_data(session, frame->hd.stream_id)); if(!sd || !sd->dconn) { - nghttp2_submit_rst_stream(session, frame->hd.stream_id, - NGHTTP2_CANCEL); + spdy->submit_rst_stream(frame->hd.stream_id, NGHTTP2_CANCEL); return 0; } auto downstream = sd->dconn->get_downstream(); if(downstream) { downstream->set_downstream_stream_id(frame->hd.stream_id); } else { - nghttp2_submit_rst_stream(session, frame->hd.stream_id, NGHTTP2_CANCEL); + spdy->submit_rst_stream(frame->hd.stream_id, NGHTTP2_CANCEL); } } return 0; @@ -1098,8 +1091,8 @@ int SpdySession::on_connect() entry[1].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE; entry[1].value = get_initial_window_size(); - rv = nghttp2_submit_settings - (session_, entry, sizeof(entry)/sizeof(nghttp2_settings_entry)); + rv = nghttp2_submit_settings(session_, NGHTTP2_FLAG_NONE, entry, + sizeof(entry)/sizeof(nghttp2_settings_entry)); if(rv != 0) { return -1; } diff --git a/src/shrpx_spdy_session.h b/src/shrpx_spdy_session.h index c463f440..c1eb80ab 100644 --- a/src/shrpx_spdy_session.h +++ b/src/shrpx_spdy_session.h @@ -68,8 +68,7 @@ public: uint8_t pri, const char **nv, const nghttp2_data_provider *data_prd); - int submit_rst_stream(SpdyDownstreamConnection *dconn, - int32_t stream_id, nghttp2_error_code error_code); + int submit_rst_stream(int32_t stream_id, nghttp2_error_code error_code); int submit_window_update(SpdyDownstreamConnection *dconn, int32_t amount); diff --git a/tests/nghttp2_session_test.c b/tests/nghttp2_session_test.c index 71699112..be69a935 100644 --- a/tests/nghttp2_session_test.c +++ b/tests/nghttp2_session_test.c @@ -2213,9 +2213,10 @@ void test_nghttp2_submit_priority(void) NGHTTP2_STREAM_OPENING, NULL); CU_ASSERT(NGHTTP2_ERR_INVALID_ARGUMENT == - nghttp2_submit_priority(session, 1, -1)); + nghttp2_submit_priority(session, NGHTTP2_FLAG_NONE, 1, -1)); - CU_ASSERT(0 == nghttp2_submit_priority(session, 1, 1000000007)); + CU_ASSERT(0 == nghttp2_submit_priority(session, NGHTTP2_FLAG_NONE, 1, + 1000000007)); CU_ASSERT(1000000007 == stream->pri); nghttp2_session_del(session); @@ -2252,7 +2253,7 @@ void test_nghttp2_submit_settings(void) nghttp2_session_server_new(&session, &callbacks, &ud); CU_ASSERT(NGHTTP2_ERR_INVALID_ARGUMENT == - nghttp2_submit_settings(session, iv, 5)); + nghttp2_submit_settings(session, NGHTTP2_FLAG_NONE, iv, 5)); /* Make sure that local settings are not changed */ CU_ASSERT(NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS == @@ -2263,7 +2264,7 @@ void test_nghttp2_submit_settings(void) session->local_settings[NGHTTP2_SETTINGS_FLOW_CONTROL_OPTIONS]); /* Now sends without 5th one */ - CU_ASSERT(0 == nghttp2_submit_settings(session, iv, 4)); + CU_ASSERT(0 == nghttp2_submit_settings(session, NGHTTP2_FLAG_NONE, iv, 4)); /* Make sure that local settings are changed */ CU_ASSERT(50 == @@ -2326,7 +2327,7 @@ void test_nghttp2_submit_settings_update_local_window_size(void) NGHTTP2_STREAM_OPENED, NULL); stream->local_flow_control = 0; - CU_ASSERT(0 == nghttp2_submit_settings(session, iv, 1)); + CU_ASSERT(0 == nghttp2_submit_settings(session, NGHTTP2_FLAG_NONE, iv, 1)); stream = nghttp2_session_get_stream(session, 1); CU_ASSERT(0 == stream->recv_window_size); @@ -2350,7 +2351,7 @@ void test_nghttp2_submit_settings_update_local_window_size(void) NGHTTP2_PRI_DEFAULT, NGHTTP2_STREAM_OPENED, NULL); - CU_ASSERT(0 == nghttp2_submit_settings(session, iv, 2)); + CU_ASSERT(0 == nghttp2_submit_settings(session, NGHTTP2_FLAG_NONE, iv, 2)); CU_ASSERT(NGHTTP2_INITIAL_WINDOW_SIZE == stream->local_window_size); nghttp2_session_del(session); @@ -2363,7 +2364,7 @@ void test_nghttp2_submit_settings_update_local_window_size(void) NGHTTP2_STREAM_OPENED, NULL); stream->local_window_size = NGHTTP2_MAX_WINDOW_SIZE; - CU_ASSERT(0 == nghttp2_submit_settings(session, iv, 1)); + CU_ASSERT(0 == nghttp2_submit_settings(session, NGHTTP2_FLAG_NONE, iv, 1)); CU_ASSERT(NGHTTP2_STREAM_CLOSING == stream->state); nghttp2_session_del(session); @@ -2645,7 +2646,7 @@ void test_nghttp2_session_get_next_ob_item(void) session->remote_settings[NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS] = 2; CU_ASSERT(NULL == nghttp2_session_get_next_ob_item(session)); - nghttp2_submit_ping(session, NULL); + nghttp2_submit_ping(session, NGHTTP2_FLAG_NONE, NULL); CU_ASSERT(NGHTTP2_PING == OB_CTRL_TYPE(nghttp2_session_get_next_ob_item(session))); @@ -2691,7 +2692,7 @@ void test_nghttp2_session_pop_next_ob_item(void) session->remote_settings[NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS] = 1; CU_ASSERT(NULL == nghttp2_session_pop_next_ob_item(session)); - nghttp2_submit_ping(session, NULL); + nghttp2_submit_ping(session, NGHTTP2_FLAG_NONE, NULL); nghttp2_submit_request(session, 1, nv, NULL, NULL); item = nghttp2_session_pop_next_ob_item(session); @@ -2908,7 +2909,7 @@ void test_nghttp2_session_defer_data(void) CU_ASSERT(ud.data_source_length == 16*1024); ud.block_count = 1; - nghttp2_submit_ping(session, NULL); + nghttp2_submit_ping(session, NGHTTP2_FLAG_NONE, NULL); /* Sends PING */ CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(NGHTTP2_PING == ud.sent_frame_type); @@ -3123,7 +3124,7 @@ void test_nghttp2_session_flow_control_disable_local(void) iv[0].settings_id = NGHTTP2_SETTINGS_FLOW_CONTROL_OPTIONS; iv[0].value = 1; - CU_ASSERT(0 == nghttp2_submit_settings(session, iv, + CU_ASSERT(0 == nghttp2_submit_settings(session, NGHTTP2_FLAG_NONE, iv, sizeof(iv)/sizeof(iv[0]))); CU_ASSERT(0 == stream->local_flow_control); CU_ASSERT(0 == session->local_flow_control); @@ -3369,7 +3370,8 @@ void test_nghttp2_session_on_ctrl_not_send(void) CU_ASSERT(0 == nghttp2_submit_headers(session, NGHTTP2_FLAG_END_STREAM, 1, NGHTTP2_PRI_DEFAULT, nv, NULL)); - CU_ASSERT(0 == nghttp2_submit_rst_stream(session, 1, NGHTTP2_INTERNAL_ERROR)); + CU_ASSERT(0 == nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, 1, + NGHTTP2_INTERNAL_ERROR)); CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(1 == user_data.frame_not_send_cb_called); CU_ASSERT(NGHTTP2_HEADERS == user_data.not_sent_frame_type); @@ -3385,7 +3387,8 @@ void test_nghttp2_session_on_ctrl_not_send(void) CU_ASSERT(0 == nghttp2_submit_headers(session, NGHTTP2_FLAG_END_STREAM, 3, NGHTTP2_PRI_DEFAULT, nv, NULL)); - CU_ASSERT(0 == nghttp2_submit_rst_stream(session, 3, NGHTTP2_INTERNAL_ERROR)); + CU_ASSERT(0 == nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, 3, + NGHTTP2_INTERNAL_ERROR)); CU_ASSERT(0 == nghttp2_session_send(session)); CU_ASSERT(1 == user_data.frame_not_send_cb_called); CU_ASSERT(NGHTTP2_HEADERS == user_data.not_sent_frame_type); @@ -3407,11 +3410,12 @@ void test_nghttp2_session_on_ctrl_not_send(void) /* Send PRIORITY to stream ID = 1 which does not exist */ CU_ASSERT(NGHTTP2_ERR_STREAM_CLOSED == - nghttp2_submit_priority(session, 1, 0)); + nghttp2_submit_priority(session, NGHTTP2_FLAG_NONE, 1, 0)); user_data.frame_not_send_cb_called = 0; /* Send GOAWAY */ - CU_ASSERT(0 == nghttp2_submit_goaway(session, NGHTTP2_NO_ERROR, NULL, 0)); + CU_ASSERT(0 == nghttp2_submit_goaway(session, NGHTTP2_FLAG_NONE, + NGHTTP2_NO_ERROR, NULL, 0)); CU_ASSERT(0 == nghttp2_submit_headers(session, NGHTTP2_FLAG_END_STREAM, -1, NGHTTP2_PRI_DEFAULT, nv, NULL)); CU_ASSERT(0 == nghttp2_session_send(session)); @@ -3431,10 +3435,11 @@ void test_nghttp2_session_get_outbound_queue_size(void) CU_ASSERT(0 == nghttp2_session_client_new(&session, &callbacks, NULL)); CU_ASSERT(0 == nghttp2_session_get_outbound_queue_size(session)); - CU_ASSERT(0 == nghttp2_submit_ping(session, NULL)); + CU_ASSERT(0 == nghttp2_submit_ping(session, NGHTTP2_FLAG_NONE, NULL)); CU_ASSERT(1 == nghttp2_session_get_outbound_queue_size(session)); - CU_ASSERT(0 == nghttp2_submit_goaway(session, NGHTTP2_NO_ERROR, NULL, 0)); + CU_ASSERT(0 == nghttp2_submit_goaway(session, NGHTTP2_FLAG_NONE, + NGHTTP2_NO_ERROR, NULL, 0)); CU_ASSERT(2 == nghttp2_session_get_outbound_queue_size(session)); nghttp2_session_del(session); @@ -3540,7 +3545,7 @@ void test_nghttp2_session_data_backoff_by_high_pri_frame(void) /* data for DATA[1] is read from data_prd but it is not sent */ CU_ASSERT(ud.data_source_length == 8*1024); - nghttp2_submit_ping(session, NULL); + nghttp2_submit_ping(session, NGHTTP2_FLAG_NONE, NULL); ud.block_count = 2; /* Sends DATA[1] + PING, PING is interleaved in DATA sequence */ CU_ASSERT(0 == nghttp2_session_send(session));