Re: [FFmpeg-devel] [PATCH][GSoC] lavf/http: Add simple autodetection for client HTTP method, based on AVIO_FLAG_READ.
L'octidi 18 prairial, an CCXXIII, Stephan Holljes a écrit : > No, should I? I'm still learning the ropes with git. I haven't used it > with more than 3 people at once. It may be convenient, but it absolutely not mandatory. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH][GSoC] lavf/http: Add simple autodetection for client HTTP method, based on AVIO_FLAG_READ.
On Sat, Jun 6, 2015 at 9:47 AM, Nicolas George wrote: > Le septidi 17 prairial, an CCXXIII, Stephan Holljes a écrit : >> Signed-off-by: Stephan Holljes >> --- >> libavformat/http.c | 9 + >> 1 file changed, 9 insertions(+) > > LGTM. > > Michael, I have pushed these to my tree, can you pull please: > > aa74401 lavf/http: Document method option. > bbcee92 lavf/http: Process HTTP header before sending response. > 8cfaa76 lavf/http: Rudimentary error handling for HTTP requests received from > clients. > a7e7c68 lavf/http: Properly process HTTP header on listen. > 290b237 lavf/http: Indent else-clause. > 44d1921 lavf/http: Add simple autodetection for client HTTP method, based on > AVIO_FLAG_READ. > > (fixing the empty line and brace in 8cfaa76) > > Stephan: do you have a publicly available Git clone? No, should I? I'm still learning the ropes with git. I haven't used it with more than 3 people at once. > > Regards, > > -- > Nicolas George ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH][GSoC] lavf/http: Add simple autodetection for client HTTP method, based on AVIO_FLAG_READ.
On Sat, Jun 06, 2015 at 09:47:36AM +0200, Nicolas George wrote: > Le septidi 17 prairial, an CCXXIII, Stephan Holljes a écrit : > > Signed-off-by: Stephan Holljes > > --- > > libavformat/http.c | 9 + > > 1 file changed, 9 insertions(+) > > LGTM. > > Michael, I have pushed these to my tree, can you pull please: merged thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Into a blind darkness they enter who follow after the Ignorance, they as if into a greater darkness enter who devote themselves to the Knowledge alone. -- Isha Upanishad signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH][GSoC] lavf/http: Add simple autodetection for client HTTP method, based on AVIO_FLAG_READ.
Le septidi 17 prairial, an CCXXIII, Stephan Holljes a écrit : > Signed-off-by: Stephan Holljes > --- > libavformat/http.c | 9 + > 1 file changed, 9 insertions(+) LGTM. Michael, I have pushed these to my tree, can you pull please: aa74401 lavf/http: Document method option. bbcee92 lavf/http: Process HTTP header before sending response. 8cfaa76 lavf/http: Rudimentary error handling for HTTP requests received from clients. a7e7c68 lavf/http: Properly process HTTP header on listen. 290b237 lavf/http: Indent else-clause. 44d1921 lavf/http: Add simple autodetection for client HTTP method, based on AVIO_FLAG_READ. (fixing the empty line and brace in 8cfaa76) Stephan: do you have a publicly available Git clone? Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH][GSoC] lavf/http: Add simple autodetection for client HTTP method, based on AVIO_FLAG_READ.
Signed-off-by: Stephan Holljes --- libavformat/http.c | 9 + 1 file changed, 9 insertions(+) diff --git a/libavformat/http.c b/libavformat/http.c index 90e88ad..32fc1ce 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -563,6 +563,7 @@ static int process_line(URLContext *h, char *line, int line_count, int *new_location) { HTTPContext *s = h->priv_data; +const char *auto_method = h->flags & AVIO_FLAG_READ ? "POST" : "GET"; char *tag, *p, *end, *method, *resource, *version; int ret; @@ -587,6 +588,14 @@ static int process_line(URLContext *h, char *line, int line_count, s->method, method); return ff_http_averror(400, AVERROR(EIO)); } +} else { +// use autodetected HTTP method to expect +av_log(h, AV_LOG_TRACE, "Autodetected %s HTTP method\n", auto_method); +if (av_strcasecmp(auto_method, method)) { +av_log(h, AV_LOG_ERROR, "Received and autodetected HTTP method did not match " + "(%s autodetected %s received)\n", auto_method, method); +return ff_http_averror(400, AVERROR(EIO)); +} } // HTTP resource -- 2.1.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel