Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
93366514
Commit
93366514
authored
Jun 22, 2020
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Don't close child handles on release.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
449b8c7e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
24 deletions
+25
-24
handle.c
dlls/winhttp/handle.c
+2
-12
request.c
dlls/winhttp/request.c
+0
-2
session.c
dlls/winhttp/session.c
+0
-5
winhttp.c
dlls/winhttp/tests/winhttp.c
+23
-4
winhttp_private.h
dlls/winhttp/winhttp_private.h
+0
-1
No files found.
dlls/winhttp/handle.c
View file @
93366514
...
...
@@ -79,7 +79,6 @@ void release_object( struct object_header *hdr )
send_callback
(
hdr
,
WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING
,
&
hdr
->
handle
,
sizeof
(
HINTERNET
)
);
TRACE
(
"destroying object %p
\n
"
,
hdr
);
if
(
hdr
->
type
!=
WINHTTP_HANDLE_TYPE_SESSION
)
list_remove
(
&
hdr
->
entry
);
hdr
->
vtbl
->
destroy
(
hdr
);
}
}
...
...
@@ -89,7 +88,6 @@ HINTERNET alloc_handle( struct object_header *hdr )
struct
object_header
**
p
;
ULONG_PTR
handle
,
num
;
list_init
(
&
hdr
->
children
);
hdr
->
handle
=
NULL
;
EnterCriticalSection
(
&
handle_cs
);
...
...
@@ -123,7 +121,7 @@ BOOL free_handle( HINTERNET hinternet )
{
BOOL
ret
=
FALSE
;
ULONG_PTR
handle
=
(
ULONG_PTR
)
hinternet
;
struct
object_header
*
hdr
=
NULL
,
*
child
,
*
next
;
struct
object_header
*
hdr
=
NULL
;
EnterCriticalSection
(
&
handle_cs
);
...
...
@@ -141,15 +139,7 @@ BOOL free_handle( HINTERNET hinternet )
LeaveCriticalSection
(
&
handle_cs
);
if
(
hdr
)
{
LIST_FOR_EACH_ENTRY_SAFE
(
child
,
next
,
&
hdr
->
children
,
struct
object_header
,
entry
)
{
TRACE
(
"freeing child handle %p for parent handle 0x%lx
\n
"
,
child
->
handle
,
handle
+
1
);
free_handle
(
child
->
handle
);
}
release_object
(
hdr
);
}
if
(
hdr
)
release_object
(
hdr
);
EnterCriticalSection
(
&
handle_cs
);
if
(
next_handle
>
handle
&&
!
handles
[
handle
])
next_handle
=
handle
;
...
...
dlls/winhttp/request.c
View file @
93366514
...
...
@@ -3102,11 +3102,9 @@ HINTERNET WINAPI WinHttpWebSocketCompleteUpgrade( HINTERNET hrequest, DWORD_PTR
socket
->
hdr
.
vtbl
=
&
socket_vtbl
;
socket
->
hdr
.
refs
=
1
;
socket
->
hdr
.
context
=
context
;
list_init
(
&
socket
->
hdr
.
children
);
addref_object
(
&
request
->
hdr
);
socket
->
request
=
request
;
list_add_head
(
&
request
->
hdr
.
children
,
&
socket
->
hdr
.
entry
);
if
((
hsocket
=
alloc_handle
(
&
socket
->
hdr
)))
socket
->
hdr
.
handle
=
hsocket
;
...
...
dlls/winhttp/session.c
View file @
93366514
...
...
@@ -246,7 +246,6 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR agent, DWORD access, LPCWSTR proxy, LPCWST
session
->
hdr
.
flags
=
flags
;
session
->
hdr
.
refs
=
1
;
session
->
hdr
.
redirect_policy
=
WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP
;
list_init
(
&
session
->
hdr
.
children
);
session
->
resolve_timeout
=
DEFAULT_RESOLVE_TIMEOUT
;
session
->
connect_timeout
=
DEFAULT_CONNECT_TIMEOUT
;
session
->
send_timeout
=
DEFAULT_SEND_TIMEOUT
;
...
...
@@ -552,11 +551,9 @@ HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PO
connect
->
hdr
.
notify_mask
=
session
->
hdr
.
notify_mask
;
connect
->
hdr
.
context
=
session
->
hdr
.
context
;
connect
->
hdr
.
redirect_policy
=
session
->
hdr
.
redirect_policy
;
list_init
(
&
connect
->
hdr
.
children
);
addref_object
(
&
session
->
hdr
);
connect
->
session
=
session
;
list_add_head
(
&
session
->
hdr
.
children
,
&
connect
->
hdr
.
entry
);
if
(
!
(
connect
->
hostname
=
strdupW
(
server
)))
goto
end
;
connect
->
hostport
=
port
;
...
...
@@ -1121,12 +1118,10 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o
request
->
hdr
.
notify_mask
=
connect
->
hdr
.
notify_mask
;
request
->
hdr
.
context
=
connect
->
hdr
.
context
;
request
->
hdr
.
redirect_policy
=
connect
->
hdr
.
redirect_policy
;
list_init
(
&
request
->
hdr
.
children
);
list_init
(
&
request
->
task_queue
);
addref_object
(
&
connect
->
hdr
);
request
->
connect
=
connect
;
list_add_head
(
&
connect
->
hdr
.
children
,
&
request
->
hdr
.
entry
);
request
->
resolve_timeout
=
connect
->
session
->
resolve_timeout
;
request
->
connect_timeout
=
connect
->
session
->
connect_timeout
;
...
...
dlls/winhttp/tests/winhttp.c
View file @
93366514
...
...
@@ -3099,6 +3099,7 @@ static void test_websocket(int port)
{
HINTERNET
session
,
connection
,
request
,
socket
;
DWORD
size
,
len
,
count
,
status
,
index
,
error
;
DWORD_PTR
ctx
;
WCHAR
header
[
32
];
char
buf
[
128
];
BOOL
ret
;
...
...
@@ -3244,10 +3245,28 @@ static void test_websocket(int port)
/* Send/Receive on websock */
WinHttpCloseHandle
(
request
);
WinHttpCloseHandle
(
socket
);
WinHttpCloseHandle
(
connection
);
WinHttpCloseHandle
(
session
);
ret
=
WinHttpCloseHandle
(
connection
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
/* request handle is still valid */
size
=
sizeof
(
ctx
);
ret
=
WinHttpQueryOption
(
request
,
WINHTTP_OPTION_CONTEXT_VALUE
,
&
ctx
,
&
size
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ret
=
WinHttpCloseHandle
(
socket
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ret
=
WinHttpQueryOption
(
request
,
WINHTTP_OPTION_CONTEXT_VALUE
,
&
ctx
,
&
size
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ret
=
WinHttpCloseHandle
(
session
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ret
=
WinHttpQueryOption
(
request
,
WINHTTP_OPTION_CONTEXT_VALUE
,
&
ctx
,
&
size
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
ret
=
WinHttpCloseHandle
(
request
);
ok
(
ret
,
"got %u
\n
"
,
GetLastError
());
}
static
void
test_not_modified
(
int
port
)
...
...
dlls/winhttp/winhttp_private.h
View file @
93366514
...
...
@@ -51,7 +51,6 @@ struct object_header
WINHTTP_STATUS_CALLBACK
callback
;
DWORD
notify_mask
;
struct
list
entry
;
struct
list
children
;
};
struct
hostdata
...
...
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