VLC 4.0.0-dev
|
HTTP request/response streams. More...
Data Structures | |
struct | vlc_http_stream_cbs |
HTTP stream callbacks. More... | |
struct | vlc_http_stream |
HTTP stream. More... | |
Functions | |
void | vlc_http_msg_attach (struct vlc_http_msg *m, struct vlc_http_stream *s) |
struct vlc_http_msg * | vlc_http_msg_get_initial (struct vlc_http_stream *s) VLC_USED |
static struct vlc_http_msg * | vlc_http_stream_read_headers (struct vlc_http_stream *s) |
Reads one message header. | |
static ssize_t | vlc_http_stream_write (struct vlc_http_stream *s, const void *base, size_t length, bool eos) |
Write message payload data. | |
static block_t * | vlc_http_stream_read (struct vlc_http_stream *s) |
Reads message payload data. | |
static void | vlc_http_stream_close (struct vlc_http_stream *s, bool abort) |
Closes an HTTP stream. | |
Variables | |
void *const | vlc_http_error |
Error pointer value. | |
HTTP request/response streams.
A stream is initiated by a client-side request header. It includes a final response header, possibly preceded by one or more continuation response headers. After the response header, a stream usually carries a response payload.
A stream may also carry a request payload (this is not supported so far).
The HTTP stream constitutes the interface between an HTTP connection and the higher-level HTTP messages layer.
void vlc_http_msg_attach | ( | struct vlc_http_msg * | m, |
struct vlc_http_stream * | s | ||
) |
References vlc_http_msg::payload.
Referenced by vlc_h1_stream_wait(), and vlc_h2_stream_wait().
struct vlc_http_msg * vlc_http_msg_get_initial | ( | struct vlc_http_stream * | s | ) |
References vlc_http_stream_close(), and vlc_http_stream_read_headers().
Referenced by vlc_http_mgr_reuse(), vlc_http_request(), and vlc_http_tunnel_open().
|
inlinestatic |
Closes an HTTP stream.
Releases all resources associated or held by an HTTP stream. Any unread header or data is discarded.
s | HTTP stream to close |
abort | whether to close the connection and prevent re-use |
References vlc_http_stream::cbs, and vlc_http_stream_cbs::close.
Referenced by vlc_chunked_close(), vlc_http_msg_destroy(), and vlc_http_msg_get_initial().
|
inlinestatic |
Reads message payload data.
Reads the next block of data from the message payload of an HTTP stream.
s | HTTP stream to read from |
NULL | The end of the stream was reached. |
vlc_http_error | The stream encountered a fatal error. |
References vlc_http_stream::cbs, and vlc_http_stream_cbs::read.
Referenced by vlc_http_msg_read().
|
inlinestatic |
Reads one message header.
Reads the next message header of an HTTP stream from the network. There is always exactly one request header per stream. There is usually one response header per stream, except for continuation (1xx) headers.
s | HTTP stream to read from |
References vlc_http_stream::cbs, and vlc_http_stream_cbs::read_headers.
Referenced by vlc_http_msg_get_initial(), and vlc_http_msg_iterate().
|
inlinestatic |
Write message payload data.
Writes data as message payload of an HTTP stream.
s | HTTP stream to write to |
base | start address of data to write |
length | length in bytes of data to write |
eos | whether this is the last write on the stream |
len | success |
-1 | error |
References vlc_http_stream::cbs, and vlc_http_stream_cbs::write.
Referenced by vlc_http_msg_write().
|
extern |
Error pointer value.
This is an error value for some HTTP functions that can return NULL in non-error circumstances. Another return value is necessary to express error/failure, which this is. This compares different to NULL and to any valid pointer.
Referenced by vlc_chunked_fatal(), vlc_chunked_read(), vlc_h1_stream_read(), vlc_h2_stream_read(), vlc_http_file_read(), and vlc_http_live_read().