Commit 28fb3417 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

https: use vlc_tls_Close()

parent 8fa6f55c
......@@ -170,7 +170,7 @@ struct vlc_http_msg *vlc_https_request(struct vlc_http_mgr *mgr,
if (likely(conn2 != NULL))
mgr->conn2 = conn2;
else
vlc_https_disconnect(tls);
vlc_tls_Close(tls);
}
else /* TODO: HTTP/1.x support */
{
......@@ -178,7 +178,7 @@ struct vlc_http_msg *vlc_https_request(struct vlc_http_mgr *mgr,
if (likely(conn1 != NULL))
mgr->conn1 = conn1;
else
vlc_https_disconnect(tls);
vlc_tls_Close(tls);
}
return vlc_https_request_reuse(mgr, host, port, req);
......
......@@ -124,7 +124,7 @@ static void vlc_h1_conn_destroy(struct vlc_h1_conn *conn);
static void *vlc_h1_stream_fatal(struct vlc_h1_conn *conn)
{
msg_Dbg(CO(conn), "connection failed");
vlc_https_disconnect(conn->tls);
vlc_tls_Close(conn->tls);
conn->tls = NULL;
return NULL;
}
......@@ -242,7 +242,7 @@ static void vlc_h1_stream_close(struct vlc_http_stream *stream, bool abort)
if (abort)
{
vlc_https_disconnect(conn->tls);
vlc_tls_Close(conn->tls);
conn->tls = NULL;
}
......@@ -277,7 +277,7 @@ static void vlc_h1_conn_destroy(struct vlc_h1_conn *conn)
assert(conn->released);
if (conn->tls != NULL)
vlc_https_disconnect(conn->tls);
vlc_tls_Close(conn->tls);
free(conn);
}
......
......@@ -686,7 +686,7 @@ static void vlc_h2_conn_destroy(struct vlc_h2_conn *conn)
vlc_mutex_destroy(&conn->lock);
vlc_h2_output_destroy(conn->out);
vlc_https_disconnect(conn->tls);
vlc_tls_Close(conn->tls);
free(conn);
}
......
......@@ -131,19 +131,3 @@ vlc_tls_t *vlc_https_connect(vlc_tls_creds_t *creds, const char *name,
free(alp);
return tls;
}
void vlc_http_disconnect(int fd)
{
shutdown(fd, SHUT_RDWR);
net_Close(fd);
}
void vlc_https_disconnect(vlc_tls_t *tls)
{
int canc = vlc_savecancel();
int fd = tls->fd;
vlc_tls_SessionDelete(tls);
vlc_http_disconnect(fd);
vlc_restorecancel(canc);
}
......@@ -30,7 +30,5 @@ struct vlc_tls_creds;
struct vlc_tls *vlc_https_connect(struct vlc_tls_creds *creds,
const char *name, unsigned port,
bool *restrict two);
void vlc_http_disconnect(int fd);
void vlc_https_disconnect(struct vlc_tls *tls);
#endif
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