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
3ac31945
Commit
3ac31945
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: Add HTTP 1.1 test.
parent
9d23d8ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
http.c
dlls/wininet/tests/http.c
+41
-0
No files found.
dlls/wininet/tests/http.c
View file @
3ac31945
...
@@ -1347,6 +1347,7 @@ static DWORD CALLBACK server_thread(LPVOID param)
...
@@ -1347,6 +1347,7 @@ static DWORD CALLBACK server_thread(LPVOID param)
WSADATA
wsaData
;
WSADATA
wsaData
;
int
last_request
=
0
;
int
last_request
=
0
;
char
host_header
[
22
];
char
host_header
[
22
];
static
int
test_b
=
0
;
WSAStartup
(
MAKEWORD
(
1
,
1
),
&
wsaData
);
WSAStartup
(
MAKEWORD
(
1
,
1
),
&
wsaData
);
...
@@ -1481,6 +1482,13 @@ static DWORD CALLBACK server_thread(LPVOID param)
...
@@ -1481,6 +1482,13 @@ static DWORD CALLBACK server_thread(LPVOID param)
else
else
send
(
c
,
notokmsg
,
sizeof
notokmsg
-
1
,
0
);
send
(
c
,
notokmsg
,
sizeof
notokmsg
-
1
,
0
);
}
}
if
(
!
test_b
&&
strstr
(
buffer
,
"/testB HTTP/1.1"
))
{
test_b
=
1
;
send
(
c
,
okmsg
,
sizeof
okmsg
-
1
,
0
);
recvfrom
(
c
,
buffer
,
sizeof
buffer
,
0
,
NULL
,
NULL
);
send
(
c
,
okmsg
,
sizeof
okmsg
-
1
,
0
);
}
if
(
strstr
(
buffer
,
"GET /quit"
))
if
(
strstr
(
buffer
,
"GET /quit"
))
{
{
send
(
c
,
okmsg
,
sizeof
okmsg
-
1
,
0
);
send
(
c
,
okmsg
,
sizeof
okmsg
-
1
,
0
);
...
@@ -1779,6 +1787,38 @@ static void test_connection_header(int port)
...
@@ -1779,6 +1787,38 @@ static void test_connection_header(int port)
InternetCloseHandle
(
ses
);
InternetCloseHandle
(
ses
);
}
}
static
void
test_http1_1
(
int
port
)
{
HINTERNET
ses
,
con
,
req
;
BOOL
ret
;
ses
=
InternetOpen
(
"winetest"
,
INTERNET_OPEN_TYPE_DIRECT
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"InternetOpen failed
\n
"
);
con
=
InternetConnect
(
ses
,
"localhost"
,
port
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0
,
0
);
ok
(
con
!=
NULL
,
"InternetConnect failed
\n
"
);
req
=
HttpOpenRequest
(
con
,
NULL
,
"/testB"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
ret
=
HttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
);
if
(
ret
)
{
InternetCloseHandle
(
req
);
req
=
HttpOpenRequest
(
con
,
NULL
,
"/testB"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
ok
(
req
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
ret
=
HttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
);
todo_wine
ok
(
ret
,
"HttpSendRequest failed
\n
"
);
}
InternetCloseHandle
(
req
);
InternetCloseHandle
(
con
);
InternetCloseHandle
(
ses
);
}
static
void
test_http_connection
(
void
)
static
void
test_http_connection
(
void
)
{
{
struct
server_info
si
;
struct
server_info
si
;
...
@@ -1803,6 +1843,7 @@ static void test_http_connection(void)
...
@@ -1803,6 +1843,7 @@ static void test_http_connection(void)
test_basic_request
(
si
.
port
,
"POST"
,
"/test5"
);
test_basic_request
(
si
.
port
,
"POST"
,
"/test5"
);
test_basic_request
(
si
.
port
,
"GET"
,
"/test6"
);
test_basic_request
(
si
.
port
,
"GET"
,
"/test6"
);
test_connection_header
(
si
.
port
);
test_connection_header
(
si
.
port
);
test_http1_1
(
si
.
port
);
/* send the basic request again to shutdown the server thread */
/* send the basic request again to shutdown the server thread */
test_basic_request
(
si
.
port
,
"GET"
,
"/quit"
);
test_basic_request
(
si
.
port
,
"GET"
,
"/quit"
);
...
...
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