Commit a67b8e3b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

http: inline one function

...whose name had become somewhat misleading.
parent 5ed80c35
...@@ -91,25 +91,6 @@ static char *vlc_http_proxy_find(const char *hostname, unsigned port, ...@@ -91,25 +91,6 @@ static char *vlc_http_proxy_find(const char *hostname, unsigned port,
return proxy; return proxy;
} }
static vlc_tls_t *vlc_https_connect_i11e(vlc_tls_creds_t *creds,
const char *host, unsigned port,
bool *restrict http_two)
{
vlc_tls_t *tls;
char *proxy = vlc_http_proxy_find(host, port, true);
if (proxy != NULL)
{
tls = vlc_https_connect_proxy(creds->obj.parent, creds, host, port,
http_two, proxy);
free(proxy);
}
else
tls = vlc_https_connect(creds, host, port, http_two);
return tls;
}
struct vlc_http_mgr struct vlc_http_mgr
{ {
...@@ -165,6 +146,9 @@ static struct vlc_http_msg *vlc_https_request(struct vlc_http_mgr *mgr, ...@@ -165,6 +146,9 @@ static struct vlc_http_msg *vlc_https_request(struct vlc_http_mgr *mgr,
const char *host, unsigned port, const char *host, unsigned port,
const struct vlc_http_msg *req) const struct vlc_http_msg *req)
{ {
vlc_tls_t *tls;
bool http2;
if (mgr->creds == NULL && mgr->conn != NULL) if (mgr->creds == NULL && mgr->conn != NULL)
return NULL; /* switch from HTTP to HTTPS not implemented */ return NULL; /* switch from HTTP to HTTPS not implemented */
...@@ -180,8 +164,16 @@ static struct vlc_http_msg *vlc_https_request(struct vlc_http_mgr *mgr, ...@@ -180,8 +164,16 @@ static struct vlc_http_msg *vlc_https_request(struct vlc_http_mgr *mgr,
if (resp != NULL) if (resp != NULL)
return resp; /* existing connection reused */ return resp; /* existing connection reused */
bool http2 = true; char *proxy = vlc_http_proxy_find(host, port, true);
vlc_tls_t *tls = vlc_https_connect_i11e(mgr->creds, host, port, &http2); if (proxy != NULL)
{
tls = vlc_https_connect_proxy(mgr->creds, mgr->creds,
host, port, &http2, proxy);
free(proxy);
}
else
tls = vlc_https_connect(mgr->creds, host, port, &http2);
if (tls == NULL) if (tls == NULL)
return NULL; return NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment