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
1422a566
Commit
1422a566
authored
Oct 02, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Always return the source address from WSAAccept.
parent
260119e6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
15 deletions
+18
-15
socket.c
dlls/ws2_32/socket.c
+15
-12
sock.c
dlls/ws2_32/tests/sock.c
+3
-3
No files found.
dlls/ws2_32/socket.c
View file @
1422a566
...
...
@@ -6555,7 +6555,7 @@ SOCKET WINAPI WSAAccept( SOCKET s, struct WS_sockaddr *addr, LPINT addrlen,
LPCONDITIONPROC
lpfnCondition
,
DWORD_PTR
dwCallbackData
)
{
int
ret
=
0
,
size
=
0
;
int
ret
=
0
,
size
;
WSABUF
CallerId
,
CallerData
,
CalleeId
,
CalleeData
;
/* QOS SQOS, GQOS; */
GROUP
g
;
...
...
@@ -6565,34 +6565,37 @@ SOCKET WINAPI WSAAccept( SOCKET s, struct WS_sockaddr *addr, LPINT addrlen,
TRACE
(
"Socket %04lx, sockaddr %p, addrlen %p, fnCondition %p, dwCallbackData %ld
\n
"
,
s
,
addr
,
addrlen
,
lpfnCondition
,
dwCallbackData
);
size
=
sizeof
(
src_addr
);
cs
=
WS_accept
(
s
,
&
src_addr
,
&
size
);
cs
=
WS_accept
(
s
,
addr
,
addrlen
);
if
(
cs
==
SOCKET_ERROR
)
return
SOCKET_ERROR
;
if
(
!
lpfnCondition
)
return
cs
;
CallerId
.
buf
=
(
char
*
)
&
src_addr
;
CallerId
.
len
=
sizeof
(
src_addr
);
if
(
addr
&&
addrlen
)
{
CallerId
.
buf
=
(
char
*
)
addr
;
CallerId
.
len
=
*
addrlen
;
}
else
{
size
=
sizeof
(
src_addr
);
WS_getpeername
(
cs
,
&
src_addr
,
&
size
);
CallerId
.
buf
=
(
char
*
)
&
src_addr
;
CallerId
.
len
=
size
;
}
CallerData
.
buf
=
NULL
;
CallerData
.
len
=
0
;
size
=
sizeof
(
dst_addr
);
WS_getsockname
(
cs
,
&
dst_addr
,
&
size
);
CalleeId
.
buf
=
(
char
*
)
&
dst_addr
;
CalleeId
.
len
=
sizeof
(
dst_addr
);
ret
=
(
*
lpfnCondition
)(
&
CallerId
,
&
CallerData
,
NULL
,
NULL
,
&
CalleeId
,
&
CalleeData
,
&
g
,
dwCallbackData
);
switch
(
ret
)
{
case
CF_ACCEPT
:
if
(
addr
&&
addrlen
)
memcpy
(
addr
,
&
src_addr
,
(
*
addrlen
>
size
)
?
size
:
*
addrlen
);
return
cs
;
case
CF_DEFER
:
SERVER_START_REQ
(
set_socket_deferred
)
...
...
dlls/ws2_32/tests/sock.c
View file @
1422a566
...
...
@@ -3246,7 +3246,7 @@ static void test_accept(void)
socklen
=
0
;
accepted
=
WSAAccept
(
server_socket
,
(
struct
sockaddr
*
)
&
ss
,
&
socklen
,
NULL
,
0
);
todo_wine
ok
(
accepted
==
INVALID_SOCKET
&&
WSAGetLastError
()
==
WSAEFAULT
,
"got %d
\n
"
,
WSAGetLastError
());
ok
(
accepted
==
INVALID_SOCKET
&&
WSAGetLastError
()
==
WSAEFAULT
,
"got %d
\n
"
,
WSAGetLastError
());
ok
(
!
socklen
,
"got %d
\n
"
,
socklen
);
closesocket
(
connector
);
connector
=
INVALID_SOCKET
;
...
...
@@ -3269,8 +3269,8 @@ static void test_accept(void)
memset
(
&
ss
,
0
,
sizeof
(
ss
));
accepted
=
WSAAccept
(
server_socket
,
(
struct
sockaddr
*
)
&
ss
,
&
socklen
,
NULL
,
0
);
ok
(
accepted
!=
INVALID_SOCKET
,
"Failed to accept connection, %d
\n
"
,
WSAGetLastError
());
todo_wine
ok
(
socklen
!=
sizeof
(
ss
),
"unexpected length
\n
"
);
todo_wine
ok
(
ss
.
ss_family
,
"family not set
\n
"
);
ok
(
socklen
!=
sizeof
(
ss
),
"unexpected length
\n
"
);
ok
(
ss
.
ss_family
,
"family not set
\n
"
);
closesocket
(
accepted
);
closesocket
(
connector
);
accepted
=
connector
=
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