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

Michael Niedermayer michaelni at gmx.at
Sun Mar 23 06:00:12 CET 2014


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


> 
> 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


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140323/ee547bb5/attachment.asc>


More information about the ffmpeg-devel mailing list