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
7e6b7d21
Commit
7e6b7d21
authored
Nov 28, 2006
by
Kai Blin
Committed by
Alexandre Julliard
Nov 29, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Implement SO_GET_MAX_MSG_SIZE for getsockopt.
parent
d4877a32
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
1 deletion
+56
-1
socket.c
dlls/ws2_32/socket.c
+13
-0
sock.c
dlls/ws2_32/tests/sock.c
+43
-1
No files found.
dlls/ws2_32/socket.c
View file @
7e6b7d21
...
...
@@ -1828,6 +1828,19 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
return
0
;
}
if
(
level
==
WS_SOL_SOCKET
&&
optname
==
WS_SO_MAX_MSG_SIZE
)
{
if
(
!
optlen
||
*
optlen
<
sizeof
(
int
)
||
!
optval
)
{
SetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
TRACE
(
"getting global SO_MAX_MSG_SIZE = 65507
\n
"
);
*
(
int
*
)
optval
=
65507
;
*
optlen
=
sizeof
(
int
);
return
0
;
}
#ifdef HAVE_IPX
if
(
level
==
NSPROTO_IPX
)
{
...
...
dlls/ws2_32/tests/sock.c
View file @
7e6b7d21
...
...
@@ -1410,6 +1410,47 @@ static void test_select(void)
}
static
void
test_extendedSocketOptions
()
{
WSADATA
wsa
;
SOCKET
sock
;
struct
sockaddr_in
sa
;
int
sa_len
=
sizeof
(
struct
sockaddr_in
);
int
optval
,
optlen
=
sizeof
(
int
),
ret
;
if
(
WSAStartup
(
MAKEWORD
(
2
,
0
),
&
wsa
)){
trace
(
"Winsock failed: 0x%08x. Aborting test
\n
"
,
WSAGetLastError
());
return
;
}
memset
(
&
sa
,
0
,
sa_len
);
sa
.
sin_family
=
AF_INET
;
sa
.
sin_port
=
htons
(
0
);
sa
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
if
((
sock
=
socket
(
PF_INET
,
SOCK_DGRAM
,
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_MAX_MSG_SIZE
,
(
char
*
)
&
optval
,
(
int
*
)
&
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
);
closesocket
(
sock
);
WSACleanup
();
}
/**************** Main program ***************/
START_TEST
(
sock
)
...
...
@@ -1419,6 +1460,7 @@ START_TEST( sock )
test_set_getsockopt
();
test_so_reuseaddr
();
test_extendedSocketOptions
();
for
(
i
=
0
;
i
<
NUM_TESTS
;
i
++
)
{
...
...
@@ -1438,6 +1480,6 @@ START_TEST( sock )
test_WSAStringToAddressW
();
test_select
();
Exit
();
}
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