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
26b59bf8
Commit
26b59bf8
authored
Apr 17, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet/tests: Add tests for a prematurely closed connection.
parent
27a1a9a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
http.c
dlls/wininet/tests/http.c
+29
-0
No files found.
dlls/wininet/tests/http.c
View file @
26b59bf8
...
@@ -2029,6 +2029,8 @@ static DWORD CALLBACK server_thread(LPVOID param)
...
@@ -2029,6 +2029,8 @@ static DWORD CALLBACK server_thread(LPVOID param)
static
const
char
no_cache_response
[]
=
"HTTP/1.1 200 OK
\r\n
Cache-Control: No-StOrE
\r\n\r\n
some content"
;
static
const
char
no_cache_response
[]
=
"HTTP/1.1 200 OK
\r\n
Cache-Control: No-StOrE
\r\n\r\n
some content"
;
send
(
c
,
no_cache_response
,
sizeof
(
no_cache_response
)
-
1
,
0
);
send
(
c
,
no_cache_response
,
sizeof
(
no_cache_response
)
-
1
,
0
);
}
}
if
(
strstr
(
buffer
,
"GET /test_premature_disconnect"
))
trace
(
"closing connection
\n
"
);
shutdown
(
c
,
2
);
shutdown
(
c
,
2
);
closesocket
(
c
);
closesocket
(
c
);
...
@@ -2660,6 +2662,32 @@ static void test_basic_authentication(int port)
...
@@ -2660,6 +2662,32 @@ static void test_basic_authentication(int port)
InternetCloseHandle
(
session
);
InternetCloseHandle
(
session
);
}
}
static
void
test_premature_disconnect
(
int
port
)
{
HINTERNET
session
,
connect
,
request
;
DWORD
err
;
BOOL
ret
;
session
=
InternetOpen
(
"winetest"
,
INTERNET_OPEN_TYPE_DIRECT
,
NULL
,
NULL
,
0
);
ok
(
session
!=
NULL
,
"InternetOpen failed
\n
"
);
connect
=
InternetConnect
(
session
,
"localhost"
,
port
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0
,
0
);
ok
(
connect
!=
NULL
,
"InternetConnect failed
\n
"
);
request
=
HttpOpenRequest
(
connect
,
NULL
,
"/premature_disconnect"
,
NULL
,
NULL
,
NULL
,
INTERNET_FLAG_KEEP_CONNECTION
,
0
);
ok
(
request
!=
NULL
,
"HttpOpenRequest failed
\n
"
);
SetLastError
(
0xdeadbeef
);
ret
=
HttpSendRequest
(
request
,
NULL
,
0
,
NULL
,
0
);
err
=
GetLastError
();
todo_wine
ok
(
!
ret
,
"HttpSendRequest succeeded
\n
"
);
todo_wine
ok
(
err
==
ERROR_HTTP_INVALID_SERVER_RESPONSE
,
"got %u
\n
"
,
err
);
InternetCloseHandle
(
request
);
InternetCloseHandle
(
connect
);
InternetCloseHandle
(
session
);
}
static
void
test_invalid_response_headers
(
int
port
)
static
void
test_invalid_response_headers
(
int
port
)
{
{
HINTERNET
session
,
connect
,
request
;
HINTERNET
session
,
connect
,
request
;
...
@@ -3032,6 +3060,7 @@ static void test_http_connection(void)
...
@@ -3032,6 +3060,7 @@ static void test_http_connection(void)
test_no_content
(
si
.
port
);
test_no_content
(
si
.
port
);
test_conn_close
(
si
.
port
);
test_conn_close
(
si
.
port
);
test_no_cache
(
si
.
port
);
test_no_cache
(
si
.
port
);
test_premature_disconnect
(
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