[FFmpeg-devel] [PATCH 3/3] http: return cookie errors

wm4 nfxjfg at googlemail.com
Sun Mar 23 18:26:38 CET 2014


On Sun, 23 Mar 2014 06:00:12 +0100
Michael Niedermayer <michaelni at gmx.at> wrote:

> On Fri, Mar 21, 2014 at 06:51:32PM +0100, wm4 wrote:
> > This forwards errors returned by get_cookies() to the caller. Before
> > this, errors were completely ignored.
> > 
> > This also requires changing the return value to success if no cookies
> > are set. Obviously, not specifying any cookie should not be an error.
> > ---
> > Not too sure about this? Do we want this? Certainly it should return
> > some errors (especially stuff like out of memory), but on the other
> > hand, refusing all http connections just because the cookie string
> > is broken isn't so great either.
> 
> iam not sure either, just say if i should apply it or not
> but probably some kind of warning should be printed if there are
> issues with the cookie

I'm not sure either, so maybe let's say "no" for now.

> > 
> > Also, I didn't really test the error path.
> > ---
> >  libavformat/http.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavformat/http.c b/libavformat/http.c
> > index 64ca4ae..296d873 100644
> > --- a/libavformat/http.c
> > +++ b/libavformat/http.c
> > @@ -539,9 +539,10 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path,
> >      int ret = 0;
> >      char *next, *cookie, *set_cookies = av_strdup(s->cookies), *cset_cookies = set_cookies;
> >  
> > -    if (!set_cookies) return AVERROR(EINVAL);
> > -
> >      *cookies = NULL;
> > +    if (!set_cookies)
> > +        return ret;
> 
> nitpick: could be return 0
> 
> 
> [...]



More information about the ffmpeg-devel mailing list