Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e56cb72c
Commit
e56cb72c
authored
Mar 05, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Add a helper to retrieve the redirect URL.
parent
58e7d39c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
request.c
dlls/winhttp/request.c
+19
-8
No files found.
dlls/winhttp/request.c
View file @
e56cb72c
...
...
@@ -1574,28 +1574,39 @@ end:
return
TRUE
;
}
static
WCHAR
*
get_redirect_url
(
request_t
*
request
,
DWORD
*
len
)
{
DWORD
size
;
WCHAR
*
ret
;
query_headers
(
request
,
WINHTTP_QUERY_LOCATION
,
NULL
,
NULL
,
&
size
,
NULL
);
if
(
get_last_error
()
!=
ERROR_INSUFFICIENT_BUFFER
)
return
FALSE
;
if
(
!
(
ret
=
heap_alloc
(
size
)))
return
NULL
;
*
len
=
size
/
sizeof
(
WCHAR
);
if
(
query_headers
(
request
,
WINHTTP_QUERY_LOCATION
,
NULL
,
ret
,
&
size
,
NULL
))
return
ret
;
heap_free
(
ret
);
return
NULL
;
}
static
BOOL
handle_redirect
(
request_t
*
request
,
DWORD
status
)
{
BOOL
ret
=
FALSE
;
DWORD
size
,
len
;
DWORD
len
;
URL_COMPONENTS
uc
;
connect_t
*
connect
=
request
->
connect
;
INTERNET_PORT
port
;
WCHAR
*
hostname
=
NULL
,
*
location
=
NULL
;
WCHAR
*
hostname
=
NULL
,
*
location
;
int
index
;
size
=
0
;
query_headers
(
request
,
WINHTTP_QUERY_LOCATION
,
NULL
,
NULL
,
&
size
,
NULL
);
if
(
!
(
location
=
heap_alloc
(
size
)))
return
FALSE
;
if
(
!
query_headers
(
request
,
WINHTTP_QUERY_LOCATION
,
NULL
,
location
,
&
size
,
NULL
))
goto
end
;
if
(
!
(
location
=
get_redirect_url
(
request
,
&
len
)))
return
FALSE
;
send_callback
(
&
request
->
hdr
,
WINHTTP_CALLBACK_STATUS_REDIRECT
,
location
,
size
/
sizeof
(
WCHAR
)
+
1
);
send_callback
(
&
request
->
hdr
,
WINHTTP_CALLBACK_STATUS_REDIRECT
,
location
,
len
+
1
);
memset
(
&
uc
,
0
,
sizeof
(
uc
)
);
uc
.
dwStructSize
=
sizeof
(
uc
);
uc
.
dwSchemeLength
=
uc
.
dwHostNameLength
=
uc
.
dwUrlPathLength
=
uc
.
dwExtraInfoLength
=
~
0u
;
if
(
!
WinHttpCrackUrl
(
location
,
size
/
sizeof
(
WCHAR
)
,
0
,
&
uc
))
/* assume relative redirect */
if
(
!
WinHttpCrackUrl
(
location
,
len
,
0
,
&
uc
))
/* assume relative redirect */
{
WCHAR
*
path
,
*
p
;
...
...
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