VLC 4.0.0-dev
|
Data Structures | |
struct | vlc_h2_conn |
HTTP/2 connection. More... | |
struct | vlc_h2_stream |
HTTP/2 stream. More... | |
Macros | |
#define | CO(c) ((c)->opaque) |
#define | SO(s) CO((s)->conn) |
Functions | |
static void | vlc_h2_conn_destroy (struct vlc_h2_conn *conn) |
static int | vlc_h2_conn_queue (struct vlc_h2_conn *conn, struct vlc_h2_frame *f) |
static int | vlc_h2_conn_queue_prio (struct vlc_h2_conn *conn, struct vlc_h2_frame *f) |
static void * | vlc_h2_stream_lookup (void *ctx, uint_fast32_t id) |
Looks a stream up by ID. More... | |
static int | vlc_h2_stream_error (void *ctx, uint_fast32_t id, uint_fast32_t code) |
Reports a local stream error. More... | |
static int | vlc_h2_stream_fatal (struct vlc_h2_stream *s, uint_fast32_t code) |
static void | vlc_h2_stream_headers (void *ctx, unsigned count, const char *const hdrs[][2]) |
Reports received stream headers. More... | |
static int | vlc_h2_stream_data (void *ctx, struct vlc_h2_frame *f) |
Reports received stream data. More... | |
static void | vlc_h2_stream_end (void *ctx) |
Reports received end of stream. More... | |
static int | vlc_h2_stream_reset (void *ctx, uint_fast32_t code) |
Reports remote stream error. More... | |
static void | vlc_h2_stream_window_update (void *ctx, uint_fast32_t credit) |
Reports remote window size increments. More... | |
static void | vlc_h2_stream_wake_up (void *data) |
static void | vlc_h2_stream_lock (struct vlc_h2_stream *s) |
static int | vlc_h2_stream_unlock (struct vlc_h2_stream *s) |
static struct vlc_http_msg * | vlc_h2_stream_wait (struct vlc_http_stream *stream) |
static ssize_t | vlc_h2_stream_write (struct vlc_http_stream *stream, const void *base, size_t length, bool eos) |
static block_t * | vlc_h2_stream_read (struct vlc_http_stream *stream) |
Receives stream data. More... | |
static void | vlc_h2_stream_close (struct vlc_http_stream *stream, bool aborted) |
Terminates a stream. More... | |
static struct vlc_http_stream * | vlc_h2_stream_open (struct vlc_http_conn *c, const struct vlc_http_msg *msg, bool has_data) |
Creates a stream. More... | |
static void | vlc_h2_initial_window_update (struct vlc_h2_conn *conn, uint_fast32_t value) |
static void | vlc_h2_setting (void *ctx, uint_fast16_t id, uint_fast32_t value) |
Reports an HTTP/2 peer connection setting. More... | |
static int | vlc_h2_settings_done (void *ctx) |
Reports end of HTTP/2 peer settings. More... | |
static int | vlc_h2_ping (void *ctx, uint_fast64_t opaque) |
Reports a ping received from HTTP/2 peer. More... | |
static void | vlc_h2_error (void *ctx, uint_fast32_t code) |
Reports a local HTTP/2 connection failure. More... | |
static int | vlc_h2_reset (void *ctx, uint_fast32_t last_seq, uint_fast32_t code) |
Reports a remote HTTP/2 connection error. More... | |
static void | vlc_h2_window_status (void *ctx, uint32_t *restrict rcwd) |
static void | vlc_h2_window_update (void *ctx, uint_fast32_t credit) |
static ssize_t | vlc_https_recv (vlc_tls_t *tls, void *buf, size_t len) |
Receives TLS data. More... | |
static struct vlc_h2_frame * | vlc_h2_frame_recv (struct vlc_tls *tls) |
Receives an HTTP/2 frame through TLS. More... | |
static void | cleanup_parser (void *data) |
static void * | vlc_h2_recv_thread (void *data) |
HTTP/2 receive thread. More... | |
static void | vlc_h2_conn_release (struct vlc_http_conn *c) |
struct vlc_http_conn * | vlc_h2_conn_create (void *ctx, struct vlc_tls *tls) |
Variables | |
static const struct vlc_http_stream_cbs | vlc_h2_stream_callbacks |
static const struct vlc_h2_parser_cbs | vlc_h2_parser_callbacks |
HTTP/2 frames parser callbacks table. More... | |
static const struct vlc_http_conn_cbs | vlc_h2_conn_callbacks |
#define CO | ( | c | ) | ((c)->opaque) |
#define SO | ( | s | ) | CO((s)->conn) |
|
static |
References vlc_h2_frame::data, and vlc_h2_parse_destroy().
Referenced by vlc_h2_recv_thread().
|
static |
References vlc_h2_conn::conn, vlc_h2_conn::out, vlc_h2_conn::streams, vlc_h2_conn::thread, vlc_http_conn::tls, vlc_cancel(), vlc_h2_error(), VLC_H2_NO_ERROR, vlc_h2_output_destroy(), vlc_join(), vlc_tls_Close(), and vlc_tls_Shutdown().
Referenced by vlc_h2_conn_release(), and vlc_h2_stream_close().
|
static |
|
static |
References vlc_h2_conn::opaque, vlc_h2_conn::out, vlc_h2_frame_dump(), and vlc_h2_output_send_prio().
Referenced by vlc_h2_ping(), and vlc_h2_window_status().
|
static |
References vlc_h2_conn::conn, container_of, vlc_h2_conn_destroy(), vlc_mutex_lock(), and vlc_mutex_unlock().
|
static |
Reports a local HTTP/2 connection failure.
References CO, vlc_h2_conn::conn, vlc_h2_conn_queue(), vlc_h2_frame_goaway(), VLC_H2_NO_ERROR, vlc_h2_strerror(), vlc_http_dbg(), and vlc_http_err().
Referenced by vlc_h2_conn_destroy().
|
static |
Receives an HTTP/2 frame through TLS.
This function allocates memory for and receives a whole HTTP/2 frame from a TLS session.
The caller must "own" the read side of the TLS session.
References vlc_h2_frame::data, vlc_h2_frame::next, unlikely, vlc_cleanup_pop, vlc_cleanup_push, and vlc_https_recv().
Referenced by vlc_h2_recv_thread().
|
static |
References vlc_h2_conn::init_send_cwnd, vlc_h2_stream::older, vlc_h2_conn::send_cwnd, vlc_h2_conn::send_wait, vlc_h2_conn::streams, and vlc_cond_broadcast().
Referenced by vlc_h2_setting().
|
static |
Reports a ping received from HTTP/2 peer.
References vlc_h2_conn::conn, vlc_h2_conn::opaque, vlc_h2_conn_queue_prio(), and vlc_h2_frame_pong().
|
static |
HTTP/2 receive thread.
References cleanup_parser(), CO, vlc_h2_conn::conn, vlc_h2_conn::lock, vlc_h2_stream::older, vlc_h2_parser::parser, vlc_h2_conn::streams, vlc_http_conn::tls, unlikely, vlc_cleanup_pop, vlc_cleanup_push, VLC_H2_CANCEL, vlc_h2_frame_dump(), vlc_h2_frame_recv(), vlc_h2_parse(), vlc_h2_parse_destroy(), vlc_h2_parse_init(), vlc_h2_parser_callbacks, vlc_h2_stream_reset(), vlc_http_dbg(), vlc_mutex_lock(), vlc_mutex_unlock(), vlc_restorecancel(), vlc_savecancel(), and vlc_thread_set_name().
Referenced by vlc_h2_conn_create().
|
static |
Reports a remote HTTP/2 connection error.
References CO, vlc_h2_conn::conn, vlc_h2_conn_queue(), vlc_h2_frame_goaway(), VLC_H2_NO_ERROR, VLC_H2_REFUSED_STREAM, vlc_h2_stream_reset(), vlc_h2_strerror(), vlc_http_dbg(), and vlc_http_err().
|
static |
Reports an HTTP/2 peer connection setting.
References CO, vlc_h2_conn::conn, vlc_h2_initial_window_update(), VLC_H2_MAX_MAX_FRAME, VLC_H2_MIN_MAX_FRAME, VLC_H2_SETTING_INITIAL_WINDOW_SIZE, VLC_H2_SETTING_MAX_FRAME_SIZE, vlc_h2_setting_name(), and vlc_http_dbg().
|
static |
Reports end of HTTP/2 peer settings.
References vlc_h2_conn::conn, vlc_h2_conn_queue(), and vlc_h2_frame_settings_ack().
|
static |
Terminates a stream.
Sends an HTTP/2 stream reset, removes the stream from the HTTP/2 connection and deletes any stream resource.
References vlc_h2_conn::conn, vlc_h2_stream::conn, container_of, vlc_h2_stream::id, vlc_h2_stream::newer, vlc_h2_stream::older, vlc_h2_stream::recv_end, vlc_h2_stream::recv_hdr, vlc_h2_stream::recv_head, vlc_h2_stream::stream, VLC_H2_CANCEL, vlc_h2_conn_destroy(), VLC_H2_NO_ERROR, vlc_h2_stream_error(), vlc_http_msg_destroy(), vlc_mutex_lock(), and vlc_mutex_unlock().
|
static |
Reports received stream data.
References vlc_h2_stream::conn, vlc_h2_stream::id, vlc_h2_frame::next, vlc_h2_stream::recv_cwnd, vlc_h2_stream::recv_end, vlc_h2_stream::recv_tailp, vlc_h2_stream::recv_wait, vlc_cond_signal(), VLC_H2_FLOW_CONTROL_ERROR, vlc_h2_frame_data_get, VLC_H2_STREAM_CLOSED, vlc_h2_stream_error(), and vlc_h2_stream_fatal().
|
static |
Reports received end of stream.
References vlc_h2_stream::id, vlc_h2_stream::recv_end, vlc_h2_stream::recv_wait, SO, vlc_cond_broadcast(), and vlc_http_dbg().
|
static |
Reports a local stream error.
References CO, vlc_h2_conn::conn, vlc_h2_conn_queue(), vlc_h2_frame_rst_stream(), VLC_H2_NO_ERROR, vlc_h2_strerror(), vlc_http_dbg(), and vlc_http_err().
Referenced by vlc_h2_stream_close(), vlc_h2_stream_data(), vlc_h2_stream_fatal(), and vlc_h2_stream_read().
|
static |
References vlc_h2_stream::conn, vlc_h2_stream::id, vlc_h2_stream::recv_end, vlc_h2_stream::recv_err, and vlc_h2_stream_error().
Referenced by vlc_h2_stream_data(), and vlc_h2_stream_headers().
|
static |
Reports received stream headers.
References count, vlc_h2_stream::id, vlc_h2_stream::recv_hdr, vlc_h2_stream::recv_wait, SO, unlikely, vlc_cond_signal(), VLC_H2_PROTOCOL_ERROR, vlc_h2_stream_fatal(), vlc_http_dbg(), vlc_http_msg_destroy(), and vlc_http_msg_h2_headers().
|
static |
References vlc_h2_stream::conn, vlc_h2_stream::interrupted, vlc_h2_conn::lock, vlc_h2_stream_wake_up(), vlc_interrupt_register(), and vlc_mutex_lock().
Referenced by vlc_h2_stream_read(), vlc_h2_stream_wait(), and vlc_h2_stream_write().
|
static |
Looks a stream up by ID.
References vlc_h2_conn::conn.
|
static |
Creates a stream.
Allocates a locally-initiated stream identifier on an HTTP/2 connection and queue stream headers for sending.
Headers are sent asynchronously. To obtain the result and answer from the other end, use vlc_http_stream_recv_headers().
msg | HTTP message headers (including response status or request) |
References vlc_http_stream::cbs, CO, vlc_h2_conn::conn, vlc_h2_stream::conn, container_of, vlc_h2_stream::id, vlc_h2_conn::init_send_cwnd, vlc_h2_conn::lock, vlc_h2_stream::newer, vlc_h2_conn::next_id, vlc_h2_stream::older, vlc_h2_stream::recv_cwnd, vlc_h2_stream::recv_end, vlc_h2_stream::recv_err, vlc_h2_stream::recv_hdr, vlc_h2_stream::recv_head, vlc_h2_stream::recv_tailp, vlc_h2_stream::recv_wait, vlc_h2_conn::released, vlc_h2_stream::send_cwnd, vlc_h2_stream::send_wait, vlc_h2_stream::stream, vlc_h2_conn::streams, unlikely, vlc_cond_init(), vlc_h2_conn_queue(), VLC_H2_INIT_WINDOW, vlc_h2_stream_callbacks, vlc_http_dbg(), vlc_http_msg_h2_frame(), vlc_mutex_lock(), and vlc_mutex_unlock().
|
static |
Receives stream data.
Dequeues pending incoming data for an HTTP/2 stream. If there is currently no data block, wait for one.
References block_heap_Alloc, vlc_h2_conn::conn, vlc_h2_stream::conn, container_of, vlc_frame_t::i_buffer, vlc_h2_stream::id, vlc_h2_stream::interrupted, vlc_h2_conn::lock, vlc_h2_frame::next, vlc_frame_t::p_buffer, vlc_h2_stream::recv_cwnd, vlc_h2_stream::recv_end, vlc_h2_stream::recv_err, vlc_h2_stream::recv_head, vlc_h2_stream::recv_tailp, vlc_h2_stream::recv_wait, vlc_h2_stream::stream, unlikely, vlc_cond_wait(), vlc_h2_conn_queue(), vlc_h2_frame_data_get, vlc_h2_frame_size(), vlc_h2_frame_window_update(), VLC_H2_INIT_WINDOW, VLC_H2_INTERNAL_ERROR, vlc_h2_stream_error(), vlc_h2_stream_lock(), vlc_h2_stream_unlock(), and vlc_http_error.
|
static |
Reports remote stream error.
References vlc_h2_stream::id, vlc_h2_stream::recv_end, vlc_h2_stream::recv_err, vlc_h2_stream::recv_wait, SO, vlc_cond_broadcast(), vlc_h2_strerror(), and vlc_http_err().
Referenced by vlc_h2_recv_thread(), and vlc_h2_reset().
|
static |
References vlc_h2_stream::conn, vlc_h2_conn::lock, vlc_interrupt_unregister(), and vlc_mutex_unlock().
Referenced by vlc_h2_stream_read(), vlc_h2_stream_wait(), and vlc_h2_stream_write().
|
static |
References vlc_h2_conn::conn, vlc_h2_stream::conn, container_of, vlc_h2_stream::interrupted, vlc_h2_conn::lock, vlc_h2_stream::recv_end, vlc_h2_stream::recv_hdr, vlc_h2_stream::recv_wait, vlc_h2_stream::stream, vlc_cond_wait(), vlc_h2_stream_lock(), vlc_h2_stream_unlock(), and vlc_http_msg_attach().
|
static |
References vlc_h2_conn::conn, vlc_h2_stream::conn, vlc_h2_stream::interrupted, vlc_h2_stream::recv_wait, vlc_cond_signal(), vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by vlc_h2_stream_lock().
|
static |
Reports remote window size increments.
References vlc_h2_stream::id, vlc_h2_stream::send_cwnd, vlc_h2_stream::send_wait, SO, vlc_cond_broadcast(), and vlc_http_dbg().
|
static |
References vlc_h2_conn::conn, vlc_h2_stream::conn, container_of, vlc_h2_stream::id, vlc_h2_stream::interrupted, likely, vlc_h2_conn::send_cwnd, vlc_h2_stream::send_cwnd, vlc_h2_stream::send_wait, vlc_h2_stream::stream, unlikely, vlc_cond_wait(), vlc_h2_conn_queue(), vlc_h2_frame_data(), vlc_h2_stream_lock(), and vlc_h2_stream_unlock().
|
static |
References vlc_h2_conn::conn, vlc_h2_conn_queue_prio(), and vlc_h2_frame_window_update().
|
static |
References CO, vlc_h2_conn::conn, vlc_cond_broadcast(), and vlc_http_dbg().
|
static |
Receives TLS data.
Receives bytes from the peer through a TLS session.
References count, pollfd::events, pollfd::fd, vlc_tls::ops, poll(), POLLIN, vlc_tls_operations::readv, vlc_restorecancel(), vlc_savecancel(), and vlc_tls_GetPollFD().
Referenced by vlc_h2_frame_recv().
|
static |
Referenced by vlc_h2_conn_create().
|
static |
HTTP/2 frames parser callbacks table.
Referenced by vlc_h2_recv_thread().
|
static |
Referenced by vlc_h2_stream_open().