File: nghttp2_pack_settings_payload.rst

package info (click to toggle)
nghttp2 1.68.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,592 kB
  • sloc: ansic: 104,233; cpp: 55,792; ruby: 30,108; yacc: 7,083; sh: 4,643; makefile: 1,506; python: 806
file content (33 lines) | stat: -rw-r--r-- 1,276 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

nghttp2_pack_settings_payload
=============================

Synopsis
--------

*#include <nghttp2/nghttp2.h>*

.. function:: ssize_t nghttp2_pack_settings_payload( uint8_t *buf, size_t buflen, const nghttp2_settings_entry *iv, size_t niv)

    
    .. warning::
    
      Deprecated.  Use `nghttp2_pack_settings_payload2()` instead.
    
    Serializes the SETTINGS values *iv* in the *buf*.  The size of the
    *buf* is specified by *buflen*.  The number of entries in the *iv*
    array is given by *niv*.  The required space in *buf* for the *niv*
    entries is ``6*niv`` bytes and if the given buffer is too small, an
    error is returned.  This function is used mainly for creating a
    SETTINGS payload to be sent with the ``HTTP2-Settings`` header
    field in an HTTP Upgrade request.  The data written in *buf* is NOT
    base64url encoded and the application is responsible for encoding.
    
    This function returns the number of bytes written in *buf*, or one
    of the following negative error codes:
    
    :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT`
        The *iv* contains duplicate settings ID or invalid value.
    
    :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE`
        The provided *buflen* size is too small to hold the output.