[vlc-devel] [PATCH 1/5] access/http: Introduce a struct for cookie data

Antti Ajanki antti.ajanki at iki.fi
Thu Jul 24 10:11:50 CEST 2014


I'll post an updated patch in reply to this message. Changes:

I moved the cookie code to a separate file.
All errors paths should now be handled.
cookie_domain_matches() supports IPv6 addresses (untested).
Fixed a memory leak in cookie_parse introduced in my previous patch.
I introduced locale independent vlc_ascii_str(n)casecmp functions for 
comparing domains.

I also collapsed all changes into a single patch. If it is easier to 
review in parts, I can re-post as a full patchset like before.

On 22.07.2014 13:32, Rémi Denis-Courmont wrote:
>    Heippa,
> Le 2014-07-22 13:09, Antti Ajanki a écrit :
>> +typedef struct http_cookie_t
>> +{
>> +    char *psz_name;
>> +    char *psz_value;
>> +    char *psz_domain;
>> +} http_cookie_t;
> Fine but did you consider creating a cookie_s_ structure and getting 
> rid of the generic array?

Can you elaborate what do you mean here? A typed dynamic array instead 
of a generic array? Is there an example in the codebase I could follow?

The httpcookies.h now exposes a http_cookie_jar_t type that the caller 
can handle as an opaque type. It is still a typedef'd vlc_array_t, however.


More information about the vlc-devel mailing list