8 *#include <nghttp2/nghttp2.h>*
10 .. function:: int nghttp2_submit_altsvc(nghttp2_session *session, uint8_t flags, int32_t stream_id, const uint8_t *origin, size_t origin_len, const uint8_t *field_value, size_t field_value_len)
15 ALTSVC frame is a non-critical extension to HTTP/2, and defined in
16 `RFC 7383 <https://tools.ietf.org/html/rfc7838#section-4>`_.
18 The *flags* is currently ignored and should be
19 :macro:`nghttp2_flag.NGHTTP2_FLAG_NONE`.
21 The *origin* points to the origin this alternative service is
22 associated with. The *origin_len* is the length of the origin. If
23 *stream_id* is 0, the origin must be specified. If *stream_id* is
24 not zero, the origin must be empty (in other words, *origin_len*
27 The ALTSVC frame is only usable from server side. If this function
28 is invoked with client side session, this function returns
29 :macro:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`.
31 This function returns 0 if it succeeds, or one of the following
34 :macro:`nghttp2_error.NGHTTP2_ERR_NOMEM`
36 :macro:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`
37 The function is called from client side session
38 :macro:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT`
39 The sum of *origin_len* and *field_value_len* is larger than
40 16382; or *origin_len* is 0 while *stream_id* is 0; or
41 *origin_len* is not 0 while *stream_id* is not 0.