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
b9f8adb2
Commit
b9f8adb2
authored
Oct 19, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Forbid accepting into the same socket more than once.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
93fb921c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
sock.c
dlls/ws2_32/tests/sock.c
+1
-15
sock.c
server/sock.c
+7
-0
No files found.
dlls/ws2_32/tests/sock.c
View file @
b9f8adb2
...
...
@@ -7554,23 +7554,9 @@ todo_wine
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
todo_wine
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAEINVAL
,
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAEINVAL
,
"AcceptEx on already pending socket returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
ok
(
overlapped
.
Internal
==
STATUS_PENDING
,
"got %08x
\n
"
,
(
ULONG
)
overlapped
.
Internal
);
if
(
bret
==
FALSE
&&
WSAGetLastError
()
==
ERROR_IO_PENDING
)
{
/* We need to cancel this call, otherwise things fail */
bret
=
CancelIo
((
HANDLE
)
listener
);
ok
(
bret
,
"Failed to cancel failed test. Bailing...
\n
"
);
if
(
!
bret
)
return
;
WaitForSingleObject
(
overlapped
.
hEvent
,
0
);
overlapped
.
Internal
=
0xdeadbeef
;
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
ERROR_IO_PENDING
,
"AcceptEx returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
ok
(
overlapped
.
Internal
==
STATUS_PENDING
,
"got %08x
\n
"
,
(
ULONG
)
overlapped
.
Internal
);
}
iret
=
connect
(
acceptor
,
(
struct
sockaddr
*
)
&
bindAddress
,
sizeof
(
bindAddress
));
todo_wine
ok
(
iret
==
SOCKET_ERROR
&&
WSAGetLastError
()
==
WSAEINVAL
,
...
...
server/sock.c
View file @
b9f8adb2
...
...
@@ -1463,6 +1463,13 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
if
(
!
(
acceptsock
=
(
struct
sock
*
)
get_handle_obj
(
current
->
process
,
params
->
accept_handle
,
access
,
&
sock_ops
)))
return
0
;
if
(
acceptsock
->
accept_recv_req
)
{
release_object
(
acceptsock
);
set_win32_error
(
WSAEINVAL
);
return
0
;
}
if
(
!
(
req
=
alloc_accept_req
(
acceptsock
,
async
,
params
)))
return
0
;
list_add_tail
(
&
sock
->
accept_list
,
&
req
->
entry
);
acceptsock
->
accept_recv_req
=
req
;
...
...
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