Packages
hackney
3.0.2
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_hpi.h
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_hpi.h - HPI: (Extensible) HTTP Priority Iterator
*
* https://tools.ietf.org/html/draft-ietf-httpbis-priority-01
*
* Changing a stream's priority when the stream is in the iterator
* does not change the stream's position in the iterator.
*/
#ifndef LSQUIC_HPI
#define LSQUIC_HPI 1
#ifndef LSQUIC_TEST
#define LSQUIC_TEST 0
#endif
struct lsquic_conn_public;
/* We add 1 to the urgency when we place them on hpi_streams. Critical
* streams get the highest-priority slot zero.
*/
#define N_HPI_PRIORITIES (2 + LSQUIC_MAX_HTTP_URGENCY)
struct http_prio_iter
{
const char *hpi_name; /* Used for logging */
struct lsquic_conn_public *hpi_conn_pub;
enum {
HPI_MH_4K = 1 << 0,
HPI_MH_MALLOC = 1 << 1,
} hpi_flags;
unsigned hpi_set[2]; /* Bitmask */
unsigned hpi_counts[N_HPI_PRIORITIES]; /* For non-incr only */
unsigned hpi_heaped; /* Bitmask */
struct lsquic_streams_tailq hpi_streams[2][N_HPI_PRIORITIES];
struct min_heap hpi_min_heap;
/* We do this because http_prio_iter is used in a union with
* stream_prio_iter, which is over 4KB on the stack. Since we
* are already allocating this memory on the stack, we might as well
* use it.
*/
struct min_heap_elem hpi_min_heap_els[236];
};
void
lsquic_hpi_init (void *, struct lsquic_stream *first,
struct lsquic_stream *last, uintptr_t next_ptr_offset,
struct lsquic_conn_public *, const char *name,
int (*filter)(void *filter_ctx, struct lsquic_stream *),
void *filter_ctx);
struct lsquic_stream *
lsquic_hpi_first (void *);
struct lsquic_stream *
lsquic_hpi_next (void *);
void
lsquic_hpi_drop_non_high (void *);
void
lsquic_hpi_drop_high (void *);
void
lsquic_hpi_cleanup (void *);
#ifndef NDEBUG
#define LSQUIC_HPI_HEAP_TEST_STACK_OK (1 << 0)
#define LSQUIC_HPI_HEAP_TEST_4K_OK (1 << 1)
#if LSQUIC_TEST
void
lsquic_hpi_set_heap_test (int val);
#endif
#endif
#endif