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
ae300883
Commit
ae300883
authored
Mar 30, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 30, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WININET: Clean up HttpQueryInfo.
Fixes another return FALSE without SetLastError.
parent
2571fa00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
49 deletions
+27
-49
http.c
dlls/wininet/http.c
+27
-49
No files found.
dlls/wininet/http.c
View file @
ae300883
...
...
@@ -1291,28 +1291,18 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
LPHTTPHEADERW
lphttpHdr
=
NULL
;
BOOL
bSuccess
=
FALSE
;
BOOL
request_only
=
dwInfoLevel
&
HTTP_QUERY_FLAG_REQUEST_HEADERS
;
INT
requested_index
=
lpdwIndex
?
*
lpdwIndex
:
0
;
INT
level
=
(
dwInfoLevel
&
~
HTTP_QUERY_MODIFIER_FLAGS_MASK
);
INT
index
=
-
1
;
/* Find requested header structure */
if
((
dwInfoLevel
&
~
HTTP_QUERY_MODIFIER_FLAGS_MASK
)
==
HTTP_QUERY_CUSTOM
)
switch
(
level
)
{
INT
requested_index
=
(
lpdwIndex
)
?
(
*
lpdwIndex
)
:
0
;
INT
index
=
HTTP_GetCustomHeaderIndex
(
lpwhr
,
(
LPWSTR
)
lpBuffer
,
requested_index
,
request_only
)
;
case
HTTP_QUERY_CUSTOM
:
index
=
HTTP_GetCustomHeaderIndex
(
lpwhr
,
lpBuffer
,
requested_index
,
request_only
);
break
;
if
(
index
<
0
)
return
bSuccess
;
else
lphttpHdr
=
&
lpwhr
->
pCustHeaders
[
index
];
if
(
lpdwIndex
)
(
*
lpdwIndex
)
++
;
}
else
{
INT
index
=
dwInfoLevel
&
~
HTTP_QUERY_MODIFIER_FLAGS_MASK
;
if
(
index
==
HTTP_QUERY_RAW_HEADERS_CRLF
)
case
HTTP_QUERY_RAW_HEADERS_CRLF
:
{
DWORD
len
=
strlenW
(
lpwhr
->
lpszRawHeaders
);
if
(
len
+
1
>
*
lpdwBufferLength
/
sizeof
(
WCHAR
))
...
...
@@ -1328,7 +1318,7 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
return
TRUE
;
}
else
if
(
index
==
HTTP_QUERY_RAW_HEADERS
)
case
HTTP_QUERY_RAW_HEADERS
:
{
static
const
WCHAR
szCrLf
[]
=
{
'\r'
,
'\n'
,
0
};
LPWSTR
*
ppszRawHeaderLines
=
HTTP_Tokenize
(
lpwhr
->
lpszRawHeaders
,
szCrLf
);
...
...
@@ -1361,7 +1351,7 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
return
TRUE
;
}
else
if
(
index
==
HTTP_QUERY_STATUS_TEXT
)
case
HTTP_QUERY_STATUS_TEXT
:
{
DWORD
len
=
strlenW
(
lpwhr
->
lpszStatusText
);
if
(
len
+
1
>
*
lpdwBufferLength
/
sizeof
(
WCHAR
))
...
...
@@ -1377,7 +1367,7 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
return
TRUE
;
}
else
if
(
index
==
HTTP_QUERY_VERSION
)
case
HTTP_QUERY_VERSION
:
{
DWORD
len
=
strlenW
(
lpwhr
->
lpszVersion
);
if
(
len
+
1
>
*
lpdwBufferLength
/
sizeof
(
WCHAR
))
...
...
@@ -1393,50 +1383,38 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
return
TRUE
;
}
else
if
(
index
>=
0
&&
index
<=
HTTP_QUERY_MAX
)
{
default:
if
(
level
>=
0
&&
level
<=
HTTP_QUERY_MAX
)
{
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
SORTED_STANDARD_HEADERS
)
/
sizeof
(
std_hdr_data
)
;
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
SORTED_STANDARD_HEADERS
)
/
sizeof
(
std_hdr_data
)
;
i
++
)
{
if
(
SORTED_STANDARD_HEADERS
[
i
].
hdrIndex
==
index
)
if
(
SORTED_STANDARD_HEADERS
[
i
].
hdrIndex
==
level
)
{
INT
requested_index
=
(
lpdwIndex
)
?
(
*
lpdwIndex
)
:
0
;
INT
index
=
HTTP_GetCustomHeaderIndex
(
lpwhr
,
index
=
HTTP_GetCustomHeaderIndex
(
lpwhr
,
(
LPWSTR
)
SORTED_STANDARD_HEADERS
[
i
].
hdrStr
,
requested_index
,
request_only
);
if
(
index
<
0
)
break
;
lphttpHdr
=
&
lpwhr
->
pCustHeaders
[
index
];
if
(
lpdwIndex
)
(
*
lpdwIndex
)
++
;
break
;
}
}
if
(
!
lphttpHdr
)
{
SetLastError
(
ERROR_HTTP_HEADER_NOT_FOUND
);
return
bSuccess
;
}
}
else
{
SetLastError
(
ERROR_HTTP_HEADER_NOT_FOUND
);
return
bSuccess
;
}
}
if
(
index
>=
0
)
lphttpHdr
=
&
lpwhr
->
pCustHeaders
[
index
];
/* Ensure header satisifies requested attributes */
if
((
dwInfoLevel
&
HTTP_QUERY_FLAG_REQUEST_HEADERS
)
&&
(
~
lphttpHdr
->
wFlags
&
HDR_ISREQUEST
))
if
(
!
lphttpHdr
||
((
dwInfoLevel
&
HTTP_QUERY_FLAG_REQUEST_HEADERS
)
&&
(
~
lphttpHdr
->
wFlags
&
HDR_ISREQUEST
)))
{
SetLastError
(
ERROR_HTTP_HEADER_NOT_FOUND
);
return
bSuccess
;
return
bSuccess
;
}
if
(
lpdwIndex
)
(
*
lpdwIndex
)
++
;
/* coalesce value to reuqested type */
if
(
dwInfoLevel
&
HTTP_QUERY_FLAG_NUMBER
)
{
...
...
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