mirror of
https://gitee.com/openharmony/third_party_nghttp2
synced 2024-11-24 00:10:12 +00:00
Added spdylay_before_ctrl_send_callback
This commit is contained in:
parent
7016fe1b75
commit
27e1bcab9e
@ -221,6 +221,15 @@ typedef void (*spdylay_on_data_send_callback)
|
||||
(spdylay_session *session, uint8_t flags, int32_t stream_id, int32_t length,
|
||||
void *user_data);
|
||||
|
||||
/*
|
||||
* Callback function invoked before frame |frame| of type |type| is
|
||||
* sent. This may be useful, for example, to know the stream ID of
|
||||
* SYN_STREAM frame, which is not assigned when it was queued.
|
||||
*/
|
||||
typedef void (*spdylay_before_ctrl_send_callback)
|
||||
(spdylay_session *session, spdylay_frame_type type, spdylay_frame *frame,
|
||||
void *user_data);
|
||||
|
||||
typedef struct {
|
||||
spdylay_send_callback send_callback;
|
||||
spdylay_recv_callback recv_callback;
|
||||
@ -229,6 +238,7 @@ typedef struct {
|
||||
spdylay_on_ping_recv_callback on_ping_recv_callback;
|
||||
spdylay_on_data_chunk_recv_callback on_data_chunk_recv_callback;
|
||||
spdylay_on_data_recv_callback on_data_recv_callback;
|
||||
spdylay_before_ctrl_send_callback before_ctrl_send_callback;
|
||||
spdylay_on_ctrl_send_callback on_ctrl_send_callback;
|
||||
spdylay_on_data_send_callback on_data_send_callback;
|
||||
} spdylay_session_callbacks;
|
||||
|
@ -519,7 +519,12 @@ int spdylay_session_send(spdylay_session *session)
|
||||
session->aob.item = item;
|
||||
session->aob.framebuf = framebuf;
|
||||
session->aob.framebuflen = framebuflen;
|
||||
/* TODO Call before_send callback */
|
||||
/* Call before_send callback */
|
||||
if(item->frame_type != SPDYLAY_DATA &&
|
||||
session->callbacks.before_ctrl_send_callback) {
|
||||
session->callbacks.before_ctrl_send_callback
|
||||
(session, item->frame_type, item->frame, session->user_data);
|
||||
}
|
||||
}
|
||||
data = session->aob.framebuf + session->aob.framebufoff;
|
||||
datalen = session->aob.framebuflen - session->aob.framebufoff;
|
||||
|
Loading…
Reference in New Issue
Block a user