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
d278834d
Commit
d278834d
authored
Oct 04, 2011
by
Bruno Jesus
Committed by
Alexandre Julliard
Oct 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Fix UDP LINGER support in getsockopt.
parent
38982ddf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
socket.c
dlls/ws2_32/socket.c
+8
-2
sock.c
dlls/ws2_32/tests/sock.c
+4
-4
No files found.
dlls/ws2_32/socket.c
View file @
d278834d
...
...
@@ -2575,7 +2575,8 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
case
WS_SO_LINGER
:
{
struct
linger
lingval
;
unsigned
int
len
=
sizeof
(
struct
linger
);
int
so_type
;
unsigned
int
len
=
sizeof
(
struct
linger
),
slen
=
sizeof
(
int
);
/* struct linger and LINGER have different sizes */
if
(
!
optlen
||
*
optlen
<
sizeof
(
LINGER
)
||
!
optval
)
...
...
@@ -2586,7 +2587,12 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
if
(
(
fd
=
get_sock_fd
(
s
,
0
,
NULL
))
==
-
1
)
return
SOCKET_ERROR
;
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_LINGER
,
&
lingval
,
&
len
)
!=
0
)
if
((
getsockopt
(
fd
,
SOL_SOCKET
,
SO_TYPE
,
&
so_type
,
&
slen
)
==
0
&&
so_type
==
SOCK_DGRAM
))
{
SetLastError
(
WSAENOPROTOOPT
);
ret
=
SOCKET_ERROR
;
}
else
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_LINGER
,
&
lingval
,
&
len
)
!=
0
)
{
SetLastError
((
errno
==
EBADF
)
?
WSAENOTSOCK
:
wsaErrno
());
ret
=
SOCKET_ERROR
;
...
...
dlls/ws2_32/tests/sock.c
View file @
d278834d
...
...
@@ -2630,12 +2630,12 @@ static void test_extendedSocketOptions(void)
"got %d with %d and optval: 0x%x/%d (expected SOCKET_ERROR with WSAEINVAL)
\n
"
,
ret
,
WSAGetLastError
(),
optval
,
optval
);
SetLastError
(
0xdeadbeef
);
optlen
=
sizeof
(
LINGER
);
ret
=
getsockopt
(
sock
,
SOL_SOCKET
,
SO_LINGER
,
(
char
*
)
&
linger_val
,
&
optlen
);
todo_wine
{
ok
(
ret
==
SOCKET_ERROR
,
"getsockopt should fail for UDP sockets but return value is 0x%08x
\n
"
,
ret
);
}
ok
(
(
ret
==
SOCKET_ERROR
)
&&
(
WSAGetLastError
()
==
WSAENOPROTOOPT
),
"getsockopt should fail for UDP sockets setting last error to WSAENOPROTOOPT, got %d with %d
\n
"
,
ret
,
WSAGetLastError
());
closesocket
(
sock
);
if
((
sock
=
socket
(
PF_INET
,
SOCK_STREAM
,
IPPROTO_IP
))
==
INVALID_SOCKET
)
{
...
...
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