mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-08 11:08:52 +08:00
Add int return value to on_frame_not_send_callback
This commit is contained in:
@@ -879,8 +879,13 @@ typedef int (*nghttp2_on_frame_send_callback)
|
||||
* sent because of the error. The error is indicated by the
|
||||
* |lib_error_code|, which is one of the values defined in
|
||||
* :type:`nghttp2_error`.
|
||||
*
|
||||
* The implementation of this function must return 0 if it
|
||||
* succeeds. If nonzero is returned, it is treated as fatal error and
|
||||
* `nghttp2_session_recv()` and `nghttp2_session_send()` functions
|
||||
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
|
||||
*/
|
||||
typedef void (*nghttp2_on_frame_not_send_callback)
|
||||
typedef int (*nghttp2_on_frame_not_send_callback)
|
||||
(nghttp2_session *session, nghttp2_frame *frame, int lib_error_code,
|
||||
void *user_data);
|
||||
|
||||
|
||||
@@ -1474,8 +1474,10 @@ int nghttp2_session_send(nghttp2_session *session)
|
||||
it. */
|
||||
nghttp2_frame *frame = nghttp2_outbound_item_get_ctrl_frame(item);
|
||||
if(frame->hd.type != NGHTTP2_WINDOW_UPDATE) {
|
||||
session->callbacks.on_frame_not_send_callback
|
||||
(session, frame, framebuflen, session->user_data);
|
||||
if(session->callbacks.on_frame_not_send_callback
|
||||
(session, frame, framebuflen, session->user_data) != 0) {
|
||||
return NGHTTP2_ERR_CALLBACK_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
nghttp2_outbound_item_free(item);
|
||||
|
||||
Reference in New Issue
Block a user