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
10f72652
Commit
10f72652
authored
Mar 29, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
Mar 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Do not poll unbound descriptors.
parent
b2556a2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
11 deletions
+33
-11
socket.c
dlls/ws2_32/socket.c
+33
-6
sock.c
dlls/ws2_32/tests/sock.c
+0
-5
No files found.
dlls/ws2_32/socket.c
View file @
10f72652
...
...
@@ -4479,24 +4479,51 @@ static struct pollfd *fd_sets_to_poll( const WS_fd_set *readfds, const WS_fd_set
{
fds
[
j
].
fd
=
get_sock_fd
(
readfds
->
fd_array
[
i
],
FILE_READ_DATA
,
NULL
);
if
(
fds
[
j
].
fd
==
-
1
)
goto
failed
;
fds
[
j
].
events
=
POLLIN
;
fds
[
j
].
revents
=
0
;
if
(
is_fd_bound
(
fds
[
j
].
fd
,
NULL
,
NULL
)
==
1
)
{
fds
[
j
].
events
=
POLLIN
;
}
else
{
release_sock_fd
(
readfds
->
fd_array
[
i
],
fds
[
j
].
fd
);
fds
[
j
].
fd
=
-
1
;
fds
[
j
].
events
=
0
;
}
}
if
(
writefds
)
for
(
i
=
0
;
i
<
writefds
->
fd_count
;
i
++
,
j
++
)
{
fds
[
j
].
fd
=
get_sock_fd
(
writefds
->
fd_array
[
i
],
FILE_WRITE_DATA
,
NULL
);
if
(
fds
[
j
].
fd
==
-
1
)
goto
failed
;
fds
[
j
].
events
=
POLLOUT
;
fds
[
j
].
revents
=
0
;
if
(
is_fd_bound
(
fds
[
j
].
fd
,
NULL
,
NULL
)
==
1
)
{
fds
[
j
].
events
=
POLLOUT
;
}
else
{
release_sock_fd
(
readfds
->
fd_array
[
i
],
fds
[
j
].
fd
);
fds
[
j
].
fd
=
-
1
;
fds
[
j
].
events
=
0
;
}
}
if
(
exceptfds
)
for
(
i
=
0
;
i
<
exceptfds
->
fd_count
;
i
++
,
j
++
)
{
fds
[
j
].
fd
=
get_sock_fd
(
exceptfds
->
fd_array
[
i
],
0
,
NULL
);
if
(
fds
[
j
].
fd
==
-
1
)
goto
failed
;
fds
[
j
].
events
=
POLLHUP
;
fds
[
j
].
revents
=
0
;
if
(
is_fd_bound
(
fds
[
j
].
fd
,
NULL
,
NULL
)
==
1
)
{
fds
[
j
].
events
=
POLLHUP
;
}
else
{
release_sock_fd
(
readfds
->
fd_array
[
i
],
fds
[
j
].
fd
);
fds
[
j
].
fd
=
-
1
;
fds
[
j
].
events
=
0
;
}
}
return
fds
;
...
...
@@ -4505,13 +4532,13 @@ failed:
j
=
0
;
if
(
readfds
)
for
(
i
=
0
;
i
<
readfds
->
fd_count
&&
j
<
count
;
i
++
,
j
++
)
release_sock_fd
(
readfds
->
fd_array
[
i
],
fds
[
j
].
fd
);
if
(
fds
[
j
].
fd
!=
-
1
)
release_sock_fd
(
readfds
->
fd_array
[
i
],
fds
[
j
].
fd
);
if
(
writefds
)
for
(
i
=
0
;
i
<
writefds
->
fd_count
&&
j
<
count
;
i
++
,
j
++
)
release_sock_fd
(
writefds
->
fd_array
[
i
],
fds
[
j
].
fd
);
if
(
fds
[
j
].
fd
!=
-
1
)
release_sock_fd
(
writefds
->
fd_array
[
i
],
fds
[
j
].
fd
);
if
(
exceptfds
)
for
(
i
=
0
;
i
<
exceptfds
->
fd_count
&&
j
<
count
;
i
++
,
j
++
)
release_sock_fd
(
exceptfds
->
fd_array
[
i
],
fds
[
j
].
fd
);
if
(
fds
[
j
].
fd
!=
-
1
)
release_sock_fd
(
exceptfds
->
fd_array
[
i
],
fds
[
j
].
fd
);
HeapFree
(
GetProcessHeap
(),
0
,
fds
);
return
NULL
;
}
...
...
dlls/ws2_32/tests/sock.c
View file @
10f72652
...
...
@@ -3430,17 +3430,12 @@ static void test_select(void)
if
(
fdWrite
>
maxfd
)
maxfd
=
fdWrite
;
todo_wine
{
ret
=
select
(
maxfd
+
1
,
&
readfds
,
&
writefds
,
&
exceptfds
,
&
select_timeout
);
ok
(
(
ret
==
0
),
"select should not return any socket handles
\n
"
);
ok
(
!
FD_ISSET
(
fdRead
,
&
readfds
),
"FD should not be set
\n
"
);
}
ok
(
!
FD_ISSET
(
fdWrite
,
&
writefds
),
"FD should not be set
\n
"
);
todo_wine
{
ok
(
!
FD_ISSET
(
fdRead
,
&
exceptfds
),
"FD should not be set
\n
"
);
ok
(
!
FD_ISSET
(
fdWrite
,
&
exceptfds
),
"FD should not be set
\n
"
);
}
ok
((
listen
(
fdWrite
,
SOMAXCONN
)
==
SOCKET_ERROR
),
"listen did not fail
\n
"
);
ret
=
closesocket
(
fdWrite
);
...
...
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