VLC  3.0.0-git
Collaboration diagram for HTTP/1.x:


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 *)
struct vlc_http_streamvlc_h1_request (void *ctx, const char *hostname, unsigned port, bool proxy, const struct vlc_http_msg *req, bool idempotent, struct vlc_http_conn **restrict connp)
 Sends an HTTP/1.x request through a new connection. More...

Detailed Description

Function Documentation

◆ vlc_chunked_open()

struct vlc_http_stream* vlc_chunked_open ( struct vlc_http_stream ,
struct vlc_tls  

◆ vlc_h1_conn_create()

struct vlc_http_conn* vlc_h1_conn_create ( void *  ctx,
struct vlc_tls ,
bool  proxy 

◆ 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,
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.

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.
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)
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
an HTTP stream on success, NULL on error
*connp is undefined on error.

References vlc_h1_conn::conn, p, vlc_h1_conn::stream, 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_conn_release(), and vlc_http_request().