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
2a4df565
Commit
2a4df565
authored
Dec 04, 2006
by
Kai Blin
Committed by
Alexandre Julliard
Dec 04, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Rewrite getsockopt to make it more readable.
parent
84fb1e1f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
socket.c
dlls/ws2_32/socket.c
+0
-0
sock.c
dlls/ws2_32/tests/sock.c
+34
-1
No files found.
dlls/ws2_32/socket.c
View file @
2a4df565
This diff is collapsed.
Click to expand it.
dlls/ws2_32/tests/sock.c
View file @
2a4df565
...
...
@@ -1417,6 +1417,8 @@ static void test_extendedSocketOptions()
struct
sockaddr_in
sa
;
int
sa_len
=
sizeof
(
struct
sockaddr_in
);
int
optval
,
optlen
=
sizeof
(
int
),
ret
;
BOOL
bool_opt_val
;
LINGER
linger_val
;
if
(
WSAStartup
(
MAKEWORD
(
2
,
0
),
&
wsa
)){
trace
(
"Winsock failed: 0x%08x. Aborting test
\n
"
,
WSAGetLastError
());
...
...
@@ -1442,11 +1444,42 @@ static void test_extendedSocketOptions()
return
;
}
ret
=
getsockopt
(
sock
,
SOL_SOCKET
,
SO_MAX_MSG_SIZE
,
(
char
*
)
&
optval
,
(
int
*
)
&
optlen
);
ret
=
getsockopt
(
sock
,
SOL_SOCKET
,
SO_MAX_MSG_SIZE
,
(
char
*
)
&
optval
,
&
optlen
);
ok
(
ret
==
0
,
"getsockopt failed to query SO_MAX_MSG_SIZE, return value is 0x%08x
\n
"
,
ret
);
ok
(
optval
==
65507
,
"SO_MAX_MSG_SIZE reported %d, expected 65507
\n
"
,
optval
);
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
);
}
closesocket
(
sock
);
if
((
sock
=
socket
(
PF_INET
,
SOCK_STREAM
,
IPPROTO_IP
))
<
0
){
trace
(
"Creating the socket failed: 0x%08x
\n
"
,
WSAGetLastError
());
WSACleanup
();
return
;
}
if
(
bind
(
sock
,
(
struct
sockaddr
*
)
&
sa
,
sa_len
)
<
0
){
trace
(
"Failed to bind socket: 0x%08x
\n
"
,
WSAGetLastError
());
closesocket
(
sock
);
WSACleanup
();
return
;
}
ret
=
getsockopt
(
sock
,
SOL_SOCKET
,
SO_LINGER
,
(
char
*
)
&
linger_val
,
&
optlen
);
ok
(
ret
==
0
,
"getsockopt failed to query SO_LINGER, return value is 0x%08x
\n
"
,
ret
);
optlen
=
sizeof
(
BOOL
);
ret
=
getsockopt
(
sock
,
SOL_SOCKET
,
SO_DONTLINGER
,
(
char
*
)
&
bool_opt_val
,
&
optlen
);
ok
(
ret
==
0
,
"getsockopt failed to query SO_DONTLINGER, return value is 0x%08x
\n
"
,
ret
);
ok
((
linger_val
.
l_onoff
&&
!
bool_opt_val
)
||
(
!
linger_val
.
l_onoff
&&
bool_opt_val
),
"Return value of SO_DONTLINGER is %d, but SO_LINGER returned l_onoff == %d.
\n
"
,
bool_opt_val
,
linger_val
.
l_onoff
);
closesocket
(
sock
);
WSACleanup
();
}
...
...
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