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
a9ecdc60
Commit
a9ecdc60
authored
Dec 03, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Directly return error status from HTTP_HandleRedirect.
parent
741b6611
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
22 deletions
+13
-22
http.c
dlls/wininet/http.c
+13
-22
No files found.
dlls/wininet/http.c
View file @
a9ecdc60
...
...
@@ -208,7 +208,6 @@ static BOOL HTTP_DeleteCustomHeader(http_request_t *req, DWORD index);
static
LPWSTR
HTTP_build_req
(
LPCWSTR
*
list
,
int
len
);
static
BOOL
HTTP_HttpQueryInfoW
(
http_request_t
*
,
DWORD
,
LPVOID
,
LPDWORD
,
LPDWORD
);
static
LPWSTR
HTTP_GetRedirectURL
(
http_request_t
*
req
,
LPCWSTR
lpszUrl
);
static
BOOL
HTTP_HandleRedirect
(
http_request_t
*
req
,
LPCWSTR
lpszUrl
);
static
UINT
HTTP_DecodeBase64
(
LPCWSTR
base64
,
LPSTR
bin
);
static
BOOL
HTTP_VerifyValidHeader
(
http_request_t
*
req
,
LPCWSTR
field
);
static
void
HTTP_DrainContent
(
http_request_t
*
req
);
...
...
@@ -3132,7 +3131,7 @@ static LPWSTR HTTP_GetRedirectURL(http_request_t *lpwhr, LPCWSTR lpszUrl)
/***********************************************************************
* HTTP_HandleRedirect (internal)
*/
static
BOOL
HTTP_HandleRedirect
(
http_request_t
*
lpwhr
,
LPCWSTR
lpszUrl
)
static
DWORD
HTTP_HandleRedirect
(
http_request_t
*
lpwhr
,
LPCWSTR
lpszUrl
)
{
http_session_t
*
lpwhs
=
lpwhr
->
lpHttpSession
;
appinfo_t
*
hIC
=
lpwhs
->
lpAppInfo
;
...
...
@@ -3170,7 +3169,7 @@ static BOOL HTTP_HandleRedirect(http_request_t *lpwhr, LPCWSTR lpszUrl)
urlComponents
.
lpszExtraInfo
=
NULL
;
urlComponents
.
dwExtraInfoLength
=
0
;
if
(
!
InternetCrackUrlW
(
lpszUrl
,
strlenW
(
lpszUrl
),
0
,
&
urlComponents
))
return
FALSE
;
return
INTERNET_GetLastError
()
;
if
(
!
strncmpW
(
szHttp
,
urlComponents
.
lpszScheme
,
strlenW
(
szHttp
))
&&
(
lpwhr
->
hdr
.
dwFlags
&
INTERNET_FLAG_SECURE
))
...
...
@@ -3244,15 +3243,13 @@ static BOOL HTTP_HandleRedirect(http_request_t *lpwhr, LPCWSTR lpszUrl)
lpwhs
->
nServerPort
=
urlComponents
.
nPort
;
NETCON_close
(
&
lpwhr
->
netConnection
);
if
((
res
=
HTTP_ResolveName
(
lpwhr
))
!=
ERROR_SUCCESS
)
{
INTERNET_SetLastError
(
res
);
return
FALSE
;
}
if
((
res
=
HTTP_ResolveName
(
lpwhr
))
!=
ERROR_SUCCESS
)
return
res
;
res
=
NETCON_init
(
&
lpwhr
->
netConnection
,
lpwhr
->
hdr
.
dwFlags
&
INTERNET_FLAG_SECURE
);
if
(
res
!=
ERROR_SUCCESS
)
{
INTERNET_SetLastError
(
res
);
return
FALSE
;
}
if
(
res
!=
ERROR_SUCCESS
)
return
res
;
lpwhr
->
read_pos
=
lpwhr
->
read_size
=
0
;
lpwhr
->
read_chunked
=
FALSE
;
}
...
...
@@ -3289,7 +3286,7 @@ static BOOL HTTP_HandleRedirect(http_request_t *lpwhr, LPCWSTR lpszUrl)
if
(
0
<=
index
)
HTTP_DeleteCustomHeader
(
lpwhr
,
index
);
return
TRUE
;
return
ERROR_SUCCESS
;
}
/***********************************************************************
...
...
@@ -3571,16 +3568,13 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders,
HTTP_DrainContent
(
lpwhr
);
if
((
new_url
=
HTTP_GetRedirectURL
(
lpwhr
,
szNewLocation
)))
{
BOOL
bSuccess
;
INTERNET_SendCallback
(
&
lpwhr
->
hdr
,
lpwhr
->
hdr
.
dwContext
,
INTERNET_STATUS_REDIRECT
,
new_url
,
(
strlenW
(
new_url
)
+
1
)
*
sizeof
(
WCHAR
));
bSucces
s
=
HTTP_HandleRedirect
(
lpwhr
,
new_url
);
if
(
bSuccess
)
re
s
=
HTTP_HandleRedirect
(
lpwhr
,
new_url
);
if
(
res
==
ERROR_SUCCESS
)
{
HeapFree
(
GetProcessHeap
(),
0
,
requestString
);
loop_next
=
TRUE
;
}
else
{
res
=
INTERNET_GetLastError
();
}
HeapFree
(
GetProcessHeap
(),
0
,
new_url
);
}
...
...
@@ -3741,14 +3735,11 @@ static DWORD HTTP_HttpEndRequestW(http_request_t *lpwhr, DWORD dwFlags, DWORD_PT
HTTP_DrainContent
(
lpwhr
);
if
((
new_url
=
HTTP_GetRedirectURL
(
lpwhr
,
szNewLocation
)))
{
BOOL
rc
;
INTERNET_SendCallback
(
&
lpwhr
->
hdr
,
lpwhr
->
hdr
.
dwContext
,
INTERNET_STATUS_REDIRECT
,
new_url
,
(
strlenW
(
new_url
)
+
1
)
*
sizeof
(
WCHAR
));
r
c
=
HTTP_HandleRedirect
(
lpwhr
,
new_url
);
if
(
r
c
)
r
es
=
HTTP_HandleRedirect
(
lpwhr
,
new_url
);
if
(
r
es
==
ERROR_SUCCESS
)
res
=
HTTP_HttpSendRequestW
(
lpwhr
,
NULL
,
0
,
NULL
,
0
,
0
,
TRUE
);
else
res
=
INTERNET_GetLastError
();
HeapFree
(
GetProcessHeap
(),
0
,
new_url
);
}
}
...
...
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