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
4f8fe3b1
Commit
4f8fe3b1
authored
Jun 08, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Jun 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Use completion port for async send.
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
parent
dae64e2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
net.c
dlls/winhttp/net.c
+21
-2
winhttp_private.h
dlls/winhttp/winhttp_private.h
+1
-0
No files found.
dlls/winhttp/net.c
View file @
4f8fe3b1
...
...
@@ -53,9 +53,20 @@ static int sock_send(int fd, const void *msg, size_t len, WSAOVERLAPPED *ovr)
BOOL
netconn_wait_overlapped_result
(
struct
netconn
*
conn
,
WSAOVERLAPPED
*
ovr
,
DWORD
*
len
)
{
DWORD
retflags
;
OVERLAPPED
*
completion_ovr
;
ULONG_PTR
key
;
return
WSAGetOverlappedResult
(
conn
->
socket
,
ovr
,
len
,
TRUE
,
&
retflags
);
if
(
!
GetQueuedCompletionStatus
(
conn
->
port
,
len
,
&
key
,
&
completion_ovr
,
INFINITE
))
{
WARN
(
"GetQueuedCompletionStatus failed, err %lu.
\n
"
,
GetLastError
()
);
return
FALSE
;
}
if
((
key
!=
conn
->
socket
&&
conn
->
socket
!=
-
1
)
||
completion_ovr
!=
(
OVERLAPPED
*
)
ovr
)
{
ERR
(
"Unexpected completion key %Ix, overlapped %p.
\n
"
,
key
,
completion_ovr
);
return
FALSE
;
}
return
TRUE
;
}
static
int
sock_recv
(
int
fd
,
void
*
msg
,
size_t
len
,
int
flags
)
...
...
@@ -279,6 +290,8 @@ void netconn_close( struct netconn *conn )
if
(
conn
->
socket
!=
-
1
)
closesocket
(
conn
->
socket
);
release_host
(
conn
->
host
);
if
(
conn
->
port
)
CloseHandle
(
conn
->
port
);
free
(
conn
);
}
...
...
@@ -452,6 +465,12 @@ DWORD netconn_send( struct netconn *conn, const void *msg, size_t len, int *sent
{
DWORD
err
;
if
(
ovr
&&
!
conn
->
port
)
{
if
(
!
(
conn
->
port
=
CreateIoCompletionPort
(
(
HANDLE
)(
SOCKET
)
conn
->
socket
,
NULL
,
(
ULONG_PTR
)
conn
->
socket
,
0
)))
ERR
(
"Failed to create port.
\n
"
);
}
if
(
conn
->
secure
)
{
const
BYTE
*
ptr
=
msg
;
...
...
dlls/winhttp/winhttp_private.h
View file @
4f8fe3b1
...
...
@@ -117,6 +117,7 @@ struct netconn
char
*
peek_msg
;
char
*
peek_msg_mem
;
size_t
peek_len
;
HANDLE
port
;
};
struct
header
...
...
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