Imported Upstream version 1.0.0
[platform/upstream/nghttp2.git] / doc / nghttp2_submit_window_update.rst
1
2 nghttp2_submit_window_update
3 ============================
4
5 Synopsis
6 --------
7
8 *#include <nghttp2/nghttp2.h>*
9
10 .. function:: int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags, int32_t stream_id, int32_t window_size_increment)
11
12     
13     Submits WINDOW_UPDATE frame.
14     
15     The *flags* is currently ignored and should be
16     :macro:`NGHTTP2_FLAG_NONE`.
17     
18     The *stream_id* is the stream ID to send this WINDOW_UPDATE.  To
19     send connection level WINDOW_UPDATE, specify 0 to *stream_id*.
20     
21     If the *window_size_increment* is positive, the WINDOW_UPDATE with
22     that value as window_size_increment is queued.  If the
23     *window_size_increment* is larger than the received bytes from the
24     remote endpoint, the local window size is increased by that
25     difference.
26     
27     If the *window_size_increment* is negative, the local window size
28     is decreased by -*window_size_increment*.  If automatic
29     WINDOW_UPDATE is enabled
30     (`nghttp2_option_set_no_auto_window_update()`), and the library
31     decided that the WINDOW_UPDATE should be submitted, then
32     WINDOW_UPDATE is queued with the current received bytes count.
33     
34     If the *window_size_increment* is 0, the function does nothing and
35     returns 0.
36     
37     This function returns 0 if it succeeds, or one of the following
38     negative error codes:
39     
40     :macro:`NGHTTP2_ERR_FLOW_CONTROL`
41         The local window size overflow or gets negative.
42     :macro:`NGHTTP2_ERR_NOMEM`
43         Out of memory.