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
c42989ed
Commit
c42989ed
authored
Dec 19, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Return the right value for SO_CONNECT_TIME if the socket is not connected.
parent
895e7a5f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
socket.c
dlls/ws2_32/socket.c
+9
-2
sock.c
dlls/ws2_32/tests/sock.c
+14
-2
No files found.
dlls/ws2_32/socket.c
View file @
c42989ed
...
...
@@ -2548,14 +2548,21 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
case
WS_SO_CONNECT_TIME
:
{
static
int
pretendtime
=
0
;
struct
WS_sockaddr
addr
;
int
len
=
sizeof
(
addr
);
if
(
!
pretendtime
)
FIXME
(
"WS_SO_CONNECT_TIME - faking results
\n
"
);
if
(
!
optlen
||
*
optlen
<
sizeof
(
DWORD
)
||
!
optval
)
{
SetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
*
(
DWORD
*
)
optval
=
pretendtime
++
;
if
(
WS_getpeername
(
s
,
&
addr
,
&
len
)
==
SOCKET_ERROR
)
*
(
DWORD
*
)
optval
=
~
0u
;
else
{
if
(
!
pretendtime
)
FIXME
(
"WS_SO_CONNECT_TIME - faking results
\n
"
);
*
(
DWORD
*
)
optval
=
pretendtime
++
;
}
*
optlen
=
sizeof
(
DWORD
);
return
ret
;
}
...
...
dlls/ws2_32/tests/sock.c
View file @
c42989ed
...
...
@@ -4496,14 +4496,14 @@ static void test_AcceptEx(void)
SOCKET
connector
=
INVALID_SOCKET
;
SOCKET
connector2
=
INVALID_SOCKET
;
struct
sockaddr_in
bindAddress
,
peerAddress
,
*
readBindAddress
,
*
readRemoteAddress
;
int
socklen
;
int
socklen
,
optlen
;
GUID
acceptExGuid
=
WSAID_ACCEPTEX
,
getAcceptExGuid
=
WSAID_GETACCEPTEXSOCKADDRS
;
LPFN_ACCEPTEX
pAcceptEx
=
NULL
;
LPFN_GETACCEPTEXSOCKADDRS
pGetAcceptExSockaddrs
=
NULL
;
fd_set
fds_accept
,
fds_send
;
struct
timeval
timeout
=
{
0
,
10
};
/* wait for 10 milliseconds */
int
got
,
conn1
,
i
;
DWORD
bytesReturned
;
DWORD
bytesReturned
,
connect_time
;
char
buffer
[
1024
];
OVERLAPPED
overlapped
;
int
iret
,
localSize
=
sizeof
(
struct
sockaddr_in
),
remoteSize
=
localSize
;
...
...
@@ -4695,9 +4695,21 @@ static void test_AcceptEx(void)
&
bytesReturned
,
&
overlapped
);
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
ERROR_IO_PENDING
,
"AcceptEx returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
connect_time
=
0xdeadbeef
;
optlen
=
sizeof
(
connect_time
);
iret
=
getsockopt
(
connector
,
SOL_SOCKET
,
SO_CONNECT_TIME
,
(
char
*
)
&
connect_time
,
&
optlen
);
ok
(
!
iret
,
"getsockopt failed %d
\n
"
,
WSAGetLastError
());
ok
(
connect_time
==
~
0u
,
"unexpected connect time %u
\n
"
,
connect_time
);
iret
=
connect
(
connector
,
(
struct
sockaddr
*
)
&
bindAddress
,
sizeof
(
bindAddress
));
ok
(
iret
==
0
,
"connecting to accepting socket failed, error %d
\n
"
,
WSAGetLastError
());
connect_time
=
0xdeadbeef
;
optlen
=
sizeof
(
connect_time
);
iret
=
getsockopt
(
connector
,
SOL_SOCKET
,
SO_CONNECT_TIME
,
(
char
*
)
&
connect_time
,
&
optlen
);
ok
(
!
iret
,
"getsockopt failed %d
\n
"
,
WSAGetLastError
());
ok
(
connect_time
<
0xdeadbeef
,
"unexpected connect time %u
\n
"
,
connect_time
);
dwret
=
WaitForSingleObject
(
overlapped
.
hEvent
,
0
);
ok
(
dwret
==
WAIT_TIMEOUT
,
"Waiting for accept event timeout failed with %d + errno %d
\n
"
,
dwret
,
GetLastError
());
...
...
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