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