Packages
hackney
3.0.1
4.7.2
4.7.1
4.7.0
4.6.1
4.6.0
4.5.2
4.5.1
4.5.0
4.4.5
4.4.3
4.4.2
4.4.1
4.4.0
4.3.0
4.2.3
4.2.2
4.2.1
4.2.0
4.1.0
4.0.3
4.0.2
4.0.1
4.0.0
3.2.1
3.2.0
3.1.2
3.1.1
3.1.0
3.0.3
3.0.2
3.0.1
3.0.0
retired
2.0.1
2.0.0
2.0.0-beta.1
1.25.0
1.24.1
1.24.0
1.23.0
1.22.0
1.21.0
1.20.1
1.20.0
1.19.1
1.19.0
1.18.2
1.18.1
1.18.0
1.17.4
1.17.3
1.17.2
1.17.1
1.17.0
1.16.0
1.15.2
1.15.1
1.15.0
1.14.3
1.14.2
1.14.0
1.13.0
1.12.1
1.12.0
1.11.0
1.10.1
1.10.0
1.9.0
1.8.6
1.8.5
1.8.4
1.8.3
1.8.2
1.8.0
1.7.1
1.7.0
1.6.6
retired
1.6.5
1.6.4
retired
1.6.3
1.6.2
1.6.1
1.6.0
1.5.7
1.5.6
1.5.5
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.10
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.2
1.3.1
1.3.0
1.2.0
1.1.0
1.0.6
1.0.5
1.0.2
1.0.1
0.15.2
0.15.0
0.14.3
0.14.2
0.14.1
0.14.0
0.13.1
Simple HTTP client with HTTP/1.1, HTTP/2, and HTTP/3 support
Security advisory:
This version has known vulnerabilities.
View advisories
Current section
Files
Jump to
Current section
Files
c_src/lsquic/src/liblsquic/lsquic_hcsi_reader.h
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_hcsi_reader.h -- HTTP Control Stream Incoming (HCSI) reader
*/
#ifndef LSQUIC_HCSI_READER_H
#define LSQUIC_HCSI_READER_H 1
struct lsquic_conn;
struct hcsi_callbacks
{
void (*on_cancel_push)(void *ctx, uint64_t push_id);
void (*on_max_push_id)(void *ctx, uint64_t push_id);
/* Gets called at the *end* of the SETTING frame */
void (*on_settings_frame)(void *ctx);
void (*on_setting)(void *ctx, uint64_t setting_id, uint64_t value);
void (*on_goaway)(void *ctx, uint64_t stream_id);
void (*on_frame_error)(void *ctx, unsigned code, uint64_t frame_type);
void (*on_priority_update)(void *ctx, enum hq_frame_type, uint64_t id,
const char *, size_t);
};
struct hcsi_reader
{
enum {
HR_READ_FRAME_BEGIN,
HR_READ_FRAME_CONTINUE,
HR_SKIPPING,
HR_READ_SETTING_BEGIN,
HR_READ_SETTING_CONTINUE,
HR_READ_PRIORITY_UPDATE,
HR_READ_VARINT,
HR_READ_VARINT_CONTINUE,
HR_ERROR,
} hr_state:8;
enum {
HR_FLAG_RCVD_SETTING = 1,
} hr_flag:8;
unsigned hr_nread; /* Used for PRIORITY_UPDATE and SETTINGS frames */
struct lsquic_conn *hr_conn;
uint64_t hr_frame_type;
uint64_t hr_frame_length;
union
{
struct varint_read_state vint_state;
struct varint_read2_state vint2_state;
struct {
/* We just need the offset to rest of prio_state to read Priority
* Field Value.
*/
struct varint_read_state UNUSED;
char buf[
sizeof(struct varint_read2_state)
- sizeof(struct varint_read_state)];
} prio_state;
} hr_u;
const struct hcsi_callbacks *hr_cb;
void *hr_ctx;
};
void
lsquic_hcsi_reader_init (struct hcsi_reader *, struct lsquic_conn *,
const struct hcsi_callbacks *, void *cb_ctx);
int
lsquic_hcsi_reader_feed (struct hcsi_reader *, const void *buf, size_t bufsz);
#endif