demonstrate set frame size call back error

This commit is contained in:
robaho 2021-11-22 17:43:30 -06:00
parent 3c4449c046
commit fba7e2d94b
1 changed files with 13 additions and 0 deletions

View File

@ -1626,6 +1626,13 @@ int hd_on_frame_send_callback(nghttp2_session *session,
} }
} // namespace } // namespace
namespace {
ssize_t read_length_callback(nghttp2_session *session, uint8_t frame_type, int32_t stream_id, int32_t session_remote_window_size, int32_t stream_remote_window_size, uint32_t remote_max_frame_size, void *user_data){
return remote_max_frame_size;
}
} //namespace
namespace { namespace {
int send_data_callback(nghttp2_session *session, nghttp2_frame *frame, int send_data_callback(nghttp2_session *session, nghttp2_frame *frame,
const uint8_t *framehd, size_t length, const uint8_t *framehd, size_t length,
@ -1767,6 +1774,12 @@ void fill_callback(nghttp2_session_callbacks *callbacks, const Config *config) {
nghttp2_session_callbacks_set_send_data_callback(callbacks, nghttp2_session_callbacks_set_send_data_callback(callbacks,
send_data_callback); send_data_callback);
nghttp2_session_callbacks_set_data_source_read_length_callback(callbacks,
read_length_callback);
if (config->padding) { if (config->padding) {
nghttp2_session_callbacks_set_select_padding_callback( nghttp2_session_callbacks_set_select_padding_callback(
callbacks, select_padding_callback); callbacks, select_padding_callback);