winhttp: Store cookies in reverse order.

This matches more recent versions of Windows.
This commit is contained in:
Hans Leidekker 2015-06-24 14:18:27 +02:00 committed by Alexandre Julliard
parent 3c5cb7f8dc
commit b9557e9227
2 changed files with 9 additions and 5 deletions

View File

@ -121,7 +121,7 @@ static BOOL add_cookie( session_t *session, cookie_t *cookie, WCHAR *domain_name
else if ((old_cookie = find_cookie( domain, path, cookie->name ))) delete_cookie( old_cookie ); else if ((old_cookie = find_cookie( domain, path, cookie->name ))) delete_cookie( old_cookie );
cookie->path = strdupW( path ); cookie->path = strdupW( path );
list_add_tail( &domain->cookies, &cookie->entry ); list_add_head( &domain->cookies, &cookie->entry );
TRACE("domain %s path %s <- %s=%s\n", debugstr_w(domain_name), debugstr_w(cookie->path), TRACE("domain %s path %s <- %s=%s\n", debugstr_w(domain_name), debugstr_w(cookie->path),
debugstr_w(cookie->name), debugstr_w(cookie->value)); debugstr_w(cookie->name), debugstr_w(cookie->value));

View File

@ -2018,14 +2018,18 @@ static DWORD CALLBACK server_thread(LPVOID param)
if (strstr(buffer, "GET /cookie3")) if (strstr(buffer, "GET /cookie3"))
{ {
if (strstr(buffer, "Cookie: name=value2; NAME=value; name=value\r\n") || if (strstr(buffer, "Cookie: name=value2; NAME=value; name=value\r\n") ||
strstr(buffer, "Cookie: name=value2; name=value; NAME=value\r\n")) send(c, okmsg, sizeof(okmsg) - 1, 0); broken(strstr(buffer, "Cookie: name=value2; name=value; NAME=value\r\n") != NULL))
else send(c, notokmsg, sizeof(notokmsg) - 1, 0); send(c, okmsg, sizeof(okmsg) - 1, 0);
else
send(c, notokmsg, sizeof(notokmsg) - 1, 0);
} }
if (strstr(buffer, "GET /cookie2")) if (strstr(buffer, "GET /cookie2"))
{ {
if (strstr(buffer, "Cookie: NAME=value; name=value\r\n") || if (strstr(buffer, "Cookie: NAME=value; name=value\r\n") ||
strstr(buffer, "Cookie: name=value; NAME=value\r\n")) send(c, okmsg, sizeof(okmsg) - 1, 0); broken(strstr(buffer, "Cookie: name=value; NAME=value\r\n") != NULL))
else send(c, notokmsg, sizeof(notokmsg) - 1, 0); send(c, okmsg, sizeof(okmsg) - 1, 0);
else
send(c, notokmsg, sizeof(notokmsg) - 1, 0);
} }
else if (strstr(buffer, "GET /cookie")) else if (strstr(buffer, "GET /cookie"))
{ {