tls: Hook up the url_get_short_seek function in the TLS backends

This makes sure that small seeks forward on https don't end up
doing new requests.

Signed-off-by: Martin Storsjö <martin@martin.st>
pull/358/head
Martin Storsjö 4 years ago
parent a1553b0cfb
commit 70d8077b79
  1. 7
      libavformat/tls_gnutls.c
  2. 7
      libavformat/tls_libtls.c
  3. 7
      libavformat/tls_mbedtls.c
  4. 7
      libavformat/tls_openssl.c
  5. 7
      libavformat/tls_schannel.c
  6. 7
      libavformat/tls_securetransport.c

@ -269,6 +269,12 @@ static int tls_get_file_handle(URLContext *h)
return ffurl_get_file_handle(c->tls_shared.tcp); return ffurl_get_file_handle(c->tls_shared.tcp);
} }
static int tls_get_short_seek(URLContext *h)
{
TLSContext *s = h->priv_data;
return ffurl_get_short_seek(s->tls_shared.tcp);
}
static const AVOption options[] = { static const AVOption options[] = {
TLS_COMMON_OPTIONS(TLSContext, tls_shared), TLS_COMMON_OPTIONS(TLSContext, tls_shared),
{ NULL } { NULL }
@ -288,6 +294,7 @@ const URLProtocol ff_tls_protocol = {
.url_write = tls_write, .url_write = tls_write,
.url_close = tls_close, .url_close = tls_close,
.url_get_file_handle = tls_get_file_handle, .url_get_file_handle = tls_get_file_handle,
.url_get_short_seek = tls_get_short_seek,
.priv_data_size = sizeof(TLSContext), .priv_data_size = sizeof(TLSContext),
.flags = URL_PROTOCOL_FLAG_NETWORK, .flags = URL_PROTOCOL_FLAG_NETWORK,
.priv_data_class = &tls_class, .priv_data_class = &tls_class,

@ -181,6 +181,12 @@ static int tls_get_file_handle(URLContext *h)
return ffurl_get_file_handle(c->tls_shared.tcp); return ffurl_get_file_handle(c->tls_shared.tcp);
} }
static int tls_get_short_seek(URLContext *h)
{
TLSContext *s = h->priv_data;
return ffurl_get_short_seek(s->tls_shared.tcp);
}
static const AVOption options[] = { static const AVOption options[] = {
TLS_COMMON_OPTIONS(TLSContext, tls_shared), TLS_COMMON_OPTIONS(TLSContext, tls_shared),
{ NULL } { NULL }
@ -200,6 +206,7 @@ const URLProtocol ff_tls_protocol = {
.url_write = ff_tls_write, .url_write = ff_tls_write,
.url_close = ff_tls_close, .url_close = ff_tls_close,
.url_get_file_handle = tls_get_file_handle, .url_get_file_handle = tls_get_file_handle,
.url_get_short_seek = tls_get_short_seek,
.priv_data_size = sizeof(TLSContext), .priv_data_size = sizeof(TLSContext),
.flags = URL_PROTOCOL_FLAG_NETWORK, .flags = URL_PROTOCOL_FLAG_NETWORK,
.priv_data_class = &tls_class, .priv_data_class = &tls_class,

@ -326,6 +326,12 @@ static int tls_get_file_handle(URLContext *h)
return ffurl_get_file_handle(c->tls_shared.tcp); return ffurl_get_file_handle(c->tls_shared.tcp);
} }
static int tls_get_short_seek(URLContext *h)
{
TLSContext *s = h->priv_data;
return ffurl_get_short_seek(s->tls_shared.tcp);
}
static const AVOption options[] = { static const AVOption options[] = {
TLS_COMMON_OPTIONS(TLSContext, tls_shared), \ TLS_COMMON_OPTIONS(TLSContext, tls_shared), \
{"key_password", "Password for the private key file", OFFSET(priv_key_pw), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ {"key_password", "Password for the private key file", OFFSET(priv_key_pw), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \
@ -346,6 +352,7 @@ const URLProtocol ff_tls_protocol = {
.url_write = tls_write, .url_write = tls_write,
.url_close = tls_close, .url_close = tls_close,
.url_get_file_handle = tls_get_file_handle, .url_get_file_handle = tls_get_file_handle,
.url_get_short_seek = tls_get_short_seek,
.priv_data_size = sizeof(TLSContext), .priv_data_size = sizeof(TLSContext),
.flags = URL_PROTOCOL_FLAG_NETWORK, .flags = URL_PROTOCOL_FLAG_NETWORK,
.priv_data_class = &tls_class, .priv_data_class = &tls_class,

@ -351,6 +351,12 @@ static int tls_get_file_handle(URLContext *h)
return ffurl_get_file_handle(c->tls_shared.tcp); return ffurl_get_file_handle(c->tls_shared.tcp);
} }
static int tls_get_short_seek(URLContext *h)
{
TLSContext *s = h->priv_data;
return ffurl_get_short_seek(s->tls_shared.tcp);
}
static const AVOption options[] = { static const AVOption options[] = {
TLS_COMMON_OPTIONS(TLSContext, tls_shared), TLS_COMMON_OPTIONS(TLSContext, tls_shared),
{ NULL } { NULL }
@ -370,6 +376,7 @@ const URLProtocol ff_tls_protocol = {
.url_write = tls_write, .url_write = tls_write,
.url_close = tls_close, .url_close = tls_close,
.url_get_file_handle = tls_get_file_handle, .url_get_file_handle = tls_get_file_handle,
.url_get_short_seek = tls_get_short_seek,
.priv_data_size = sizeof(TLSContext), .priv_data_size = sizeof(TLSContext),
.flags = URL_PROTOCOL_FLAG_NETWORK, .flags = URL_PROTOCOL_FLAG_NETWORK,
.priv_data_class = &tls_class, .priv_data_class = &tls_class,

@ -589,6 +589,12 @@ static int tls_get_file_handle(URLContext *h)
return ffurl_get_file_handle(c->tls_shared.tcp); return ffurl_get_file_handle(c->tls_shared.tcp);
} }
static int tls_get_short_seek(URLContext *h)
{
TLSContext *s = h->priv_data;
return ffurl_get_short_seek(s->tls_shared.tcp);
}
static const AVOption options[] = { static const AVOption options[] = {
TLS_COMMON_OPTIONS(TLSContext, tls_shared), TLS_COMMON_OPTIONS(TLSContext, tls_shared),
{ NULL } { NULL }
@ -608,6 +614,7 @@ const URLProtocol ff_tls_protocol = {
.url_write = tls_write, .url_write = tls_write,
.url_close = tls_close, .url_close = tls_close,
.url_get_file_handle = tls_get_file_handle, .url_get_file_handle = tls_get_file_handle,
.url_get_short_seek = tls_get_short_seek,
.priv_data_size = sizeof(TLSContext), .priv_data_size = sizeof(TLSContext),
.flags = URL_PROTOCOL_FLAG_NETWORK, .flags = URL_PROTOCOL_FLAG_NETWORK,
.priv_data_class = &tls_class, .priv_data_class = &tls_class,

@ -396,6 +396,12 @@ static int tls_get_file_handle(URLContext *h)
return ffurl_get_file_handle(c->tls_shared.tcp); return ffurl_get_file_handle(c->tls_shared.tcp);
} }
static int tls_get_short_seek(URLContext *h)
{
TLSContext *s = h->priv_data;
return ffurl_get_short_seek(s->tls_shared.tcp);
}
static const AVOption options[] = { static const AVOption options[] = {
TLS_COMMON_OPTIONS(TLSContext, tls_shared), TLS_COMMON_OPTIONS(TLSContext, tls_shared),
{ NULL } { NULL }
@ -415,6 +421,7 @@ const URLProtocol ff_tls_protocol = {
.url_write = tls_write, .url_write = tls_write,
.url_close = tls_close, .url_close = tls_close,
.url_get_file_handle = tls_get_file_handle, .url_get_file_handle = tls_get_file_handle,
.url_get_short_seek = tls_get_short_seek,
.priv_data_size = sizeof(TLSContext), .priv_data_size = sizeof(TLSContext),
.flags = URL_PROTOCOL_FLAG_NETWORK, .flags = URL_PROTOCOL_FLAG_NETWORK,
.priv_data_class = &tls_class, .priv_data_class = &tls_class,

Loading…
Cancel
Save