Browse Source

https: use vlc_tls_Close()

pull/38/head
Rémi Denis-Courmont 11 years ago
parent
commit
28fb341732
  1. 4
      modules/access/http/connmgr.c
  2. 6
      modules/access/http/h1conn.c
  3. 2
      modules/access/http/h2conn.c
  4. 16
      modules/access/http/transport.c
  5. 2
      modules/access/http/transport.h

4
modules/access/http/connmgr.c

@ -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);

6
modules/access/http/h1conn.c

@ -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);
}

2
modules/access/http/h2conn.c

@ -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);
}

16
modules/access/http/transport.c

@ -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);
}

2
modules/access/http/transport.h

@ -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

Loading…
Cancel
Save