Web lists-archives.com

Re: [MPlayer-dev-eng] [PATCH] fix parsing cookies on win32




Hi Gianluigi!

On 2015-02-12 03:58 +0100, Gianluigi Tiesi wrote:
> The cookie parser checks whether the file size is equal to
> read size, this is not always true on win32 if the cookie
> file has windows line endings.
> 
> The parser is kind enough to parse cookies files with
> windows line endings, but the file should be opened in
> binary mode or the check will fail.
> 
> The attached patch fixes the problem.

  Thank you!

> Perhaps please consider to remove the attempt to load
> cookies from mozilla profile since nowadays paths are different
> and the cookies are not even in a text file.
> The function is load_cookies()

  Should not hurt to keep that for now. Or did you spot
a bug?

> diff --git a/stream/cookies.c b/stream/cookies.c
> index 1ee5a58..480fdf8 100644
> --- a/stream/cookies.c
> +++ b/stream/cookies.c
> @@ -115,7 +115,7 @@ static char *load_file(const char *filename, off_t * length)
>  
>      mp_msg(MSGT_NETWORK, MSGL_V, "Loading cookie file: %s\n", filename);
>  
> -    fd = open(filename, O_RDONLY);
> +    fd = open(filename, O_RDONLY | O_BINARY);
>      if (fd < 0) {
>  	mp_msg(MSGT_NETWORK, MSGL_V, "Could not open");
>  	goto err_out;

  @all:
  I intent to apply this soon. If anyone has objections,
please speak up now or complain on -cvslog later ;-)

  Alexander

Attachment: pgpkPhP5GMNJ7.pgp
Description: PGP signature

_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng