4 .. type:: nghttp2_error
7 Error codes used in this library. The code range is [-999, -500],
8 inclusive. The following values are defined:
10 .. macro:: NGHTTP2_ERR_INVALID_ARGUMENT
13 Invalid argument passed.
14 .. macro:: NGHTTP2_ERR_BUFFER_ERROR
18 .. macro:: NGHTTP2_ERR_UNSUPPORTED_VERSION
21 The specified protocol version is not supported.
22 .. macro:: NGHTTP2_ERR_WOULDBLOCK
25 Used as a return value from :type:`nghttp2_send_callback`,
26 :type:`nghttp2_recv_callback` and
27 :type:`nghttp2_send_data_callback` to indicate that the operation
29 .. macro:: NGHTTP2_ERR_PROTO
32 General protocol error
33 .. macro:: NGHTTP2_ERR_INVALID_FRAME
37 .. macro:: NGHTTP2_ERR_EOF
40 The peer performed a shutdown on the connection.
41 .. macro:: NGHTTP2_ERR_DEFERRED
44 Used as a return value from
45 :func:`nghttp2_data_source_read_callback` to indicate that data
46 transfer is postponed. See
47 :func:`nghttp2_data_source_read_callback` for details.
48 .. macro:: NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE
51 Stream ID has reached the maximum value. Therefore no stream ID
53 .. macro:: NGHTTP2_ERR_STREAM_CLOSED
56 The stream is already closed; or the stream ID is invalid.
57 .. macro:: NGHTTP2_ERR_STREAM_CLOSING
60 RST_STREAM has been added to the outbound queue. The stream is
62 .. macro:: NGHTTP2_ERR_STREAM_SHUT_WR
65 The transmission is not allowed for this stream (e.g., a frame
66 with END_STREAM flag set has already sent).
67 .. macro:: NGHTTP2_ERR_INVALID_STREAM_ID
70 The stream ID is invalid.
71 .. macro:: NGHTTP2_ERR_INVALID_STREAM_STATE
74 The state of the stream is not valid (e.g., DATA cannot be sent
75 to the stream if response HEADERS has not been sent).
76 .. macro:: NGHTTP2_ERR_DEFERRED_DATA_EXIST
79 Another DATA frame has already been deferred.
80 .. macro:: NGHTTP2_ERR_START_STREAM_NOT_ALLOWED
83 Starting new stream is not allowed (e.g., GOAWAY has been sent
85 .. macro:: NGHTTP2_ERR_GOAWAY_ALREADY_SENT
88 GOAWAY has already been sent.
89 .. macro:: NGHTTP2_ERR_INVALID_HEADER_BLOCK
92 The received frame contains the invalid header block (e.g., There
93 are duplicate header names; or the header names are not encoded
94 in US-ASCII character set and not lower cased; or the header name
95 is zero-length string; or the header value contains multiple
96 in-sequence NUL bytes).
97 .. macro:: NGHTTP2_ERR_INVALID_STATE
100 Indicates that the context is not suitable to perform the
102 .. macro:: NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE
105 The user callback function failed due to the temporal error.
106 .. macro:: NGHTTP2_ERR_FRAME_SIZE_ERROR
109 The length of the frame is invalid, either too large or too small.
110 .. macro:: NGHTTP2_ERR_HEADER_COMP
113 Header block inflate/deflate error.
114 .. macro:: NGHTTP2_ERR_FLOW_CONTROL
118 .. macro:: NGHTTP2_ERR_INSUFF_BUFSIZE
121 Insufficient buffer size given to function.
122 .. macro:: NGHTTP2_ERR_PAUSE
125 Callback was paused by the application
126 .. macro:: NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS
129 There are too many in-flight SETTING frame and no more
130 transmission of SETTINGS is allowed.
131 .. macro:: NGHTTP2_ERR_PUSH_DISABLED
134 The server push is disabled.
135 .. macro:: NGHTTP2_ERR_DATA_EXIST
138 DATA or HEADERS frame for a given stream has been already
139 submitted and has not been fully processed yet. Application
140 should wait for the transmission of the previously submitted
141 frame before submitting another.
142 .. macro:: NGHTTP2_ERR_SESSION_CLOSING
145 The current session is closing due to a connection error or
146 `nghttp2_session_terminate_session()` is called.
147 .. macro:: NGHTTP2_ERR_HTTP_HEADER
150 Invalid HTTP header field was received and stream is going to be
152 .. macro:: NGHTTP2_ERR_HTTP_MESSAGING
155 Violation in HTTP messaging rule.
156 .. macro:: NGHTTP2_ERR_REFUSED_STREAM
160 .. macro:: NGHTTP2_ERR_INTERNAL
163 Unexpected internal error, but recovered.
164 .. macro:: NGHTTP2_ERR_CANCEL
167 Indicates that a processing was canceled.
168 .. macro:: NGHTTP2_ERR_SETTINGS_EXPECTED
171 When a local endpoint expects to receive SETTINGS frame, it
172 receives an other type of frame.
173 .. macro:: NGHTTP2_ERR_FATAL
176 The errors < :macro:`NGHTTP2_ERR_FATAL` mean that the library is
177 under unexpected condition and processing was terminated (e.g.,
178 out of memory). If application receives this error code, it must
179 stop using that :type:`nghttp2_session` object and only allowed
180 operation for that object is deallocate it using
181 `nghttp2_session_del()`.
182 .. macro:: NGHTTP2_ERR_NOMEM
185 Out of memory. This is a fatal error.
186 .. macro:: NGHTTP2_ERR_CALLBACK_FAILURE
189 The user callback function failed. This is a fatal error.
190 .. macro:: NGHTTP2_ERR_BAD_CLIENT_MAGIC
193 Invalid client magic (see :macro:`NGHTTP2_CLIENT_MAGIC`) was
194 received and further processing is not possible.
195 .. macro:: NGHTTP2_ERR_FLOODED
198 Possible flooding by peer was detected in this HTTP/2 session.
199 Flooding is measured by how many PING and SETTINGS frames with
200 ACK flag set are queued for transmission. These frames are
201 response for the peer initiated frames, and peer can cause memory
202 exhaustion on server side to send these frames forever and does
205 .. type:: nghttp2_nv_flag
208 The flags for header field name/value pair.
210 .. macro:: NGHTTP2_NV_FLAG_NONE
214 .. macro:: NGHTTP2_NV_FLAG_NO_INDEX
217 Indicates that this name/value pair must not be indexed ("Literal
218 Header Field never Indexed" representation must be used in HPACK
219 encoding). Other implementation calls this bit as "sensitive".
220 .. macro:: NGHTTP2_NV_FLAG_NO_COPY_NAME
223 This flag is set solely by application. If this flag is set, the
224 library does not make a copy of header field name. This could
226 .. macro:: NGHTTP2_NV_FLAG_NO_COPY_VALUE
229 This flag is set solely by application. If this flag is set, the
230 library does not make a copy of header field value. This could
233 .. type:: nghttp2_frame_type
236 The frame types in HTTP/2 specification.
238 .. macro:: NGHTTP2_DATA
242 .. macro:: NGHTTP2_HEADERS
246 .. macro:: NGHTTP2_PRIORITY
250 .. macro:: NGHTTP2_RST_STREAM
253 The RST_STREAM frame.
254 .. macro:: NGHTTP2_SETTINGS
258 .. macro:: NGHTTP2_PUSH_PROMISE
261 The PUSH_PROMISE frame.
262 .. macro:: NGHTTP2_PING
266 .. macro:: NGHTTP2_GOAWAY
270 .. macro:: NGHTTP2_WINDOW_UPDATE
273 The WINDOW_UPDATE frame.
274 .. macro:: NGHTTP2_CONTINUATION
277 The CONTINUATION frame. This frame type won't be passed to any
278 callbacks because the library processes this frame type and its
279 preceding HEADERS/PUSH_PROMISE as a single frame.
280 .. macro:: NGHTTP2_ALTSVC
283 The ALTSVC frame, which is defined in `RFC 7383
284 <https://tools.ietf.org/html/rfc7838#section-4>`_.
285 .. macro:: NGHTTP2_ORIGIN
288 The ORIGIN frame, which is defined by `RFC 8336
289 <https://tools.ietf.org/html/rfc8336>`_.
291 .. type:: nghttp2_flag
294 The flags for HTTP/2 frames. This enum defines all flags for all
297 .. macro:: NGHTTP2_FLAG_NONE
301 .. macro:: NGHTTP2_FLAG_END_STREAM
305 .. macro:: NGHTTP2_FLAG_END_HEADERS
308 The END_HEADERS flag.
309 .. macro:: NGHTTP2_FLAG_ACK
313 .. macro:: NGHTTP2_FLAG_PADDED
317 .. macro:: NGHTTP2_FLAG_PRIORITY
322 .. type:: nghttp2_settings_id
326 .. macro:: NGHTTP2_SETTINGS_HEADER_TABLE_SIZE
329 SETTINGS_HEADER_TABLE_SIZE
330 .. macro:: NGHTTP2_SETTINGS_ENABLE_PUSH
334 .. macro:: NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS
337 SETTINGS_MAX_CONCURRENT_STREAMS
338 .. macro:: NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE
341 SETTINGS_INITIAL_WINDOW_SIZE
342 .. macro:: NGHTTP2_SETTINGS_MAX_FRAME_SIZE
345 SETTINGS_MAX_FRAME_SIZE
346 .. macro:: NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE
349 SETTINGS_MAX_HEADER_LIST_SIZE
350 .. macro:: NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL
353 SETTINGS_ENABLE_CONNECT_PROTOCOL
354 (`RFC 8441 <https://tools.ietf.org/html/rfc8441>`_)
356 .. type:: nghttp2_error_code
358 The status codes for the RST_STREAM and GOAWAY frames.
360 .. macro:: NGHTTP2_NO_ERROR
364 .. macro:: NGHTTP2_PROTOCOL_ERROR
368 .. macro:: NGHTTP2_INTERNAL_ERROR
372 .. macro:: NGHTTP2_FLOW_CONTROL_ERROR
376 .. macro:: NGHTTP2_SETTINGS_TIMEOUT
380 .. macro:: NGHTTP2_STREAM_CLOSED
384 .. macro:: NGHTTP2_FRAME_SIZE_ERROR
388 .. macro:: NGHTTP2_REFUSED_STREAM
392 .. macro:: NGHTTP2_CANCEL
396 .. macro:: NGHTTP2_COMPRESSION_ERROR
400 .. macro:: NGHTTP2_CONNECT_ERROR
404 .. macro:: NGHTTP2_ENHANCE_YOUR_CALM
408 .. macro:: NGHTTP2_INADEQUATE_SECURITY
412 .. macro:: NGHTTP2_HTTP_1_1_REQUIRED
417 .. type:: nghttp2_data_flag
420 The flags used to set in *data_flags* output parameter in
421 :type:`nghttp2_data_source_read_callback`.
423 .. macro:: NGHTTP2_DATA_FLAG_NONE
427 .. macro:: NGHTTP2_DATA_FLAG_EOF
430 Indicates EOF was sensed.
431 .. macro:: NGHTTP2_DATA_FLAG_NO_END_STREAM
434 Indicates that END_STREAM flag must not be set even if
435 NGHTTP2_DATA_FLAG_EOF is set. Usually this flag is used to send
436 trailer fields with `nghttp2_submit_request()` or
437 `nghttp2_submit_response()`.
438 .. macro:: NGHTTP2_DATA_FLAG_NO_COPY
441 Indicates that application will send complete DATA frame in
442 :type:`nghttp2_send_data_callback`.
444 .. type:: nghttp2_headers_category
447 The category of HEADERS, which indicates the role of the frame. In
448 HTTP/2 spec, request, response, push response and other arbitrary
449 headers (e.g., trailer fields) are all called just HEADERS. To
450 give the application the role of incoming HEADERS frame, we define
453 .. macro:: NGHTTP2_HCAT_REQUEST
456 The HEADERS frame is opening new stream, which is analogous to
458 .. macro:: NGHTTP2_HCAT_RESPONSE
461 The HEADERS frame is the first response headers, which is
462 analogous to SYN_REPLY in SPDY.
463 .. macro:: NGHTTP2_HCAT_PUSH_RESPONSE
466 The HEADERS frame is the first headers sent against reserved
468 .. macro:: NGHTTP2_HCAT_HEADERS
471 The HEADERS frame which does not apply for the above categories,
472 which is analogous to HEADERS in SPDY. If non-final response
473 (e.g., status 1xx) is used, final response HEADERS frame will be
476 .. type:: nghttp2_hd_inflate_flag
479 The flags for header inflation.
481 .. macro:: NGHTTP2_HD_INFLATE_NONE
485 .. macro:: NGHTTP2_HD_INFLATE_FINAL
488 Indicates all headers were inflated.
489 .. macro:: NGHTTP2_HD_INFLATE_EMIT
492 Indicates a header was emitted.
494 .. type:: nghttp2_stream_proto_state
497 State of stream as described in RFC 7540.
499 .. macro:: NGHTTP2_STREAM_STATE_IDLE
503 .. macro:: NGHTTP2_STREAM_STATE_OPEN,
506 .. macro:: NGHTTP2_STREAM_STATE_RESERVED_LOCAL,
508 reserved (local) state.
509 .. macro:: NGHTTP2_STREAM_STATE_RESERVED_REMOTE,
511 reserved (remote) state.
512 .. macro:: NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL,
514 half closed (local) state.
515 .. macro:: NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE,
517 half closed (remote) state.
518 .. macro:: NGHTTP2_STREAM_STATE_CLOSED