VLC 4.0.0-dev
Loading...
Searching...
No Matches
connmgr.h
Go to the documentation of this file.
1/*****************************************************************************
2 * connmgr.h: HTTP/TLS VLC connection manager declaration
3 *****************************************************************************
4 * Copyright © 2015 Rémi Denis-Courmont
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
20
21/**
22 * \defgroup http HTTP
23 * \ingroup net
24 * Hyper-Text Transfer Protocol
25 * \defgroup http_connmgr Connection manager
26 * HTTP connection management
27 * \ingroup http
28 * @{
29 * \file connmgr.h
30 */
31
32struct vlc_http_mgr;
33struct vlc_http_msg;
35
36/**
37 * Sends an HTTP request
38 *
39 * Sends an HTTP request, by either reusing an existing HTTP connection or
40 * establishing a new one. If successful, the initial HTTP response header is
41 * returned.
42 *
43 * @param mgr HTTP connection manager
44 * @param https whether to use HTTPS (true) or unencrypted HTTP (false)
45 * @param host name of authoritative HTTP server to send the request to
46 * @param port TCP server port number, or 0 for the default port number
47 * @param req HTTP request header to send
48 * @param idempotent whether the request is idempotent
49 * @param payload whether the request will carry a payload
50 *
51 * @return The initial HTTP response header, or NULL in case of failure.
52 */
53struct vlc_http_msg *vlc_http_mgr_request(struct vlc_http_mgr *mgr, bool https,
54 const char *host, unsigned port,
55 const struct vlc_http_msg *req,
56 bool idempotent, bool payload);
57
59
60/**
61 * Creates an HTTP connection manager
62 *
63 * Allocates an HTTP client connections manager.
64 *
65 * @param obj parent VLC object
66 * @param jar HTTP cookies jar (NULL to disable cookies)
67 */
70
71/**
72 * Destroys an HTTP connection manager
73 *
74 * Deallocates an HTTP client connections manager created by
75 * vlc_http_msg_destroy(). Any remaining connection is closed and destroyed.
76 */
77void vlc_http_mgr_destroy(struct vlc_http_mgr *mgr);
78
79/** @} */
void vlc_http_mgr_destroy(struct vlc_http_mgr *mgr)
Destroys an HTTP connection manager.
Definition connmgr.c:305
struct vlc_http_cookie_jar_t * vlc_http_mgr_get_jar(struct vlc_http_mgr *)
Definition connmgr.c:285
struct vlc_http_msg * vlc_http_mgr_request(struct vlc_http_mgr *mgr, bool https, const char *host, unsigned port, const struct vlc_http_msg *req, bool idempotent, bool payload)
Sends an HTTP request.
Definition connmgr.c:273
struct vlc_http_mgr * vlc_http_mgr_create(vlc_object_t *obj, struct vlc_http_cookie_jar_t *jar)
Creates an HTTP connection manager.
Definition connmgr.c:290
Definition connmgr.c:100
struct vlc_http_cookie_jar_t * jar
Definition connmgr.c:104
vlc_object_t * obj
Definition connmgr.c:102
Definition message.c:43
struct vlc_http_stream * payload
Definition message.c:51
VLC object common members.
Definition vlc_objects.h:53