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_TOO_MANY_SETTINGS
176 When a local endpoint receives too many settings entries
177 in a single SETTINGS frame.
178 .. macro:: NGHTTP2_ERR_FATAL
181 The errors < :macro:`NGHTTP2_ERR_FATAL` mean that the library is
182 under unexpected condition and processing was terminated (e.g.,
183 out of memory). If application receives this error code, it must
184 stop using that :type:`nghttp2_session` object and only allowed
185 operation for that object is deallocate it using
186 `nghttp2_session_del()`.
187 .. macro:: NGHTTP2_ERR_NOMEM
190 Out of memory. This is a fatal error.
191 .. macro:: NGHTTP2_ERR_CALLBACK_FAILURE
194 The user callback function failed. This is a fatal error.
195 .. macro:: NGHTTP2_ERR_BAD_CLIENT_MAGIC
198 Invalid client magic (see :macro:`NGHTTP2_CLIENT_MAGIC`) was
199 received and further processing is not possible.
200 .. macro:: NGHTTP2_ERR_FLOODED
203 Possible flooding by peer was detected in this HTTP/2 session.
204 Flooding is measured by how many PING and SETTINGS frames with
205 ACK flag set are queued for transmission. These frames are
206 response for the peer initiated frames, and peer can cause memory
207 exhaustion on server side to send these frames forever and does
210 .. type:: nghttp2_nv_flag
213 The flags for header field name/value pair.
215 .. macro:: NGHTTP2_NV_FLAG_NONE
219 .. macro:: NGHTTP2_NV_FLAG_NO_INDEX
222 Indicates that this name/value pair must not be indexed ("Literal
223 Header Field never Indexed" representation must be used in HPACK
224 encoding). Other implementation calls this bit as "sensitive".
225 .. macro:: NGHTTP2_NV_FLAG_NO_COPY_NAME
228 This flag is set solely by application. If this flag is set, the
229 library does not make a copy of header field name. This could
231 .. macro:: NGHTTP2_NV_FLAG_NO_COPY_VALUE
234 This flag is set solely by application. If this flag is set, the
235 library does not make a copy of header field value. This could
238 .. type:: nghttp2_frame_type
241 The frame types in HTTP/2 specification.
243 .. macro:: NGHTTP2_DATA
247 .. macro:: NGHTTP2_HEADERS
251 .. macro:: NGHTTP2_PRIORITY
255 .. macro:: NGHTTP2_RST_STREAM
258 The RST_STREAM frame.
259 .. macro:: NGHTTP2_SETTINGS
263 .. macro:: NGHTTP2_PUSH_PROMISE
266 The PUSH_PROMISE frame.
267 .. macro:: NGHTTP2_PING
271 .. macro:: NGHTTP2_GOAWAY
275 .. macro:: NGHTTP2_WINDOW_UPDATE
278 The WINDOW_UPDATE frame.
279 .. macro:: NGHTTP2_CONTINUATION
282 The CONTINUATION frame. This frame type won't be passed to any
283 callbacks because the library processes this frame type and its
284 preceding HEADERS/PUSH_PROMISE as a single frame.
285 .. macro:: NGHTTP2_ALTSVC
288 The ALTSVC frame, which is defined in `RFC 7383
289 <https://tools.ietf.org/html/rfc7838#section-4>`_.
290 .. macro:: NGHTTP2_ORIGIN
293 The ORIGIN frame, which is defined by `RFC 8336
294 <https://tools.ietf.org/html/rfc8336>`_.
296 .. type:: nghttp2_flag
299 The flags for HTTP/2 frames. This enum defines all flags for all
302 .. macro:: NGHTTP2_FLAG_NONE
306 .. macro:: NGHTTP2_FLAG_END_STREAM
310 .. macro:: NGHTTP2_FLAG_END_HEADERS
313 The END_HEADERS flag.
314 .. macro:: NGHTTP2_FLAG_ACK
318 .. macro:: NGHTTP2_FLAG_PADDED
322 .. macro:: NGHTTP2_FLAG_PRIORITY
327 .. type:: nghttp2_settings_id
331 .. macro:: NGHTTP2_SETTINGS_HEADER_TABLE_SIZE
334 SETTINGS_HEADER_TABLE_SIZE
335 .. macro:: NGHTTP2_SETTINGS_ENABLE_PUSH
339 .. macro:: NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS
342 SETTINGS_MAX_CONCURRENT_STREAMS
343 .. macro:: NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE
346 SETTINGS_INITIAL_WINDOW_SIZE
347 .. macro:: NGHTTP2_SETTINGS_MAX_FRAME_SIZE
350 SETTINGS_MAX_FRAME_SIZE
351 .. macro:: NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE
354 SETTINGS_MAX_HEADER_LIST_SIZE
355 .. macro:: NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL
358 SETTINGS_ENABLE_CONNECT_PROTOCOL
359 (`RFC 8441 <https://tools.ietf.org/html/rfc8441>`_)
361 .. type:: nghttp2_error_code
363 The status codes for the RST_STREAM and GOAWAY frames.
365 .. macro:: NGHTTP2_NO_ERROR
369 .. macro:: NGHTTP2_PROTOCOL_ERROR
373 .. macro:: NGHTTP2_INTERNAL_ERROR
377 .. macro:: NGHTTP2_FLOW_CONTROL_ERROR
381 .. macro:: NGHTTP2_SETTINGS_TIMEOUT
385 .. macro:: NGHTTP2_STREAM_CLOSED
389 .. macro:: NGHTTP2_FRAME_SIZE_ERROR
393 .. macro:: NGHTTP2_REFUSED_STREAM
397 .. macro:: NGHTTP2_CANCEL
401 .. macro:: NGHTTP2_COMPRESSION_ERROR
405 .. macro:: NGHTTP2_CONNECT_ERROR
409 .. macro:: NGHTTP2_ENHANCE_YOUR_CALM
413 .. macro:: NGHTTP2_INADEQUATE_SECURITY
417 .. macro:: NGHTTP2_HTTP_1_1_REQUIRED
422 .. type:: nghttp2_data_flag
425 The flags used to set in *data_flags* output parameter in
426 :type:`nghttp2_data_source_read_callback`.
428 .. macro:: NGHTTP2_DATA_FLAG_NONE
432 .. macro:: NGHTTP2_DATA_FLAG_EOF
435 Indicates EOF was sensed.
436 .. macro:: NGHTTP2_DATA_FLAG_NO_END_STREAM
439 Indicates that END_STREAM flag must not be set even if
440 NGHTTP2_DATA_FLAG_EOF is set. Usually this flag is used to send
441 trailer fields with `nghttp2_submit_request()` or
442 `nghttp2_submit_response()`.
443 .. macro:: NGHTTP2_DATA_FLAG_NO_COPY
446 Indicates that application will send complete DATA frame in
447 :type:`nghttp2_send_data_callback`.
449 .. type:: nghttp2_headers_category
452 The category of HEADERS, which indicates the role of the frame. In
453 HTTP/2 spec, request, response, push response and other arbitrary
454 headers (e.g., trailer fields) are all called just HEADERS. To
455 give the application the role of incoming HEADERS frame, we define
458 .. macro:: NGHTTP2_HCAT_REQUEST
461 The HEADERS frame is opening new stream, which is analogous to
463 .. macro:: NGHTTP2_HCAT_RESPONSE
466 The HEADERS frame is the first response headers, which is
467 analogous to SYN_REPLY in SPDY.
468 .. macro:: NGHTTP2_HCAT_PUSH_RESPONSE
471 The HEADERS frame is the first headers sent against reserved
473 .. macro:: NGHTTP2_HCAT_HEADERS
476 The HEADERS frame which does not apply for the above categories,
477 which is analogous to HEADERS in SPDY. If non-final response
478 (e.g., status 1xx) is used, final response HEADERS frame will be
481 .. type:: nghttp2_hd_inflate_flag
484 The flags for header inflation.
486 .. macro:: NGHTTP2_HD_INFLATE_NONE
490 .. macro:: NGHTTP2_HD_INFLATE_FINAL
493 Indicates all headers were inflated.
494 .. macro:: NGHTTP2_HD_INFLATE_EMIT
497 Indicates a header was emitted.
499 .. type:: nghttp2_stream_proto_state
502 State of stream as described in RFC 7540.
504 .. macro:: NGHTTP2_STREAM_STATE_IDLE
508 .. macro:: NGHTTP2_STREAM_STATE_OPEN,
511 .. macro:: NGHTTP2_STREAM_STATE_RESERVED_LOCAL,
513 reserved (local) state.
514 .. macro:: NGHTTP2_STREAM_STATE_RESERVED_REMOTE,
516 reserved (remote) state.
517 .. macro:: NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL,
519 half closed (local) state.
520 .. macro:: NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE,
522 half closed (remote) state.
523 .. macro:: NGHTTP2_STREAM_STATE_CLOSED