1 /*
2 * TLS/SSL Protocol
3 * Copyright (c) 2011 Martin Storsjo
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
31
33 {
34 char buf[1024];
35 const char *p = strchr(uri, '?');
36 if (!p)
37 return 0;
38
43 }
44
47 c->verify = strtol(buf, &endptr, 10);
48 if (buf == endptr)
50 }
51
56 }
57
62 }
63
64 return 0;
65 }
66
68 {
69 int port;
70 const char *p;
71 char buf[200],
opts[50] =
"";
73 const char *proxy_path;
74 char *env_http_proxy, *env_no_proxy;
75 int use_proxy;
77
81
84
86
87 p = strchr(uri, '?');
88
89 if (!p) {
91 } else {
94 }
95
96 ff_url_join(buf,
sizeof(buf),
"tcp",
NULL,
c->underlying_host, port,
"%s", p);
97
102 }
103
104 if (!
c->host && !(
c->host =
av_strdup(
c->underlying_host)))
106
108 proxy_path =
c->http_proxy ?
c->http_proxy : env_http_proxy;
109
114
115 if (use_proxy) {
116 char proxy_host[200], proxy_auth[200], dest[200];
117 int proxy_port;
119 proxy_host,
sizeof(proxy_host), &proxy_port,
NULL, 0,
120 proxy_path);
122 ff_url_join(buf,
sizeof(buf),
"httpproxy", proxy_auth, proxy_host,
123 proxy_port, "/%s", dest);
124 }
125
130 }