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
5d6d2fda
Commit
5d6d2fda
authored
Feb 13, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Use set_socket_blocking helper in a few more places.
parent
7410bf58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
21 deletions
+12
-21
netconnection.c
dlls/wininet/netconnection.c
+12
-21
No files found.
dlls/wininet/netconnection.c
View file @
5d6d2fda
...
...
@@ -346,6 +346,14 @@ void init_winsock(void)
#endif
}
static
void
set_socket_blocking
(
int
socket
,
blocking_mode_t
mode
)
{
#ifdef USE_WINSOCK
ULONG
arg
=
mode
==
BLOCKING_DISALLOW
;
ioctlsocket
(
socket
,
FIONBIO
,
&
arg
);
#endif
}
static
DWORD
create_netconn_socket
(
server_t
*
server
,
netconn_t
*
netconn
,
DWORD
timeout
)
{
int
result
;
...
...
@@ -357,8 +365,7 @@ static DWORD create_netconn_socket(server_t *server, netconn_t *netconn, DWORD t
assert
(
server
->
addr_len
);
result
=
netconn
->
socket
=
socket
(
server
->
addr
.
ss_family
,
SOCK_STREAM
,
0
);
if
(
result
!=
-
1
)
{
flag
=
1
;
ioctlsocket
(
netconn
->
socket
,
FIONBIO
,
&
flag
);
set_socket_blocking
(
netconn
->
socket
,
BLOCKING_DISALLOW
);
result
=
connect
(
netconn
->
socket
,
(
struct
sockaddr
*
)
&
server
->
addr
,
server
->
addr_len
);
if
(
result
==
-
1
)
{
...
...
@@ -391,8 +398,7 @@ static DWORD create_netconn_socket(server_t *server, netconn_t *netconn, DWORD t
netconn
->
socket
=
-
1
;
}
else
{
flag
=
0
;
ioctlsocket
(
netconn
->
socket
,
FIONBIO
,
&
flag
);
set_socket_blocking
(
netconn
->
socket
,
BLOCKING_ALLOW
);
}
}
if
(
result
==
-
1
)
...
...
@@ -573,14 +579,6 @@ int sock_recv(int fd, void *msg, size_t len, int flags)
return
ret
;
}
static
void
set_socket_blocking
(
int
socket
,
blocking_mode_t
mode
)
{
#ifdef USE_WINSOCK
ULONG
arg
=
mode
==
BLOCKING_DISALLOW
;
ioctlsocket
(
socket
,
FIONBIO
,
&
arg
);
#endif
}
static
DWORD
netcon_secure_connect_setup
(
netconn_t
*
connection
,
BOOL
compat_mode
)
{
SecBuffer
out_buf
=
{
0
,
SECBUFFER_TOKEN
,
NULL
},
in_bufs
[
2
]
=
{{
0
,
SECBUFFER_TOKEN
},
{
0
,
SECBUFFER_EMPTY
}};
...
...
@@ -1079,19 +1077,12 @@ BOOL NETCON_is_alive(netconn_t *netconn)
len
=
sock_recv
(
netconn
->
socket
,
&
b
,
1
,
MSG_PEEK
|
MSG_DONTWAIT
);
return
len
==
1
||
(
len
==
-
1
&&
sock_get_error
()
==
WSAEWOULDBLOCK
);
#elif defined(USE_WINSOCK)
ULONG
mode
;
int
len
;
char
b
;
mode
=
1
;
if
(
ioctlsocket
(
netconn
->
socket
,
FIONBIO
,
&
mode
))
return
FALSE
;
set_socket_blocking
(
netconn
->
socket
,
BLOCKING_DISALLOW
);
len
=
sock_recv
(
netconn
->
socket
,
&
b
,
1
,
MSG_PEEK
);
mode
=
0
;
if
(
ioctlsocket
(
netconn
->
socket
,
FIONBIO
,
&
mode
))
return
FALSE
;
set_socket_blocking
(
netconn
->
socket
,
BLOCKING_ALLOW
);
return
len
==
1
||
(
len
==
-
1
&&
sock_get_error
()
==
WSAEWOULDBLOCK
);
#else
...
...
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