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
63504e9e
Commit
63504e9e
authored
Mar 24, 2008
by
Kai Blin
Committed by
Alexandre Julliard
Mar 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
janitorial: Use poll() instead of select().
parent
0aecedf2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
19 deletions
+33
-19
nbt.c
dlls/netapi32/nbt.c
+13
-5
internet.c
dlls/wininet/internet.c
+10
-7
netconnection.c
dlls/wininet/netconnection.c
+10
-7
No files found.
dlls/netapi32/nbt.c
View file @
63504e9e
...
...
@@ -67,6 +67,15 @@
#include "config.h"
#include <stdarg.h>
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
#ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include "winsock2.h"
#include "windef.h"
...
...
@@ -302,13 +311,12 @@ static UCHAR NetBTWaitForNameResponse(const NetBTAdapter *adapter, SOCKET fd,
while
(
!
found
&&
ret
==
NRC_GOODRET
&&
(
now
=
GetTickCount
())
<
waitUntil
)
{
DWORD
msToWait
=
waitUntil
-
now
;
struct
fd_set
fds
;
struct
timeval
timeout
=
{
msToWait
/
1000
,
msToWait
%
1000
};
struct
pollfd
pfd
;
int
r
;
FD_ZERO
(
&
fds
)
;
FD_SET
(
fd
,
&
fds
)
;
r
=
select
(
fd
+
1
,
&
fds
,
NULL
,
NULL
,
&
timeou
t
);
pfd
.
fd
=
fd
;
pfd
.
events
=
POLLIN
;
r
=
poll
(
&
pfd
,
1
,
msToWai
t
);
if
(
r
<
0
)
ret
=
NRC_SYSTEM
;
else
if
(
r
==
1
)
...
...
dlls/wininet/internet.c
View file @
63504e9e
...
...
@@ -38,6 +38,12 @@
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
#ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
...
...
@@ -3049,22 +3055,19 @@ LPSTR INTERNET_GetResponseBuffer(void)
LPSTR
INTERNET_GetNextLine
(
INT
nSocket
,
LPDWORD
dwLen
)
{
struct
timeval
tv
;
fd_set
infd
;
struct
pollfd
pfd
;
BOOL
bSuccess
=
FALSE
;
INT
nRecv
=
0
;
LPSTR
lpszBuffer
=
INTERNET_GetResponseBuffer
();
TRACE
(
"
\n
"
);
FD_ZERO
(
&
infd
);
FD_SET
(
nSocket
,
&
infd
);
tv
.
tv_sec
=
RESPONSE_TIMEOUT
;
tv
.
tv_usec
=
0
;
pfd
.
fd
=
nSocket
;
pfd
.
events
=
POLLIN
;
while
(
nRecv
<
MAX_REPLY_LEN
)
{
if
(
select
(
nSocket
+
1
,
&
infd
,
NULL
,
NULL
,
&
tv
)
>
0
)
if
(
poll
(
&
pfd
,
1
,
RESPONSE_TIMEOUT
*
1000
)
>
0
)
{
if
(
recv
(
nSocket
,
&
lpszBuffer
[
nRecv
],
1
,
0
)
<=
0
)
{
...
...
dlls/wininet/netconnection.c
View file @
63504e9e
...
...
@@ -23,6 +23,12 @@
#include "config.h"
#include "wine/port.h"
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
#ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
...
...
@@ -610,19 +616,16 @@ BOOL NETCON_getNextLine(WININET_NETCONNECTION *connection, LPSTR lpszBuffer, LPD
if
(
!
connection
->
useSSL
)
{
struct
timeval
tv
;
fd_set
infd
;
struct
pollfd
pfd
;
BOOL
bSuccess
=
FALSE
;
DWORD
nRecv
=
0
;
FD_ZERO
(
&
infd
);
FD_SET
(
connection
->
socketFD
,
&
infd
);
tv
.
tv_sec
=
RESPONSE_TIMEOUT
;
tv
.
tv_usec
=
0
;
pfd
.
fd
=
connection
->
socketFD
;
pfd
.
events
=
POLLIN
;
while
(
nRecv
<
*
dwBuffer
)
{
if
(
select
(
connection
->
socketFD
+
1
,
&
infd
,
NULL
,
NULL
,
&
tv
)
>
0
)
if
(
poll
(
&
pfd
,
1
,
RESPONSE_TIMEOUT
*
1000
)
>
0
)
{
if
(
recv
(
connection
->
socketFD
,
&
lpszBuffer
[
nRecv
],
1
,
0
)
<=
0
)
{
...
...
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