Macros
-
NGHTTP2_VERSION
Version number of the nghttp2 library release.
-
NGHTTP2_VERSION_NUM
Numerical representation of the version number of the nghttp2 library release. This is a 24 bit number with 8 bits for major number, 8 bits for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
HTTP/2 specific macros
-
NGHTTP2_CLIENT_HTTP2_PREFACE
NGHTTP2_CLIENT_HTTP2_PREFACEis the client HTTP/2 preface.
-
NGHTTP2_HPACK_DEFAULT_DTABLE_CAPACITY
NGHTTP2_HPACK_DEFAULT_DTABLE_CAPACITYis the default maximum HPACK dynamic header table capacity.
-
NGHTTP2_INITIAL_WINDOW_SIZE
NGHTTP2_INITIAL_WINDOW_SIZEis the default initial window size for both connection and stream-level flow control.
-
NGHTTP2_MAX_EXTRA_SETTINGS
NGHTTP2_MAX_EXTRA_SETTINGSis the maximum number of extra SETTINGS entries that can be specified innghttp2_settings.extra_settingsandnghttp2_settings.extra_settingslen.
nghttp2 library error codes
-
NGHTTP2_ERR_INVALID_ARGUMENT
NGHTTP2_ERR_INVALID_ARGUMENTindicates that a passed argument is invalid.
-
NGHTTP2_ERR_NOBUF
NGHTTP2_ERR_NOBUFindicates that a provided buffer does not have enough space to store data.
-
NGHTTP2_ERR_PROTO
NGHTTP2_ERR_PROTOindicates a general protocol error.
-
NGHTTP2_ERR_INVALID_STATE
NGHTTP2_ERR_INVALID_STATEindicates that a requested operation is not allowed at the current connection state.
-
NGHTTP2_ERR_HPACK_FATAL
NGHTTP2_ERR_HPACK_FATALindicates that HPACK encoder or decoder encounters an error.
-
NGHTTP2_ERR_STREAM_ID_BLOCKED
NGHTTP2_ERR_STREAM_ID_BLOCKEDindicates that there is no spare stream ID available.
-
NGHTTP2_ERR_REFUSED_STREAM
NGHTTP2_ERR_REFUSED_STREAMindicates that stream creation is refused.
-
NGHTTP2_ERR_WOULDBLOCK
NGHTTP2_ERR_WOULDBLOCKindicates that an operation might block.
-
NGHTTP2_ERR_FLOW_CONTROL
NGHTTP2_ERR_FLOW_CONTROLindicates flow control error.
-
NGHTTP2_ERR_FRAME_SIZE
NGHTTP2_ERR_FRAME_SIZEindicates that the incoming frame is too large.
-
NGHTTP2_ERR_STREAM_LIMIT
NGHTTP2_ERR_STREAM_LIMITindicates that a remote endpoint opens more streams that is permitted.
-
NGHTTP2_ERR_MALFORMED_HTTP_HEADER
NGHTTP2_ERR_MALFORMED_HTTP_HEADERindicates that an HTTP header field is malformed.
-
NGHTTP2_ERR_REMOVE_HTTP_HEADER
NGHTTP2_ERR_REMOVE_HTTP_HEADERindicates that an HTTP header field is discarded.
-
NGHTTP2_ERR_MALFORMED_HTTP_MESSAGING
NGHTTP2_ERR_MALFORMED_HTTP_MESSAGINGindicates that HTTP messaging is malformed.
-
NGHTTP2_ERR_STREAM_DATA_OVERFLOW
NGHTTP2_ERR_STREAM_DATA_OVERFLOWindicates that stream data is too large.
-
NGHTTP2_ERR_SETTINGS_TIMEOUT
NGHTTP2_ERR_SETTINGS_TIMEOUTindicates that SETTINGS ACK has not been received within the configured period of time.
-
NGHTTP2_ERR_FRAME_ENCODING
NGHTTP2_ERR_FRAME_ENCODINGindicates there is an error in frame encoding.
-
NGHTTP2_ERR_STREAM_SHUT_WR
NGHTTP2_ERR_STREAM_SHUT_WRindicates no more data can be sent to a stream.
-
NGHTTP2_ERR_STREAM_NOT_FOUND
NGHTTP2_ERR_STREAM_NOT_FOUNDindicates that a stream was not found.
-
NGHTTP2_ERR_STREAM_STATE
NGHTTP2_ERR_STREAM_STATEindicates that a requested operation is not allowed at the current stream state.
-
NGHTTP2_ERR_STOP_READING
NGHTTP2_ERR_STOP_READINGindicates that the local endpoint stops reading any input.
-
NGHTTP2_ERR_CLOSING
NGHTTP2_ERR_CLOSINGindicates that connection is in closing state.
-
NGHTTP2_ERR_DRAINING
NGHTTP2_ERR_DRAININGindicates that connection is in draining state.
-
NGHTTP2_ERR_INTERNAL
NGHTTP2_ERR_INTERNALindicates an internal error.
-
NGHTTP2_ERR_FATAL
NGHTTP2_ERR_FATALindicates that error codes less than this value is fatal error. When this error is returned, an endpoint should close connection immediately.
-
NGHTTP2_ERR_NOMEM
NGHTTP2_ERR_NOMEMindicates out of memory.
-
NGHTTP2_ERR_CALLBACK_FAILURE
NGHTTP2_ERR_CALLBACK_FAILUREindicates that user defined callback function failed.
-
NGHTTP2_ERR_EXCESSIVE_LOAD
NGHTTP2_ERR_EXCESSIVE_LOADindicates that the remote endpoint exhibits the behavior that causes the excessive load to the local endpoint.
HTTP/2 error codes
-
NGHTTP2_NO_ERROR
NGHTTP2_NO_ERRORis HTTP/2 error codeNO_ERROR.
-
NGHTTP2_PROTOCOL_ERROR
NGHTTP2_PROTOCOL_ERRORis HTTP/2 error codePROTOCOL_ERROR.
-
NGHTTP2_INTERNAL_ERROR
NGHTTP2_INTERNAL_ERRORis HTTP/2 error codeINTERNAL_ERROR.
-
NGHTTP2_FLOW_CONTROL_ERROR
NGHTTP2_FLOW_CONTROL_ERRORis HTTP/2 error codeFLOW_CONTROL_ERROR.
-
NGHTTP2_SETTINGS_TIMEOUT
NGHTTP2_SETTINGS_TIMEOUTis HTTP/2 error codeSETTINGS_TIMEOUT.
-
NGHTTP2_STREAM_CLOSED
NGHTTP2_STREAM_CLOSEDis HTTP/2 error codeSTREAM_CLOSED.
-
NGHTTP2_FRAME_SIZE_ERROR
NGHTTP2_FRAME_SIZE_ERRORis HTTP/2 error codeFRAME_SIZE_ERROR.
-
NGHTTP2_REFUSED_STREAM
NGHTTP2_REFUSED_STREAMis HTTP/2 error codeREFUSED_STREAM.
-
NGHTTP2_CANCEL
NGHTTP2_CANCELis HTTP/2 error codeCANCEL.
-
NGHTTP2_COMPRESSION_ERROR
NGHTTP2_COMPRESSION_ERRORis HTTP/2 error codeCOMPRESSION_ERROR.
-
NGHTTP2_CONNECT_ERROR
NGHTTP2_CONNECT_ERRORis HTTP/2 error codeCONNECT_ERROR.
-
NGHTTP2_ENHANCE_YOUR_CALM
NGHTTP2_ENHANCE_YOUR_CALMis HTTP/2 error codeENHANCE_YOUR_CALM.
-
NGHTTP2_INADEQUATE_SECURITY
NGHTTP2_INADEQUATE_SECURITYis HTTP/2 error codeINADEQUATE_SECURITY.
-
NGHTTP2_HTTP_1_1_REQUIRED
NGHTTP2_HTTP_1_1_REQUIREDis HTTP/2 error codeHTTP_1_1_REQUIRED.
nghttp2_buf helper macros
-
nghttp2_buf_left(BUF)
nghttp2_buf_left()returns the number of additional bytes which can be written to the underlying buffer. In other words, it returnsbuf->end-buf->last.
-
nghttp2_buf_len(BUF)
nghttp2_buf_len()returns the number of bytes left to read. In other words, it returnsbuf->last-buf->pos.
Flags for HTTP field name/value pair
-
NGHTTP2_NV_FLAG_NONE
NGHTTP2_NV_FLAG_NONEindicates no flag set.
-
NGHTTP2_NV_FLAG_NEVER_INDEX
NGHTTP2_NV_FLAG_NEVER_INDEXindicates that this name/value pair must not be indexed. Other implementation calls this bit as “sensitive”.
-
NGHTTP2_NV_FLAG_NO_COPY_NAME
NGHTTP2_NV_FLAG_NO_COPY_NAMEis set solely by application. If this flag is set, the library does not make a copy of field name. This could improve performance.
-
NGHTTP2_NV_FLAG_NO_COPY_VALUE
NGHTTP2_NV_FLAG_NO_COPY_VALUEis set solely by application. If this flag is set, the library does not make a copy of field value. This could improve performance.
Stream close flags for nghttp2_stream_close callback.
-
NGHTTP2_STREAM_CLOSE_FLAG_NONE
NGHTTP2_STREAM_CLOSE_FLAG_NONEindicates no flag set.
-
NGHTTP2_STREAM_CLOSE_FLAG_ERROR_CODE_SET
NGHTTP2_STREAM_CLOSE_FLAG_ERROR_CODE_SETindicates that error_code parameter is set.
Data flags
-
NGHTTP2_READ_DATA_FLAG_NONE
NGHTTP2_READ_DATA_FLAG_NONEindicates no flag set.
-
NGHTTP2_READ_DATA_FLAG_EOF
NGHTTP2_READ_DATA_FLAG_EOFindicates that all request or response body has been provided to the library. It also indicates that sending side of stream is closed unlessNGHTTP2_READ_DATA_FLAG_NO_END_STREAMis given at the same time.
-
NGHTTP2_READ_DATA_FLAG_NO_END_STREAM
NGHTTP2_READ_DATA_FLAG_NO_END_STREAMindicates that sending side of stream is not closed even ifNGHTTP2_READ_DATA_FLAG_EOFis set. Usually this flag is used to send trailer fields withnghttp2_conn_submit_trailers(). Ifnghttp2_conn_submit_trailers()has been called, regardless of this flag, the submitted trailer fields are sent.
HTTP stream priority flags
-
NGHTTP2_DEFAULT_URGENCY
NGHTTP2_DEFAULT_URGENCYis the default urgency level.
-
NGHTTP2_URGENCY_HIGH
NGHTTP2_URGENCY_HIGHis the highest urgency level.
-
NGHTTP2_URGENCY_LOW
NGHTTP2_URGENCY_LOWis the lowest urgency level.
-
NGHTTP2_URGENCY_LEVELS
NGHTTP2_URGENCY_LEVELSis the number of urgency levels.
Flags for HPACK decoder
-
NGHTTP2_HPACK_DECODE_FLAG_NONE
NGHTTP2_HPACK_DECODE_FLAG_NONEindicates that no flag set.
-
NGHTTP2_HPACK_DECODE_FLAG_EMIT
NGHTTP2_HPACK_DECODE_FLAG_EMITindicates that an HTTP field is successfully decoded.
-
NGHTTP2_HPACK_DECODE_FLAG_FINAL
NGHTTP2_HPACK_DECODE_FLAG_FINALindicates that an entire HTTP field section has been decoded.