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
ab7d1772
Commit
ab7d1772
authored
Aug 15, 2007
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Aug 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Support HTTP_QUERY_RAW_HEADER_CRLF|HTTP_QUERY_FLAG_REQUEST_HEADERS.
parent
cf353535
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
7 deletions
+35
-7
http.c
dlls/wininet/http.c
+21
-7
http.c
dlls/wininet/tests/http.c
+14
-0
No files found.
dlls/wininet/http.c
View file @
ab7d1772
...
@@ -1664,19 +1664,33 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
...
@@ -1664,19 +1664,33 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLev
case
HTTP_QUERY_RAW_HEADERS_CRLF
:
case
HTTP_QUERY_RAW_HEADERS_CRLF
:
{
{
DWORD
len
=
strlenW
(
lpwhr
->
lpszRawHeaders
);
LPWSTR
headers
;
DWORD
len
;
BOOL
ret
;
if
(
request_only
)
headers
=
HTTP_BuildHeaderRequestString
(
lpwhr
,
lpwhr
->
lpszVerb
,
lpwhr
->
lpszPath
,
FALSE
);
else
headers
=
lpwhr
->
lpszRawHeaders
;
len
=
strlenW
(
headers
);
if
(
len
+
1
>
*
lpdwBufferLength
/
sizeof
(
WCHAR
))
if
(
len
+
1
>
*
lpdwBufferLength
/
sizeof
(
WCHAR
))
{
{
*
lpdwBufferLength
=
(
len
+
1
)
*
sizeof
(
WCHAR
);
*
lpdwBufferLength
=
(
len
+
1
)
*
sizeof
(
WCHAR
);
INTERNET_SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
INTERNET_SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
ret
=
FALSE
;
}
}
else
memcpy
(
lpBuffer
,
lpwhr
->
lpszRawHeaders
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
{
*
lpdwBufferLength
=
len
*
sizeof
(
WCHAR
);
memcpy
(
lpBuffer
,
headers
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
*
lpdwBufferLength
=
len
*
sizeof
(
WCHAR
);
TRACE
(
"returning data: %s
\n
"
,
debugstr_wn
((
WCHAR
*
)
lpBuffer
,
len
));
TRACE
(
"returning data: %s
\n
"
,
debugstr_wn
((
WCHAR
*
)
lpBuffer
,
len
));
ret
=
TRUE
;
}
return
TRUE
;
if
(
request_only
)
HeapFree
(
GetProcessHeap
(),
0
,
headers
);
return
ret
;
}
}
case
HTTP_QUERY_RAW_HEADERS
:
case
HTTP_QUERY_RAW_HEADERS
:
{
{
...
...
dlls/wininet/tests/http.c
View file @
ab7d1772
...
@@ -983,11 +983,25 @@ static void HttpHeaders_test(void)
...
@@ -983,11 +983,25 @@ static void HttpHeaders_test(void)
buffer
,
&
len
,
&
index
),
"Unable to query header
\n
"
);
buffer
,
&
len
,
&
index
),
"Unable to query header
\n
"
);
ok
(
index
==
1
,
"Index was not incremented
\n
"
);
ok
(
index
==
1
,
"Index was not incremented
\n
"
);
ok
(
strcmp
(
buffer
,
"test1"
)
==
0
,
"incorrect string was returned(%s)
\n
"
,
buffer
);
ok
(
strcmp
(
buffer
,
"test1"
)
==
0
,
"incorrect string was returned(%s)
\n
"
,
buffer
);
ok
(
len
==
5
,
"Invalid length (exp. 5, got %d)
\n
"
,
len
);
ok
(
buffer
[
len
]
==
0
,
"Buffer not NULL-terminated
\n
"
);
/* len show only 5 characters but the buffer is NULL-terminated*/
len
=
sizeof
(
buffer
);
len
=
sizeof
(
buffer
);
strcpy
(
buffer
,
"Warning"
);
strcpy
(
buffer
,
"Warning"
);
ok
(
HttpQueryInfo
(
hRequest
,
HTTP_QUERY_CUSTOM
|
HTTP_QUERY_FLAG_REQUEST_HEADERS
,
ok
(
HttpQueryInfo
(
hRequest
,
HTTP_QUERY_CUSTOM
|
HTTP_QUERY_FLAG_REQUEST_HEADERS
,
buffer
,
&
len
,
&
index
)
==
0
,
"Second Index Should Not Exist
\n
"
);
buffer
,
&
len
,
&
index
)
==
0
,
"Second Index Should Not Exist
\n
"
);
/* a working query */
index
=
0
;
len
=
sizeof
(
buffer
);
ok
(
HttpQueryInfo
(
hRequest
,
HTTP_QUERY_RAW_HEADERS_CRLF
|
HTTP_QUERY_FLAG_REQUEST_HEADERS
,
buffer
,
&
len
,
&
index
),
"Unable to query header
\n
"
);
/* what's in the middle differs between Wine and Windows so currently we check only the beginning and the end */
ok
(
strncmp
(
buffer
,
"POST /posttest.php HTTP/1"
,
25
)
==
0
,
"Invalid beginning of headers string
\n
"
);
ok
(
strcmp
(
buffer
+
strlen
(
buffer
)
-
4
,
"
\r\n\r\n
"
)
==
0
,
"Invalid end of headers string
\n
"
);
ok
(
index
==
0
,
"Index was incremented
\n
"
);
ok
(
HttpAddRequestHeaders
(
hRequest
,
"Warning:test2"
,
-
1
,
HTTP_ADDREQ_FLAG_ADD
),
ok
(
HttpAddRequestHeaders
(
hRequest
,
"Warning:test2"
,
-
1
,
HTTP_ADDREQ_FLAG_ADD
),
"Failed to add duplicate header using HTTP_ADDREQ_FLAG_ADD
\n
"
);
"Failed to add duplicate header using HTTP_ADDREQ_FLAG_ADD
\n
"
);
...
...
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