On Wed, Jul 25, 2012 at 12:43:39PM +0300, Antti Seppälä wrote:
> It should be possible to specify usernames in http requests containing
> urlencoded characters. This patch adds support for decoding the auth
> strings.
> 
> --- /dev/null
> +++ b/libavformat/urldecode.c
> @@ -0,0 +1,86 @@
> +/*
> + * Simple url decoding function

URL

> + * Copyright (c) 2012 Antti Seppälä
> + *
> + * References:
> + *  RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
> + *       T. Berners-Lee et al. The Internet Society, 2005
> + *
> + * based on http://www.icosaedro.it/apache/urldecode.c
> + *          from Umberto Salsi ([email protected])

This file does not have a license statement.  Did you get permission
to use it?  Because w/o explicit permission, you are not allowed to.

> +#include <ctype.h>
> +#include <string.h>
> +#include "libavutil/mem.h"
> +#include "libavutil/avstring.h"
> +#include "urldecode.h"

Separate system from local headers with an empty line please.

> +char* ff_urldecode(const char* url)

char *ff_urldecode(const char *url)

> +        } else if(c == '+') {

if (

> --- /dev/null
> +++ b/libavformat/urldecode.h
> @@ -0,0 +1,35 @@
> +
> +#ifndef AVUTIL_URLDECODE_H
> +#define AVUTIL_URLDECODE_H
> +
> +#endif /* AVUTIL_URLDECODE_H */

AVFORMAT_

> +/**
> + * Decodes an url from its percent-encoded form back into normal
> + * representation. This function returns the decoded url in a string.
> + * The url to be decoded does not necessarily have to be encoded but
> + * in that case the original string is duplicated.
> + *
> + * @param url a string to be decoded.
> + * @return new string with the url decoded or NULL if decoding failed.

Use uppercase URL when not referring to the variable name.

> + * Note that the returned string should be explicitly freed when not
> + * used anymore.
> + */
> +char* ff_urldecode(const char* url);

char *ff_urldecode(const char *url);

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to