VLC  4.0.0-dev
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 
32 struct vlc_http_mgr;
33 struct 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 succesful, 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  *
49  * @return The initial HTTP response header, or NULL in case of failure.
50  */
51 struct vlc_http_msg *vlc_http_mgr_request(struct vlc_http_mgr *mgr, bool https,
52  const char *host, unsigned port,
53  const struct vlc_http_msg *req);
54 
56 
57 /**
58  * Creates an HTTP connection manager
59  *
60  * Allocates an HTTP client connections manager.
61  *
62  * @param obj parent VLC object
63  * @param jar HTTP cookies jar (NULL to disable cookies)
64  */
66  struct vlc_http_cookie_jar_t *jar);
67 
68 /**
69  * Destroys an HTTP connection manager
70  *
71  * Deallocates an HTTP client connections manager created by
72  * vlc_http_msg_destroy(). Any remaining connection is closed and destroyed.
73  */
74 void vlc_http_mgr_destroy(struct vlc_http_mgr *mgr);
75 
76 /** @} */
Definition: connmgr.c:99
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:274
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)
Sends an HTTP request.
Definition: connmgr.c:259
vlc_object_t * obj
Definition: connmgr.c:102
struct vlc_http_cookie_jar_t * vlc_http_mgr_get_jar(struct vlc_http_mgr *)
Definition: connmgr.c:269
struct vlc_http_cookie_jar_t * jar
Definition: connmgr.c:104
void vlc_http_mgr_destroy(struct vlc_http_mgr *mgr)
Destroys an HTTP connection manager.
Definition: connmgr.c:289
Definition: message.c:41
VLC object common members.
Definition: vlc_objects.h:43