Imported Upstream version 1.46.0
[platform/upstream/nghttp2.git] / doc / nghttp2_session_set_local_window_size.rst
1
2 nghttp2_session_set_local_window_size
3 =====================================
4
5 Synopsis
6 --------
7
8 *#include <nghttp2/nghttp2.h>*
9
10 .. function:: int nghttp2_session_set_local_window_size(nghttp2_session *session, uint8_t flags, int32_t stream_id, int32_t window_size)
11
12     
13     Set local window size (local endpoints's window size) to the given
14     *window_size* for the given stream denoted by *stream_id*.  To
15     change connection level window size, specify 0 to *stream_id*.  To
16     increase window size, this function may submit WINDOW_UPDATE frame
17     to transmission queue.
18     
19     The *flags* is currently ignored and should be
20     :macro:`nghttp2_flag.NGHTTP2_FLAG_NONE`.
21     
22     This sounds similar to `nghttp2_submit_window_update()`, but there
23     are 2 differences.  The first difference is that this function
24     takes the absolute value of window size to set, rather than the
25     delta.  To change the window size, this may be easier to use since
26     the application just declares the intended window size, rather than
27     calculating delta.  The second difference is that
28     `nghttp2_submit_window_update()` affects the received bytes count
29     which has not acked yet.  By the specification of
30     `nghttp2_submit_window_update()`, to strictly increase the local
31     window size, we have to submit delta including all received bytes
32     count, which might not be desirable in some cases.  On the other
33     hand, this function does not affect the received bytes count.  It
34     just sets the local window size to the given value.
35     
36     This function returns 0 if it succeeds, or one of the following
37     negative error codes:
38     
39     :macro:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT`
40         The *stream_id* is negative.
41     :macro:`nghttp2_error.NGHTTP2_ERR_NOMEM`
42         Out of memory.