[MPlayer-dev-eng] [PATCH] fix parsing cookies on win32
Alexander Strasser
eclipse7 at gmx.net
Thu Mar 26 23:43:14 CET 2015
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20150326/cd9822dc/attachment.asc>
More information about the MPlayer-dev-eng
mailing list