Imported Upstream version 1.0.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_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`` is
26     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 :macro:`NGHTTP2_MAX_WEIGHT`.
29     
30     This function returns 0 if it succeeds, or one of the following
31     negative error codes:
32     
33     :macro:`NGHTTP2_ERR_NOMEM`
34         Out of memory.
35     :macro:`NGHTTP2_ERR_INVALID_ARGUMENT`
36         The *stream_id* is 0; or the *pri_spec* is NULL; or trying to
37         depend on itself.