Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
bddcb1b8
Commit
bddcb1b8
authored
Sep 11, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Preserve cookies on redirects.
parent
5d3b4a60
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
request.c
dlls/winhttp/request.c
+21
-6
No files found.
dlls/winhttp/request.c
View file @
bddcb1b8
...
...
@@ -940,7 +940,7 @@ static void clear_response_headers( request_t *request )
#define MAX_REPLY_LEN 1460
#define INITIAL_HEADER_BUFFER_LEN 512
static
BOOL
read_reply
(
request_t
*
request
,
BOOL
clear
)
static
BOOL
read_reply
(
request_t
*
request
)
{
static
const
WCHAR
crlf
[]
=
{
'\r'
,
'\n'
,
0
};
...
...
@@ -952,9 +952,6 @@ static BOOL read_reply( request_t *request, BOOL clear )
if
(
!
netconn_connected
(
&
request
->
netconn
))
return
FALSE
;
/* clear old response headers (eg. from a redirect response) */
if
(
clear
)
clear_response_headers
(
request
);
send_callback
(
&
request
->
hdr
,
WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE
,
NULL
,
0
);
received_len
=
0
;
...
...
@@ -1184,7 +1181,7 @@ static BOOL receive_data_chunked( request_t *request, void *buffer, DWORD size,
if
(
!
(
request
->
content_length
=
get_chunk_size
(
reply
)))
{
/* zero sized chunk marks end of transfer; read any trailing headers and return */
read_reply
(
request
,
FALSE
);
read_reply
(
request
);
break
;
}
}
...
...
@@ -1267,6 +1264,20 @@ static void drain_content( request_t *request )
}
}
/* copy cookies from response headers to request headers */
static
void
add_cookies
(
request_t
*
request
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
request
->
num_headers
;
i
++
)
{
if
(
!
strcmpiW
(
request
->
headers
[
i
].
field
,
attr_set_cookie
)
&&
!
request
->
headers
[
i
].
is_request
)
{
process_header
(
request
,
attr_cookie
,
request
->
headers
[
i
].
value
,
WINHTTP_ADDREQ_FLAG_ADD
,
TRUE
);
}
}
}
static
BOOL
receive_response
(
request_t
*
request
,
BOOL
async
)
{
BOOL
ret
;
...
...
@@ -1274,7 +1285,7 @@ static BOOL receive_response( request_t *request, BOOL async )
for
(;;)
{
if
(
!
(
ret
=
read_reply
(
request
,
TRUE
)))
break
;
if
(
!
(
ret
=
read_reply
(
request
)))
break
;
size
=
sizeof
(
DWORD
);
query
=
WINHTTP_QUERY_STATUS_CODE
|
WINHTTP_QUERY_FLAG_NUMBER
;
...
...
@@ -1289,7 +1300,11 @@ static BOOL receive_response( request_t *request, BOOL async )
{
if
(
request
->
hdr
.
disable_flags
&
WINHTTP_DISABLE_REDIRECTS
)
break
;
drain_content
(
request
);
if
(
!
(
ret
=
handle_redirect
(
request
)))
break
;
if
(
!
(
request
->
hdr
.
disable_flags
&
WINHTTP_DISABLE_COOKIES
))
add_cookies
(
request
);
clear_response_headers
(
request
);
ret
=
send_request
(
request
,
NULL
,
0
,
NULL
,
0
,
0
,
0
,
FALSE
);
/* recurse synchronously */
continue
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment