From patchwork Sun Oct 16 14:28:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jay X-Patchwork-Id: 1018 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp21904vsd; Sun, 16 Oct 2016 07:41:50 -0700 (PDT) X-Received: by 10.195.11.134 with SMTP id ei6mr8525929wjd.176.1476628910212; Sun, 16 Oct 2016 07:41:50 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id tt17si34526239wjb.197.2016.10.16.07.41.48; Sun, 16 Oct 2016 07:41:50 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 37503689721; Sun, 16 Oct 2016 17:41:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B571E6891DC for ; Sun, 16 Oct 2016 17:41:38 +0300 (EEST) Received: by mail-qk0-f194.google.com with SMTP id n189so11997669qke.1 for ; Sun, 16 Oct 2016 07:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=P3DdkmiYgGw1etDGdhXKGKJmmG1xJmhhjXIntsyN3LA=; b=S1jwSb+Zgeogi4FNMQwniDw10K33AH6xZen4G8NSQgoA18FMpjZXlSszQhLxUUsGAt qasl8pKmSctwYFj2A3K4gq7nN4h18pSOsVLt2qACudNy42VwZbB/i3TeZ/wSk6l1UjEs RmGdGKCxldPHl8ZdLn+vOkz43e714TIjN4ZVClT4VeivgvuQ93sK4qV2dahnVeW1E7GG zbLeCLid64FrRd1TZyKKn96YkvgdsJDPaDfWQAFOfENJlLnuX84tNmnJ4DfIudCSm9fV lbiMsxox5Xrc44gUdk6vD2z1skU99yUQ6DqpjMDtd0oDuhfvYhv63psY8RiffW0HVwOo CsCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=P3DdkmiYgGw1etDGdhXKGKJmmG1xJmhhjXIntsyN3LA=; b=DELMLhlzKsnVfIjpKg2Q33kSMlvsmT5mijNZGlWBH1Re2nM5WSHQk6/WpAzy4cXiwo eScEWxZ8ScfRnBSYunXxbKGPT1AGSPo2J6JbCtYH7/YFIKfBVvdE1jWkAgpIcYNCFxhG 0nXMJcUMFJaog0bnPftKe2jNz8EHx4MSBSAj0CVMKCPYsmWX5a0j2omfc19jgclLbGVy yDiBacVQVELyqDDdsR4NS4qsb7p7pbkxUBvKJiqQTASprhyOx348t6PqsSVM6AhuYYQi MvHBZhEPlWqVQbjXXwr70maZnFXvUofCUmYylAFVgWy3rY9tuqLrY6pxxJZ9XIynsLPx GrbQ== X-Gm-Message-State: AA6/9Rk9qUbzmBbSSX+KZ7h/KK41zBg0KcimytuVKXZPEc/k83E6n+FCAePld2lRPukNrQ== X-Received: by 10.55.135.1 with SMTP id j1mr19339191qkd.46.1476628107407; Sun, 16 Oct 2016 07:28:27 -0700 (PDT) Received: from localhost.localdomain (pool-96-255-15-101.washdc.fios.verizon.net. [96.255.15.101]) by smtp.gmail.com with ESMTPSA id u4sm12542372qka.9.2016.10.16.07.28.24 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 16 Oct 2016 07:28:25 -0700 (PDT) From: jayridge@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Sun, 16 Oct 2016 10:28:21 -0400 Message-Id: <1476628101-46884-1-git-send-email-jayridge@gmail.com> X-Mailer: git-send-email 2.6.3 Subject: [FFmpeg-devel] [PATCH] avformat/tls: add tls url_get_file_handle X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Jay Ridgeway MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Jay Ridgeway Support url_get_file_handle on TLS streams. --- libavformat/tls_gnutls.c | 7 +++++++ libavformat/tls_openssl.c | 7 +++++++ libavformat/tls_schannel.c | 7 +++++++ libavformat/tls_securetransport.c | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c index 991b36b..ecc80bf 100644 --- a/libavformat/tls_gnutls.c +++ b/libavformat/tls_gnutls.c @@ -235,6 +235,12 @@ static int tls_write(URLContext *h, const uint8_t *buf, int size) return print_tls_error(h, ret); } +static int tls_get_file_handle(URLContext *h) +{ + TLSContext *c = h->priv_data; + return ffurl_get_file_handle(c->tls_shared.tcp); +} + static const AVOption options[] = { TLS_COMMON_OPTIONS(TLSContext, tls_shared), { NULL } @@ -253,6 +259,7 @@ const URLProtocol ff_tls_gnutls_protocol = { .url_read = tls_read, .url_write = tls_write, .url_close = tls_close, + .url_get_file_handle = tls_get_file_handle, .priv_data_size = sizeof(TLSContext), .flags = URL_PROTOCOL_FLAG_NETWORK, .priv_data_class = &tls_class, diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c index 46eb3e6..1455392 100644 --- a/libavformat/tls_openssl.c +++ b/libavformat/tls_openssl.c @@ -283,6 +283,12 @@ static int tls_write(URLContext *h, const uint8_t *buf, int size) return print_tls_error(h, ret); } +static int tls_get_file_handle(URLContext *h) +{ + TLSContext *c = h->priv_data; + return ffurl_get_file_handle(c->tls_shared.tcp); +} + static const AVOption options[] = { TLS_COMMON_OPTIONS(TLSContext, tls_shared), { NULL } @@ -301,6 +307,7 @@ const URLProtocol ff_tls_openssl_protocol = { .url_read = tls_read, .url_write = tls_write, .url_close = tls_close, + .url_get_file_handle = tls_get_file_handle, .priv_data_size = sizeof(TLSContext), .flags = URL_PROTOCOL_FLAG_NETWORK, .priv_data_class = &tls_class, diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c index c11b7d4..065dccb 100644 --- a/libavformat/tls_schannel.c +++ b/libavformat/tls_schannel.c @@ -577,6 +577,12 @@ done: return ret < 0 ? ret : outbuf[1].cbBuffer; } +static int tls_get_file_handle(URLContext *h) +{ + TLSContext *c = h->priv_data; + return ffurl_get_file_handle(c->tls_shared.tcp); +} + static const AVOption options[] = { TLS_COMMON_OPTIONS(TLSContext, tls_shared), { NULL } @@ -595,6 +601,7 @@ const URLProtocol ff_tls_schannel_protocol = { .url_read = tls_read, .url_write = tls_write, .url_close = tls_close, + .url_get_file_handle = tls_get_file_handle, .priv_data_size = sizeof(TLSContext), .flags = URL_PROTOCOL_FLAG_NETWORK, .priv_data_class = &tls_class, diff --git a/libavformat/tls_securetransport.c b/libavformat/tls_securetransport.c index 253c89c..bc8a320 100644 --- a/libavformat/tls_securetransport.c +++ b/libavformat/tls_securetransport.c @@ -375,6 +375,12 @@ static int tls_write(URLContext *h, const uint8_t *buf, int size) return print_tls_error(h, ret); } +static int tls_get_file_handle(URLContext *h) +{ + TLSContext *c = h->priv_data; + return ffurl_get_file_handle(c->tls_shared.tcp); +} + static const AVOption options[] = { TLS_COMMON_OPTIONS(TLSContext, tls_shared), { NULL } @@ -393,6 +399,7 @@ const URLProtocol ff_tls_securetransport_protocol = { .url_read = tls_read, .url_write = tls_write, .url_close = tls_close, + .url_get_file_handle = tls_get_file_handle, .priv_data_size = sizeof(TLSContext), .flags = URL_PROTOCOL_FLAG_NETWORK, .priv_data_class = &tls_class,