Wininet set_cookie must handle not only <name>=<value> but also <name> = <value>

Bruno Jesus 00cpxxx at gmail.com
Thu Jul 21 22:53:51 CDT 2011


Hello, while running uTorrent 3 I see the following fixme several times:

fixme:wininet:set_cookie Unknown additional option L"expires =
Sat,23-Jul-2011 02:20:13 GMT"

After searching the source code I realized the expires parameter is
already implemented but wine finds the entry names only if there's no
space between the parameter name and the equal sign, here is a small
piece of wininet.c around line 440 and 470.

...
static const WCHAR szExpires[] = {'e','x','p','i','r','e','s','=',0}
...
else if (strncmpiW(ptr, szExpires, 8) == 0)
...

After searching msdn I found this article with an example that uses spaces:
http://msdn.microsoft.com/en-us/library/aa385326%28v=vs.85%29.aspx

bReturn = InternetSetCookie(TEXT("http://www.adventure_works.com"), NULL,
           TEXT("TestData = Test; expires = Sat,01-Jan-2000 00:00:00 GMT"));

Looks like the cookie above is valid. I also found this other article
telling about the data format:
http://msdn.microsoft.com/en-us/library/aa384321%28v=vs.85%29.aspx

After reading parts of the cookies RFC I found this note:
http://www.ietf.org/rfc/rfc2109.txt

...
   NOTE: The syntax above allows whitespace between the attribute and
   the = sign.
...

The newer version of the cookie rfc has the very same note:
http://www.ietf.org/rfc/rfc2965.txt

Please, don't bother to answer if this was already noted and is to be
fixed. Also sorry for not pointing a solution. I'll study more on this
later but I can say in advance that windows xp sets the cookie
correctly when there is the space. I guess I'll start by adding tests
for this on the file tests/internet.c

Best wishes,
Bruno

-- 
universe* god::bigbang (void); //and then it all began...



More information about the wine-devel mailing list