Re: [FFmpeg-devel] [PATCH] store cookies returned in HLS key responses

2015-03-15 Thread Michael Niedermayer
On Sun, Mar 15, 2015 at 10:00:38AM +1100, Micah Galizia wrote:
 Hello,
 
 Neulion has added Set-Cookie fields in the response headers of their
 HLS key files. Those cookie values must be echoed back in the next key
 request or authentication on the subsequent key will fail.
 
 This fix will exacerbate the existing bug where the cookie field of
 ffmpeg requests keeps getting larger (since cookies are append when
 they should be replaced). However, those streams will fail sooner
 without this fix. Also, I have a fix for that bug too, but I'll start
 with this.
 
 Thanks in advance!
 -- 
 The mark of an immature man is that he wants to die nobly for a
 cause, while the mark of the mature man is that he wants to live
 humbly for one.   --W. Stekel

  hls.c |5 +
  1 file changed, 5 insertions(+)
 0105a89eff5edb6fbc2751a369447dd743496476  
 0001-store-cookies-returned-in-HLS-key-response.patch
 From 7f2db07b91407a970b99655da96c8c2532e2c1ad Mon Sep 17 00:00:00 2001
 From: Micah Galizia micahgali...@gmail.com
 Date: Sun, 15 Mar 2015 09:31:59 +1100
 Subject: [PATCH] store cookies returned in HLS key response

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] store cookies returned in HLS key responses

2015-03-15 Thread Micah Galizia
Excellent, thank you -- patch to refactor that repeated
free/opt_get/free code (it happens four times) will be submitted
shortly...

On Mon, Mar 16, 2015 at 12:00 PM, Michael Niedermayer michae...@gmx.at wrote:
 On Sun, Mar 15, 2015 at 10:00:38AM +1100, Micah Galizia wrote:
 Hello,

 Neulion has added Set-Cookie fields in the response headers of their
 HLS key files. Those cookie values must be echoed back in the next key
 request or authentication on the subsequent key will fail.

 This fix will exacerbate the existing bug where the cookie field of
 ffmpeg requests keeps getting larger (since cookies are append when
 they should be replaced). However, those streams will fail sooner
 without this fix. Also, I have a fix for that bug too, but I'll start
 with this.

 Thanks in advance!
 --
 The mark of an immature man is that he wants to die nobly for a
 cause, while the mark of the mature man is that he wants to live
 humbly for one.   --W. Stekel

  hls.c |5 +
  1 file changed, 5 insertions(+)
 0105a89eff5edb6fbc2751a369447dd743496476  
 0001-store-cookies-returned-in-HLS-key-response.patch
 From 7f2db07b91407a970b99655da96c8c2532e2c1ad Mon Sep 17 00:00:00 2001
 From: Micah Galizia micahgali...@gmail.com
 Date: Sun, 15 Mar 2015 09:31:59 +1100
 Subject: [PATCH] store cookies returned in HLS key response

 applied

 thanks

 [...]

 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

 I know you won't believe me, but the highest form of Human Excellence is
 to question oneself and others. -- Socrates

 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel




-- 
The mark of an immature man is that he wants to die nobly for a
cause, while the mark of the mature man is that he wants to live
humbly for one.   --W. Stekel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] store cookies returned in HLS key responses

2015-03-14 Thread Micah Galizia
Hello,

Neulion has added Set-Cookie fields in the response headers of their
HLS key files. Those cookie values must be echoed back in the next key
request or authentication on the subsequent key will fail.

This fix will exacerbate the existing bug where the cookie field of
ffmpeg requests keeps getting larger (since cookies are append when
they should be replaced). However, those streams will fail sooner
without this fix. Also, I have a fix for that bug too, but I'll start
with this.

Thanks in advance!
-- 
The mark of an immature man is that he wants to die nobly for a
cause, while the mark of the mature man is that he wants to live
humbly for one.   --W. Stekel
From 7f2db07b91407a970b99655da96c8c2532e2c1ad Mon Sep 17 00:00:00 2001
From: Micah Galizia micahgali...@gmail.com
Date: Sun, 15 Mar 2015 09:31:59 +1100
Subject: [PATCH] store cookies returned in HLS key response

---
 libavformat/hls.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 5e8e1b2..5ed7a24 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -944,6 +944,11 @@ static int open_input(HLSContext *c, struct playlist *pls)
 av_log(NULL, AV_LOG_ERROR, Unable to read key file %s\n,
seg-key);
 }
+av_freep(c-cookies);
+av_opt_get(uc-priv_data, cookies, 0, (uint8_t**)(c-cookies));
+if (c-cookies  !strlen(c-cookies))
+av_freep(c-cookies);
+av_dict_set(opts, cookies, c-cookies, 0);
 ffurl_close(uc);
 } else {
 av_log(NULL, AV_LOG_ERROR, Unable to open key file %s\n,
-- 
2.1.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel