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
eec47af6
Commit
eec47af6
authored
Aug 18, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Properly implement getsockopt(SO_CONNECT_TIME).
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4af902eb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
21 deletions
+26
-21
socket.c
dlls/ws2_32/socket.c
+8
-21
afd.h
include/wine/afd.h
+1
-0
sock.c
server/sock.c
+17
-0
No files found.
dlls/ws2_32/socket.c
View file @
eec47af6
...
...
@@ -1424,6 +1424,14 @@ int WINAPI getsockopt( SOCKET s, int level, int optname, char *optval, int *optl
return
0
;
}
case
SO_CONNECT_TIME
:
if
(
!
optlen
||
!
optval
)
{
SetLastError
(
WSAEFAULT
);
return
-
1
;
}
return
server_getsockopt
(
s
,
IOCTL_AFD_WINE_GET_SO_CONNECT_TIME
,
optval
,
optlen
);
case
SO_DEBUG
:
WARN
(
"returning 0 for SO_DEBUG
\n
"
);
*
(
DWORD
*
)
optval
=
0
;
...
...
@@ -1450,27 +1458,6 @@ int WINAPI getsockopt( SOCKET s, int level, int optname, char *optval, int *optl
return
ret
;
}
case
SO_CONNECT_TIME
:
{
static
int
pretendtime
=
0
;
struct
sockaddr
addr
;
int
len
=
sizeof
(
addr
);
if
(
!
optlen
||
*
optlen
<
sizeof
(
DWORD
)
||
!
optval
)
{
SetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
if
(
getpeername
(
s
,
&
addr
,
&
len
)
==
SOCKET_ERROR
)
*
(
DWORD
*
)
optval
=
~
0u
;
else
{
if
(
!
pretendtime
)
FIXME
(
"SO_CONNECT_TIME - faking results
\n
"
);
*
(
DWORD
*
)
optval
=
pretendtime
++
;
}
*
optlen
=
sizeof
(
DWORD
);
return
ret
;
}
/* As mentioned in setsockopt, Windows ignores this, so we
* always return true here */
case
SO_DONTROUTE
:
...
...
include/wine/afd.h
View file @
eec47af6
...
...
@@ -233,6 +233,7 @@ struct afd_get_events_params
#define IOCTL_AFD_WINE_SET_IPV6_RECVPKTINFO WINE_AFD_IOC(289)
#define IOCTL_AFD_WINE_GET_IPV6_RECVTCLASS WINE_AFD_IOC(290)
#define IOCTL_AFD_WINE_SET_IPV6_RECVTCLASS WINE_AFD_IOC(291)
#define IOCTL_AFD_WINE_GET_SO_CONNECT_TIME WINE_AFD_IOC(292)
struct
afd_create_params
{
...
...
server/sock.c
View file @
eec47af6
...
...
@@ -2807,6 +2807,23 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
return
0
;
}
case
IOCTL_AFD_WINE_GET_SO_CONNECT_TIME
:
{
DWORD
time
=
~
0u
;
if
(
get_reply_max_size
()
<
sizeof
(
time
))
{
set_error
(
STATUS_BUFFER_TOO_SMALL
);
return
0
;
}
if
(
sock
->
state
==
SOCK_CONNECTED
)
time
=
(
current_time
-
sock
->
connect_time
)
/
10000000
;
set_reply_data
(
&
time
,
sizeof
(
time
)
);
return
1
;
}
default:
set_error
(
STATUS_NOT_SUPPORTED
);
return
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