VLC 4.0.0-dev
Loading...
Searching...
No Matches
Collaboration diagram for HTTP/1.x:

Functions

struct vlc_http_connvlc_h1_conn_create (void *ctx, struct vlc_tls *, bool proxy)
 
struct vlc_http_streamvlc_chunked_open (struct vlc_http_stream *, struct vlc_tls *)
 
ssize_t vlc_https_chunked_write (struct vlc_tls *, const void *base, size_t len, bool eos)
 
struct vlc_http_streamvlc_h1_request (void *ctx, const char *hostname, unsigned port, bool proxy, const struct vlc_http_msg *req, bool idempotent, bool has_data, struct vlc_http_conn **restrict connp)
 Sends an HTTP/1.x request through a new connection.
 

Detailed Description

Function Documentation

◆ vlc_chunked_open()

◆ vlc_h1_conn_create()

◆ vlc_h1_request()

struct vlc_http_stream * vlc_h1_request ( void *  ctx,
const char *  hostname,
unsigned  port,
bool  proxy,
const struct vlc_http_msg req,
bool  idempotent,
bool  has_data,
struct vlc_http_conn **restrict  connp 
)

Sends an HTTP/1.x request through a new connection.

This function resolves a the specified HTTP server hostname, establishes a connection to specified TCP port of the server, then sends an HTTP request. The connection is not protected with TLS.

All those operations are combined in a single function call in order to support TCP Fast Open. That can save one round-trip when establishing a new HTTP connection.

Note
In the case of TLS, TCP Fast Open would convey the TLS Client Hello message rather than the HTTP request header. The HTTP request header can however be sent with the TLS False Start. This is handled by the TLS stack and does not require a combined function call.
Parameters
ctxopaque context pointer for the HTTP connection
hostnameHTTP server or proxy hostname to connect to
portTCP port number to connect to
proxytrue of the hostname and port correspond to an HTTP proxy, or false if they correspond to an HTTP origin server
reqHTTP request message
idempotentwhether the HTTP request is idempotent (e.g. GET), or not (e.g. POST)
has_datawhether the HTTP request will have a request payload
connppointer to storage space for the established HTTP connection (or NULL if the connection is not to be reused) [OUT] can be NULL if the connection is not meant to be reused
Returns
an HTTP stream on success, NULL on error
Note
*connp is undefined on error.

References p, unlikely, vlc_getaddrinfo_i11e(), vlc_h1_conn_create(), vlc_http_conn_release(), vlc_http_dbg(), vlc_http_err(), vlc_http_stream_open(), vlc_strerror_c(), vlc_tls_SessionDelete(), and vlc_tls_SocketOpenAddrInfo().

Referenced by vlc_http_request().

◆ vlc_https_chunked_write()

ssize_t vlc_https_chunked_write ( struct vlc_tls tls,
const void *  base,
size_t  len,
bool  eos 
)

References vlc_tls_Write().

Referenced by vlc_h1_stream_write().