From 56175a5544f7faf1d5a27ef0f88396d0a664a08f Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 27 Apr 2014 16:33:36 +0900 Subject: [PATCH] Update doc --- apiref.html | 34 +++++++++++++++++++++++++++++ genindex.html | 8 +++++++ nghttp2.h.html | 57 +++++++++++++++++++++++++++++++++++++++++-------- objects.inv | Bin 2437 -> 2455 bytes searchindex.js | 2 +- 5 files changed, 91 insertions(+), 10 deletions(-) diff --git a/apiref.html b/apiref.html index c749623d..98cc3e31 100644 --- a/apiref.html +++ b/apiref.html @@ -1816,6 +1816,30 @@ inclusive. Choosing number not in this range will be treated as NGHTTP2_ERR_CALLBACK_FAILURE.

+
+
+typedef int (*nghttp2_adjust_priority_callback)(nghttp2_session *session, const nghttp2_frame *frame, nghttp2_priority_spec *pri_spec, void *user_data)
+

Callback function invoked to adjust priority value for request +HEADERS. This callback is called only for request HEADERS (which +means, frame->hd.type == NGHTTP2_HEADERS && frame->headers.cat == +NGHTTP2_HCAT_REQUEST() hold) and before +nghttp2_before_frame_send_callback(). The application can +adjust priority value pri_spec. Initially, pri_spec is filled +with the current priority value, which is equal to +frame->headers.pri_spec(). If the application doesn’t alter +priority value, just return 0 without updating pri_spec.

+

Since the application doesn’t know stream ID when it submits +requests, it may not be able to add correct priority value to +HEADERS frame and forced to use follwing PRIORITY frame. The +purpose of this callback is give the chance to the application to +adjust priority value with the latest information it has just +before transmission so that correct priority is included in HEADERS +frame and it doesn’t have to send additional PRIORITY frame.

+

Returning NGHTTP2_ERR_CALLBACK_FAILURE will make +nghttp2_session_send() function immediately return +NGHTTP2_ERR_CALLBACK_FAILURE.

+
+
nghttp2_session_callbacks
@@ -1913,6 +1937,13 @@ many padding bytes are required for the transmission of the given frame.

+
+
+nghttp2_adjust_priority_callback adjust_priority_callback
+

Callback function invoked to adjust priority value just before +request HEADERS is serialized to the wire format.

+
+
@@ -2093,6 +2124,9 @@ which tells when each callback is invoked:

are not met (e.g., request HEADERS cannot be sent after GOAWAY), nghttp2_session_callbacks.on_frame_not_send_callback is invoked. Abort the following steps. +
  • If the frame is request HEADERS, +nghttp2_session_callbacks.adjust_priority_callback is +invoked.
  • If the frame is HEADERS, PUSH_PROMISE or DATA, nghttp2_session_callbacks.select_padding_callback is invoked.
  • diff --git a/genindex.html b/genindex.html index 7f0f6f31..b8367bab 100644 --- a/genindex.html +++ b/genindex.html @@ -167,6 +167,10 @@
    +
    nghttp2_adjust_priority_callback (C type) +
    + +
    NGHTTP2_ALTSVC (C macro)
    @@ -1001,6 +1005,10 @@ +
    nghttp2_session_callbacks.adjust_priority_callback (C member) +
    + +
    nghttp2_session_callbacks.before_frame_send_callback (C member)
    diff --git a/nghttp2.h.html b/nghttp2.h.html index 47e6ba26..c903d665 100644 --- a/nghttp2.h.html +++ b/nghttp2.h.html @@ -1580,6 +1580,37 @@ size_t max_payloadlen, void *user_data); +/** + * @functypedef + * + * Callback function invoked to adjust priority value for request + * HEADERS. This callback is called only for request HEADERS (which + * means, `frame->hd.type == NGHTTP2_HEADERS && frame->headers.cat == + * NGHTTP2_HCAT_REQUEST` hold) and before + * :type:`nghttp2_before_frame_send_callback()`. The application can + * adjust priority value |pri_spec|. Initially, |pri_spec| is filled + * with the current priority value, which is equal to + * `frame->headers.pri_spec`. If the application doesn't alter + * priority value, just return 0 without updating |pri_spec|. + * + * Since the application doesn't know stream ID when it submits + * requests, it may not be able to add correct priority value to + * HEADERS frame and forced to use follwing PRIORITY frame. The + * purpose of this callback is give the chance to the application to + * adjust priority value with the latest information it has just + * before transmission so that correct priority is included in HEADERS + * frame and it doesn't have to send additional PRIORITY frame. + * + * Returning :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` will make + * `nghttp2_session_send()` function immediately return + * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. + */ +typedef int (*nghttp2_adjust_priority_callback) +(nghttp2_session *session, + const nghttp2_frame *frame, + nghttp2_priority_spec *pri_spec, + void *user_data); + /** * @struct * @@ -1653,6 +1684,11 @@ * frame. */ nghttp2_select_padding_callback select_padding_callback; + /** + * Callback function invoked to adjust priority value just before + * request HEADERS is serialized to the wire format. + */ + nghttp2_adjust_priority_callback adjust_priority_callback; } nghttp2_session_callbacks; struct nghttp2_option; @@ -1859,20 +1895,23 @@ * are not met (e.g., request HEADERS cannot be sent after GOAWAY), * :member:`nghttp2_session_callbacks.on_frame_not_send_callback` * is invoked. Abort the following steps. - * 4. If the frame is HEADERS, PUSH_PROMISE or DATA, + * 4. If the frame is request HEADERS, + * :member:`nghttp2_session_callbacks.adjust_priority_callback` is + * invoked. + * 5. If the frame is HEADERS, PUSH_PROMISE or DATA, * :member:`nghttp2_session_callbacks.select_padding_callback` is * invoked. - * 5. If the frame is request HEADERS, the stream is opened here. - * 6. :member:`nghttp2_session_callbacks.before_frame_send_callback` is + * 6. If the frame is request HEADERS, the stream is opened here. + * 7. :member:`nghttp2_session_callbacks.before_frame_send_callback` is * invoked. - * 7. :member:`nghttp2_session_callbacks.send_callback` is invoked one + * 8. :member:`nghttp2_session_callbacks.send_callback` is invoked one * or more times to send the frame. - * 8. :member:`nghttp2_session_callbacks.on_frame_send_callback` is - * invoked. - * 9. If the transmission of the frame triggers closure of the stream, - * the stream is closed and - * :member:`nghttp2_session_callbacks.on_stream_close_callback` is + * 9. :member:`nghttp2_session_callbacks.on_frame_send_callback` is * invoked. + * 10. If the transmission of the frame triggers closure of the stream, + * the stream is closed and + * :member:`nghttp2_session_callbacks.on_stream_close_callback` is + * invoked. * * This function returns 0 if it succeeds, or one of the following * negative error codes: diff --git a/objects.inv b/objects.inv index 96ddcade134594b89661a34071fd7c9505413b83..80da55818a314482b7d12145bc3aee0ac50ec0e8 100644 GIT binary patch delta 2352 zcmV-03D5S06PFW^fPcx7qc{+~_g6S#=GsI|ALmBfauqQcJS?@$ML~gVGlhX>vAg=~ zCj|(b@Mk20DV586Pw9OY#c3pd&dMtKGYQ^AGW+_+EdThr@4nD>)js)cw#uS9 z5i>)6^kpm3D}&Uh-H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