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
9d23d8ec
Commit
9d23d8ec
authored
Jul 02, 2008
by
Alexander Morozov
Committed by
Alexandre Julliard
Jul 03, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet/tests: Additional HTTP header tests.
parent
2b4dcb25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
2 deletions
+54
-2
http.c
dlls/wininet/tests/http.c
+54
-2
No files found.
dlls/wininet/tests/http.c
View file @
9d23d8ec
...
...
@@ -1346,6 +1346,7 @@ static DWORD CALLBACK server_thread(LPVOID param)
char
buffer
[
0x100
];
WSADATA
wsaData
;
int
last_request
=
0
;
char
host_header
[
22
];
WSAStartup
(
MAKEWORD
(
1
,
1
),
&
wsaData
);
...
...
@@ -1369,6 +1370,8 @@ static DWORD CALLBACK server_thread(LPVOID param)
SetEvent
(
si
->
hEvent
);
sprintf
(
host_header
,
"Host: localhost:%d"
,
si
->
port
);
do
{
c
=
accept
(
s
,
NULL
,
NULL
);
...
...
@@ -1448,7 +1451,10 @@ static DWORD CALLBACK server_thread(LPVOID param)
if
(
strstr
(
buffer
,
"/test8"
))
{
if
(
!
strstr
(
buffer
,
"Connection: Close"
)
&&
strstr
(
buffer
,
"Connection: Keep-Alive"
))
strstr
(
buffer
,
"Connection: Keep-Alive"
)
&&
!
strstr
(
buffer
,
"Cache-Control: no-cache"
)
&&
!
strstr
(
buffer
,
"Pragma: no-cache"
)
&&
strstr
(
buffer
,
host_header
))
send
(
c
,
okmsg
,
sizeof
okmsg
-
1
,
0
);
else
send
(
c
,
notokmsg
,
sizeof
notokmsg
-
1
,
0
);
...
...
@@ -1456,7 +1462,21 @@ static DWORD CALLBACK server_thread(LPVOID param)
if
(
strstr
(
buffer
,
"/test9"
))
{
if
(
!
strstr
(
buffer
,
"Connection: Close"
)
&&
!
strstr
(
buffer
,
"Connection: Keep-Alive"
))
!
strstr
(
buffer
,
"Connection: Keep-Alive"
)
&&
!
strstr
(
buffer
,
"Cache-Control: no-cache"
)
&&
!
strstr
(
buffer
,
"Pragma: no-cache"
)
&&
strstr
(
buffer
,
host_header
))
send
(
c
,
okmsg
,
sizeof
okmsg
-
1
,
0
);
else
send
(
c
,
notokmsg
,
sizeof
notokmsg
-
1
,
0
);
}
if
(
strstr
(
buffer
,
"/testA"
))
{
if
(
!
strstr
(
buffer
,
"Connection: Close"
)
&&
!
strstr
(
buffer
,
"Connection: Keep-Alive"
)
&&
(
strstr
(
buffer
,
"Cache-Control: no-cache"
)
||
strstr
(
buffer
,
"Pragma: no-cache"
))
&&
strstr
(
buffer
,
host_header
))
send
(
c
,
okmsg
,
sizeof
okmsg
-
1
,
0
);
else
send
(
c
,
notokmsg
,
sizeof
notokmsg
-
1
,
0
);
...
...
@@ -1706,6 +1726,7 @@ static void test_connection_header(int port)
size
=
sizeof
(
status
);
ret
=
HttpQueryInfo
(
req
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"HttpQueryInfo failed
\n
"
);
todo_wine
ok
(
status
==
200
,
"request failed with status %u
\n
"
,
status
);
InternetCloseHandle
(
req
);
...
...
@@ -1720,6 +1741,37 @@ static void test_connection_header(int port)
size
=
sizeof
(
status
);
ret
=
HttpQueryInfo
(
req
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"HttpQueryInfo failed
\n
"
);
todo_wine
ok
(
status
==
200
,
"request failed with status %u
\n
"
,
status
);
InternetCloseHandle
(
req
);
req
=
HttpOpenRequest
(
con
,
NULL
,
"/test9"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_NO_CACHE_WRITE
,
0
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
ret
=
HttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
status
=
0
;
size
=
sizeof
(
status
);
ret
=
HttpQueryInfo
(
req
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"HttpQueryInfo failed
\n
"
);
todo_wine
ok
(
status
==
200
,
"request failed with status %u
\n
"
,
status
);
InternetCloseHandle
(
req
);
req
=
HttpOpenRequest
(
con
,
"POST"
,
"/testA"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_NO_CACHE_WRITE
,
0
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
ret
=
HttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
);
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
status
=
0
;
size
=
sizeof
(
status
);
ret
=
HttpQueryInfo
(
req
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"HttpQueryInfo failed
\n
"
);
todo_wine
ok
(
status
==
200
,
"request failed with status %u
\n
"
,
status
);
InternetCloseHandle
(
req
);
...
...
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