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
682ddd82
Commit
682ddd82
authored
Nov 26, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Use the thread pool for the connection collector.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
256ca317
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
18 deletions
+6
-18
request.c
dlls/winhttp/request.c
+6
-18
No files found.
dlls/winhttp/request.c
View file @
682ddd82
...
...
@@ -1457,7 +1457,7 @@ void release_host( struct hostdata *host )
static
BOOL
connection_collector_running
;
static
DWORD
WINAPI
connection_collector
(
void
*
arg
)
static
void
CALLBACK
connection_collector
(
TP_CALLBACK_INSTANCE
*
instance
,
void
*
ctx
)
{
unsigned
int
remaining_connections
;
struct
netconn
*
netconn
,
*
next_netconn
;
...
...
@@ -1483,10 +1483,7 @@ static DWORD WINAPI connection_collector(void *arg)
list_remove
(
&
netconn
->
entry
);
netconn_close
(
netconn
);
}
else
{
remaining_connections
++
;
}
else
remaining_connections
++
;
}
}
...
...
@@ -1495,7 +1492,7 @@ static DWORD WINAPI connection_collector(void *arg)
LeaveCriticalSection
(
&
connection_pool_cs
);
}
while
(
remaining_connections
);
FreeLibrary
AndExitThread
(
winhttp_instance
,
0
);
FreeLibrary
WhenCallbackReturns
(
instance
,
winhttp_instance
);
}
static
void
cache_connection
(
struct
netconn
*
netconn
)
...
...
@@ -1510,20 +1507,11 @@ static void cache_connection( struct netconn *netconn )
if
(
!
connection_collector_running
)
{
HMODULE
module
;
HANDLE
thread
;
GetModuleHandleExW
(
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
,
(
const
WCHAR
*
)
winhttp_instance
,
&
module
);
GetModuleHandleExW
(
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
,
(
const
WCHAR
*
)
winhttp_instance
,
&
module
);
thread
=
CreateThread
(
NULL
,
0
,
connection_collector
,
NULL
,
0
,
NULL
);
if
(
thread
)
{
CloseHandle
(
thread
);
connection_collector_running
=
TRUE
;
}
else
{
FreeLibrary
(
winhttp_instance
);
}
if
(
TrySubmitThreadpoolCallback
(
connection_collector
,
NULL
,
NULL
))
connection_collector_running
=
TRUE
;
else
FreeLibrary
(
winhttp_instance
);
}
LeaveCriticalSection
(
&
connection_pool_cs
);
...
...
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