view release on metacpan or search on metacpan
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
* @macro
*
* :macro:`NGHTTP3_ERR_H3_SETTINGS_ERROR` indicates that an HTTP/3
* SETTINGS frame is malformed.
*/
#define NGHTTP3_ERR_H3_SETTINGS_ERROR -608
/**
* @macro
*
* :macro:`NGHTTP3_ERR_H3_STREAM_CREATION_ERROR` indicates that a
* remote endpoint attempts to create a new stream which is not
* allowed.
*/
#define NGHTTP3_ERR_H3_STREAM_CREATION_ERROR -609
/**
* @macro
*
* :macro:`NGHTTP3_ERR_H3_EXCESSIVE_LOAD` indicates that a local
* endpoint detected that its remote endpoint is exhibiting a behavior
* that might generating excessive load.
*/
#define NGHTTP3_ERR_H3_EXCESSIVE_LOAD -610
/**
* @macro
*
* :macro:`NGHTTP3_ERR_FATAL` indicates that error codes less than
* this value is fatal error. When this error is returned, an
* endpoint should drop connection immediately.
*/
#define NGHTTP3_ERR_FATAL -900
/**
* @macro
*
* :macro:`NGHTTP3_ERR_NOMEM` indicates out of memory.
*/
#define NGHTTP3_ERR_NOMEM -901
/**
* @macro
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
* table capacity.
*/
NGHTTP3_EXTERN int
nghttp3_qpack_decoder_set_max_dtable_capacity(nghttp3_qpack_decoder *decoder,
size_t max_dtable_capacity);
/**
* @function
*
* `nghttp3_qpack_decoder_set_max_concurrent_streams` tells |decoder|
* the maximum number of concurrent streams that a remote endpoint can
* open, including both bidirectional and unidirectional streams which
* potentially receive QPACK encoded HEADERS frame. This value is
* used as a hint to limit the length of decoder stream.
*/
NGHTTP3_EXTERN void
nghttp3_qpack_decoder_set_max_concurrent_streams(nghttp3_qpack_decoder *decoder,
size_t max_concurrent_streams);
/**
* @function
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
* server uses this field.
*
* .. version-added:: 1.11.0
*/
const nghttp3_vec *origin_list;
/* The following fields have been added since
NGHTTP3_SETTINGS_V3. */
/**
* :member:`glitch_ratelim_burst` is the maximum number of tokens
* available to "glitch" rate limiter. "glitch" is a suspicious
* activity from a remote endpoint. If detected, certain amount of
* tokens are consumed. If no tokens are available to consume, the
* connection is closed. The rate of token generation is specified
* by :member:`glitch_ratelim_rate`. This feature is enabled only
* when `nghttp3_conn_read_stream2` is used.
*
* .. version-added:: 1.12.0
*/
uint64_t glitch_ratelim_burst;
/**
* :member:`glitch_ratelim_rate` is the number of tokens generated
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
* Datagrams (see :rfc:`9297`).
*/
uint8_t h3_datagram;
} nghttp3_proto_settings;
/**
* @functypedef
*
* :type:`nghttp3_acked_stream_data` is a callback function which is
* invoked when data sent on stream denoted by |stream_id| supplied
* from application is acknowledged by remote endpoint. The number of
* bytes acknowledged is given in |datalen|.
*
* The implementation of this callback must return 0 if it succeeds.
* Returning :macro:`NGHTTP3_ERR_CALLBACK_FAILURE` will return to the
* caller immediately. Any values other than 0 is treated as
* :macro:`NGHTTP3_ERR_CALLBACK_FAILURE`.
*/
typedef int (*nghttp3_acked_stream_data)(nghttp3_conn *conn, int64_t stream_id,
uint64_t datalen, void *conn_user_data,
void *stream_user_data);
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
*/
typedef int (*nghttp3_reset_stream)(nghttp3_conn *conn, int64_t stream_id,
uint64_t app_error_code,
void *conn_user_data,
void *stream_user_data);
/**
* @functypedef
*
* :type:`nghttp3_shutdown` is a callback function which is invoked
* when a shutdown is initiated by the remote endpoint. For client,
* |id| contains a stream ID of a client initiated stream, for server,
* it contains a push ID. All client streams with stream ID, or pushes
* with push ID equal to, or larger than |ID| are guaranteed to not be
* processed by the remote endpoint. Note that libnghttp3 does not
* implement Server Push.
*
* Parameter |id| for client can contain a special value
* :macro:`NGHTTP3_SHUTDOWN_NOTICE_STREAM_ID`, and for server it can
* contain special value
* :macro:`NGHTTP3_SHUTDOWN_NOTICE_PUSH_ID`. These values signal
* request for graceful shutdown of the connection, triggered by
* remote endpoint's invocation of
* `nghttp3_conn_submit_shutdown_notice`.
*
* It is possible that this callback is invoked multiple times on a
* single connection, however the |id| can only stay the same or
* decrease, never increase.
*
* The implementation of this callback must return 0 if it succeeds.
* Returning :macro:`NGHTTP3_ERR_CALLBACK_FAILURE` will return to the
* caller immediately. Any values other than 0 is treated as
* :macro:`NGHTTP3_ERR_CALLBACK_FAILURE`.
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
/**
* @struct
*
* :type:`nghttp3_callbacks` holds a set of callback functions.
*/
typedef struct nghttp3_callbacks {
/**
* :member:`acked_stream_data` is a callback function which is
* invoked when data sent on a particular stream have been
* acknowledged by a remote endpoint.
*/
nghttp3_acked_stream_data acked_stream_data;
/**
* :member:`stream_close` is a callback function which is invoked
* when a particular stream has closed.
*
* .. seealso::
* :member:`stream_close2`
*/
nghttp3_stream_close stream_close;
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
*/
nghttp3_end_stream end_stream;
/**
* :member:`reset_stream` is a callback function which is invoked
* when the library asks application to reset stream (by sending
* RESET_STREAM).
*/
nghttp3_reset_stream reset_stream;
/**
* :member:`shutdown` is a callback function which is invoked when
* the remote endpoint has signalled initiation of connection
* shutdown.
*/
nghttp3_shutdown shutdown;
/**
* .. warning::
*
* .. version-deprecated:: 1.14.0
* Use :member:`recv_settings2` instead.
*
* :member:`recv_settings` is a callback function which is invoked
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
* an ORIGIN frame has been completely processed.
*
* .. version-added:: 1.11.0
*/
nghttp3_end_origin end_origin;
/**
* :member:`rand` is a callback function which is invoked when
* unpredictable data are needed. Although this field is optional
* due to the backward compatibility, it is recommended to specify
* this field to harden the runtime behavior against suspicious
* activities of a remote endpoint.
*
* .. version-added:: 1.11.0
*/
nghttp3_rand rand;
/* The following fields have been added since
NGHTTP3_CALLBACKS_V3. */
/**
* :member:`recv_settings2` is a callback function which is invoked
* when SETTINGS frame is received.
*
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
* Use `nghttp3_conn_read_stream2` instead.
*
* `nghttp3_conn_read_stream` reads data |src| of length |srclen| on
* stream identified by |stream_id|. It returns the number of bytes
* consumed. The "consumed" means that application can increase flow
* control credit (both stream and connection) of underlying QUIC
* connection by that amount. It does not include the amount of data
* carried by DATA frame which contains application data (excluding
* any control or QPACK unidirectional streams). See
* :type:`nghttp3_recv_data` to handle those bytes. If |fin| is
* nonzero, this is the last data from remote endpoint in this stream.
*
* This function returns the number of bytes consumed, or one of the
* following negative error codes:
*
* :macro:`NGHTTP3_ERR_NOMEM`
* Out of memory.
* :macro:`NGHTTP3_ERR_CALLBACK_FAILURE`
* User callback failed.
*
* It may return the other error codes. The negative error code means
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
* @function
*
* `nghttp3_conn_read_stream2` reads data |src| of length |srclen| on
* stream identified by |stream_id|. It returns the number of bytes
* consumed. The "consumed" means that application can increase flow
* control credit (both stream and connection) of underlying QUIC
* connection by that amount. It does not include the amount of data
* carried by DATA frame which contains application data (excluding
* any control or QPACK unidirectional streams). See
* :type:`nghttp3_recv_data` to handle those bytes. If |fin| is
* nonzero, this is the last data from remote endpoint in this stream.
* |ts| is the current timestamp, and must be non-decreasing. It
* should be obtained from the clock that is steadily increasing.
*
* This function returns the number of bytes consumed, or one of the
* following negative error codes:
*
* :macro:`NGHTTP3_ERR_NOMEM`
* Out of memory.
* :macro:`NGHTTP3_ERR_CALLBACK_FAILURE`
* User callback failed.
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
* cumulative number of bidirectional streams that client can open.
*/
NGHTTP3_EXTERN void
nghttp3_conn_set_max_client_streams_bidi(nghttp3_conn *conn,
uint64_t max_streams);
/**
* @function
*
* `nghttp3_conn_set_max_concurrent_streams` tells |conn| the maximum
* number of concurrent streams that a remote endpoint can open,
* including both bidirectional and unidirectional streams which
* potentially receive QPACK encoded HEADERS frame. This value is
* used as a hint to limit the internal resource consumption.
*/
NGHTTP3_EXTERN void
nghttp3_conn_set_max_concurrent_streams(nghttp3_conn *conn,
size_t max_concurrent_streams);
/**
* @functypedef
vendor/nghttp3-1.18.0/lib/includes/nghttp3/nghttp3.h view on Meta::CPAN
* Out of memory.
*/
NGHTTP3_EXTERN int nghttp3_conn_submit_trailers(nghttp3_conn *conn,
int64_t stream_id,
const nghttp3_nv *nva,
size_t nvlen);
/**
* @function
*
* `nghttp3_conn_submit_shutdown_notice` notifies the other endpoint
* to stop creating new stream. After a couple of RTTs later, call
* `nghttp3_conn_shutdown` to start graceful shutdown.
*
* This function returns 0 if it succeeds, or one of the following
* negative error codes:
*
* :macro:`NGHTTP3_ERR_NOMEM`
* Out of memory.
*/
NGHTTP3_EXTERN int nghttp3_conn_submit_shutdown_notice(nghttp3_conn *conn);
/**
* @function
*
* `nghttp3_conn_shutdown` starts graceful shutdown. It should be
* called after `nghttp3_conn_submit_shutdown_notice` and a couple of
* RTTs. After calling this function, the local endpoint starts
* rejecting new incoming streams. The existing streams are processed
* normally. See also `nghttp3_conn_is_drained`.
*
* This function returns 0 if it succeeds, or one of the following
* negative error codes:
*
* :macro:`NGHTTP3_ERR_NOMEM`
* Out of memory.
*/
NGHTTP3_EXTERN int nghttp3_conn_shutdown(nghttp3_conn *conn);
vendor/nghttp3-1.18.0/lib/nghttp3_conn.h view on Meta::CPAN
uint16_t flags;
struct {
/* origin_list contains the shallow copy of
nghttp3_settings.origin_list passed from an application if this
object is initialized as server. settings.origin_list may
point to the address of this field. */
nghttp3_vec origin_list;
nghttp3_settings settings;
struct {
/* max_pushes is the number of push IDs that local endpoint can
issue. This field is used by server only and used just for
validation */
uint64_t max_pushes;
} uni;
} local;
struct {
struct {
nghttp3_idtr idtr;
/* max_client_streams is the cumulative number of client
initiated bidirectional stream ID the remote endpoint can
issue. This field is used on server side only. */
uint64_t max_client_streams;
/* num_streams is the number of client initiated bidirectional
streams that are currently open. This field is for server
use only. */
size_t num_streams;
} bidi;
nghttp3_proto_settings settings;
} remote;
vendor/nghttp3-1.18.0/lib/nghttp3_qpack.h view on Meta::CPAN
/* opcode is an encoder stream opcode being processed. */
nghttp3_qpack_encoder_stream_opcode opcode;
/* rstate is a set of intermediate state which are used to process
encoder stream. */
nghttp3_qpack_read_state rstate;
/* dbuf is decoder stream. */
nghttp3_buf dbuf;
/* written_icnt is Insert Count written to decoder stream so far. */
uint64_t written_icnt;
/* max_concurrent_streams is the number of concurrent streams that a
remote endpoint can open, including both bidirectional and
unidirectional streams which potentially receives QPACK encoded
HEADER frame. */
size_t max_concurrent_streams;
/* uninterrupted_encoderlen is the number of bytes read from encoder
stream without completing a single field section. */
size_t uninterrupted_encoderlen;
};
/*
* nghttp3_qpack_decoder_init initializes |decoder|.
vendor/nghttp3-1.18.0/lib/nghttp3_stream.h view on Meta::CPAN
#define NGHTTP3_STREAM_FLAG_FC_BLOCKED 0x0002U
/* NGHTTP3_STREAM_FLAG_READ_DATA_BLOCKED indicates that application is
temporarily unable to provide data. */
#define NGHTTP3_STREAM_FLAG_READ_DATA_BLOCKED 0x0004U
/* NGHTTP3_STREAM_FLAG_WRITE_END_STREAM indicates that application
finished to feed outgoing data. */
#define NGHTTP3_STREAM_FLAG_WRITE_END_STREAM 0x0008U
/* NGHTTP3_STREAM_FLAG_QPACK_DECODE_BLOCKED indicates that stream is
blocked due to QPACK decoding. */
#define NGHTTP3_STREAM_FLAG_QPACK_DECODE_BLOCKED 0x0010U
/* NGHTTP3_STREAM_FLAG_READ_EOF indicates that remote endpoint sent
fin. */
#define NGHTTP3_STREAM_FLAG_READ_EOF 0x0020U
/* NGHTTP3_STREAM_FLAG_SHUT_WR indicates that any further write
operation to a stream is prohibited. */
#define NGHTTP3_STREAM_FLAG_SHUT_WR 0x0100U
/* NGHTTP3_STREAM_FLAG_SHUT_RD indicates that a read-side stream is
closed abruptly and any incoming and pending stream data is just
discarded for a stream. */
#define NGHTTP3_STREAM_FLAG_SHUT_RD 0x0200U
/* NGHTTP3_STREAM_FLAG_SERVER_PRIORITY_SET indicates that server
vendor/nghttp3-1.18.0/lib/nghttp3_stream.h view on Meta::CPAN
NGHTTP3_HTTP_EVENT_HEADERS_BEGIN,
NGHTTP3_HTTP_EVENT_HEADERS_END,
NGHTTP3_HTTP_EVENT_MSG_END,
} nghttp3_stream_http_event;
typedef struct nghttp3_stream nghttp3_stream;
/*
* nghttp3_stream_acked_data is a callback function which is invoked
* when data sent on stream denoted by |stream_id| supplied from
* application is acknowledged by remote endpoint. The number of
* bytes acknowledged is given in |datalen|.
*
* The implementation of this callback must return 0 if it succeeds.
* Returning NGHTTP3_ERR_CALLBACK_FAILURE will return to the caller
* immediately. Any values other than 0 is treated as
* NGHTTP3_ERR_CALLBACK_FAILURE.
*/
typedef int (*nghttp3_stream_acked_data)(nghttp3_stream *stream,
int64_t stream_id, uint64_t datalen,
void *user_data);
vendor/nghttp3-1.18.0/lib/nghttp3_stream.h view on Meta::CPAN
nghttp3_qpack_stream_context qpack_sctx;
/* conn is a reference to underlying connection. It could be NULL
if stream is not a request stream. */
nghttp3_conn *conn;
void *user_data;
/* unsent_bytes is the number of bytes in outq not written yet */
uint64_t unsent_bytes;
/* outq_idx is an index into outq where next write is made. */
size_t outq_idx;
/* ack_base is the number of bytes acknowledged by a remote
endpoint where the first element in outq is positioned at. */
uint64_t ack_base;
/* ack_offset is the number of bytes acknowledged by a remote
endpoint so far. */
uint64_t ack_offset;
uint64_t unscheduled_nwrite;
nghttp3_stream_type type;
nghttp3_stream_read_state rstate;
struct {
uint64_t offset;
} tx;
struct {