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
4028a0e9
Commit
4028a0e9
authored
Jul 28, 2009
by
Jeff Latimer
Committed by
Alexandre Julliard
Aug 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Add the port to the IPv6 address string if present.
parent
4814d67e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
socket.c
dlls/ws2_32/socket.c
+6
-1
sock.c
dlls/ws2_32/tests/sock.c
+0
-6
No files found.
dlls/ws2_32/socket.c
View file @
4028a0e9
...
...
@@ -4958,12 +4958,17 @@ INT WINAPI WSAAddressToStringA( LPSOCKADDR sockaddr, DWORD len,
{
struct
WS_sockaddr_in6
*
sockaddr6
=
(
LPSOCKADDR_IN6
)
sockaddr
;
buffer
[
0
]
=
0
;
if
(
len
<
sizeof
(
SOCKADDR_IN6
))
return
SOCKET_ERROR
;
if
(
!
WS_inet_ntop
(
WS_AF_INET6
,
&
sockaddr6
->
sin6_addr
,
buffer
,
sizeof
(
buffer
)))
if
((
sockaddr6
->
sin6_port
))
strcpy
(
buffer
,
"["
);
if
(
!
WS_inet_ntop
(
WS_AF_INET6
,
&
sockaddr6
->
sin6_addr
,
buffer
+
strlen
(
buffer
),
sizeof
(
buffer
)))
{
WSASetLastError
(
WSAEINVAL
);
return
SOCKET_ERROR
;
}
if
((
sockaddr6
->
sin6_port
))
sprintf
(
buffer
+
strlen
(
buffer
),
"]:%u"
,
ntohs
(
sockaddr6
->
sin6_port
));
break
;
}
...
...
dlls/ws2_32/tests/sock.c
View file @
4028a0e9
...
...
@@ -1429,11 +1429,8 @@ static void test_WSAAddressToStringA(void)
ret
=
WSAAddressToStringA
(
(
SOCKADDR
*
)
&
sockaddr6
,
sizeof
(
sockaddr6
),
NULL
,
address6
,
&
len
);
ok
(
!
ret
,
"WSAAddressToStringA() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
todo_wine
{
ok
(
!
strcmp
(
address6
,
expect6_3
),
"Expected: %s, got: %s
\n
"
,
expect6_3
,
address6
);
ok
(
len
==
sizeof
(
expect6_3
),
"Got size %d
\n
"
,
len
);
}
/* Test IPv6 address, port number and scope_id */
len
=
sizeof
(
address6
);
...
...
@@ -1603,11 +1600,8 @@ static void test_WSAAddressToStringW(void)
ret
=
WSAAddressToStringW
(
(
SOCKADDR
*
)
&
sockaddr6
,
sizeof
(
sockaddr6
),
NULL
,
address6
,
&
len
);
ok
(
!
ret
,
"WSAAddressToStringW() failed unexpectedly: %d
\n
"
,
WSAGetLastError
()
);
todo_wine
{
ok
(
!
lstrcmpW
(
address6
,
expect6_3
),
"Wrong string returned
\n
"
);
ok
(
len
==
sizeof
(
expect6_3
)
/
sizeof
(
WCHAR
),
"Got %d
\n
"
,
len
);
}
/* Test IPv6 address, port number and scope_id */
len
=
sizeof
(
address6
)
/
sizeof
(
WCHAR
);
...
...
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