Upgrade to 1.46.0
[platform/upstream/nghttp2.git] / doc / nghttp2_submit_priority.rst
1
2 nghttp2_submit_priority
3 =======================
4
5 Synopsis
6 --------
7
8 *#include <nghttp2/nghttp2.h>*
9
10 .. function:: int nghttp2_submit_priority(nghttp2_session *session, uint8_t flags, int32_t stream_id, const nghttp2_priority_spec *pri_spec)
11
12     
13     Submits PRIORITY frame to change the priority of stream *stream_id*
14     to the priority specification *pri_spec*.
15     
16     The *flags* is currently ignored and should be
17     :macro:`nghttp2_flag.NGHTTP2_FLAG_NONE`.
18     
19     The *pri_spec* is priority specification of this request.  ``NULL``
20     is not allowed for this function. To specify the priority, use
21     `nghttp2_priority_spec_init()`.  This function will copy its data
22     members.
23     
24     The ``pri_spec->weight`` must be in [:macro:`NGHTTP2_MIN_WEIGHT`,
25     :macro:`NGHTTP2_MAX_WEIGHT`], inclusive.  If ``pri_spec->weight``
26     is strictly less than :macro:`NGHTTP2_MIN_WEIGHT`, it becomes
27     :macro:`NGHTTP2_MIN_WEIGHT`.  If it is strictly greater than
28     :macro:`NGHTTP2_MAX_WEIGHT`, it becomes
29     :macro:`NGHTTP2_MAX_WEIGHT`.
30     
31     This function returns 0 if it succeeds, or one of the following
32     negative error codes:
33     
34     :macro:`nghttp2_error.NGHTTP2_ERR_NOMEM`
35         Out of memory.
36     :macro:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT`
37         The *stream_id* is 0; or the *pri_spec* is NULL; or trying to
38         depend on itself.