On Fri, May 29, 2015 at 4:34 PM, Stephan Holljes
<klaxa1...@googlemail.com> wrote:
> On Fri, May 29, 2015 at 4:19 PM, wm4 <nfx...@googlemail.com> wrote:
>> On Fri, 29 May 2015 16:12:27 +0200
>> Stephan Holljes <klaxa1...@googlemail.com> wrote:
>>
>>> Hi,
>>>
>>> On Fri, May 29, 2015 at 11:54 AM, Michael Niedermayer <michae...@gmx.at> 
>>> wrote:
>>> > On Fri, May 29, 2015 at 05:05:08AM +0200, Stephan Holljes wrote:
>>> >> Signed-off-by: Stephan Holljes <klaxa1...@googlemail.com>
>>> >> ---
>>> >>  libavformat/http.c | 8 ++++++++
>>> >>  1 file changed, 8 insertions(+)
>>> >>
>>> >> diff --git a/libavformat/http.c b/libavformat/http.c
>>> >> index 4f6716a..3fad43d 100644
>>> >> --- a/libavformat/http.c
>>> >> +++ b/libavformat/http.c
>>> >> @@ -556,6 +556,14 @@ static int process_line(URLContext *h, char *line, 
>>> >> int line_count,
>>> >>
>>> >>      p = line;
>>> >>      if (line_count == 0) {
>>> >> +        if (s->listen) {
>>> >> +            while (!av_isspace(*p))
>>> >> +                p++;
>>> >
>>> >> +            s->method = av_malloc(p - line);
>>> >> +            if (!s->method)
>>> >> +                return AVERROR(ENOMEM);
>>> >> +            av_strlcpy(s->method, line, p - line + 1);
>>> >
>>> > the allocated size and the size passed to av_strlcpy() should match
>>>
>>> Attached patch fixes that.
>>>
>>
>> av_strndup?
>
> That looks a lot more suited. Will change the code accordingly.
>

Attached patch makes use of av_strndup.

>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
From 33a479200b9a941d0783d941c6ea68f8b85cc4de Mon Sep 17 00:00:00 2001
From: Stephan Holljes <klaxa1...@googlemail.com>
Date: Fri, 29 May 2015 16:47:11 +0200
Subject: [PATCH] lavf/http: Parse and set HTTP method when listening on
 HTTP(S)

Signed-off-by: Stephan Holljes <klaxa1...@googlemail.com>
---
 libavformat/http.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/http.c b/libavformat/http.c
index 4f6716a..c73734f 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -556,6 +556,12 @@ static int process_line(URLContext *h, char *line, int line_count,
 
     p = line;
     if (line_count == 0) {
+        if (s->listen) {
+            while (!av_isspace(*p))
+                p++;
+            if (!(s->method = av_strndup(line, p - line)))
+                return AVERROR(ENOMEM);
+        }
         while (!av_isspace(*p) && *p != '\0')
             p++;
         while (av_isspace(*p))
-- 
2.1.0

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

Reply via email to