ws2_32: Allow getsockname after AcceptEx.
.NET 6's HTTP/Socket code queries this. Winsock allows getsockname
on the AcceptEx AcceptSocket, but only if SO_UPDATE_ACCEPT_CONTEXT
is set.
Signed-off-by: David Curtiss <david.curtiss@ni.com>
(cherry picked from commit 68d4643a67
)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
parent
4cf98d91cf
commit
88c2d88df0
2 changed files with 10 additions and 0 deletions
|
@ -7507,6 +7507,15 @@ todo_wine
|
|||
ok(bret, "GetOverlappedResult failed, error %d\n", GetLastError());
|
||||
ok(bytesReturned == 0, "bytesReturned isn't supposed to be %d\n", bytesReturned);
|
||||
|
||||
/* Try to call getsockname on the acceptor socket.
|
||||
*
|
||||
* On Windows, this requires setting SO_UPDATE_ACCEPT_CONTEXT. */
|
||||
iret = setsockopt(acceptor, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, (char *)&listener, sizeof(SOCKET));
|
||||
ok(!iret, "Failed to set accept context %d\n", GetLastError());
|
||||
iret = getsockname(acceptor, (struct sockaddr *)&peerAddress, &remoteSize);
|
||||
ok(!iret, "getsockname failed.\n");
|
||||
ok(remoteSize == sizeof(struct sockaddr_in), "got remote size %u\n", remoteSize);
|
||||
|
||||
closesocket(connector);
|
||||
connector = INVALID_SOCKET;
|
||||
closesocket(acceptor);
|
||||
|
|
|
@ -1785,6 +1785,7 @@ static int accept_into_socket( struct sock *sock, struct sock *acceptsock )
|
|||
}
|
||||
|
||||
acceptsock->state = SOCK_CONNECTED;
|
||||
acceptsock->bound = 1;
|
||||
acceptsock->pending_events = 0;
|
||||
acceptsock->reported_events = 0;
|
||||
acceptsock->proto = sock->proto;
|
||||
|
|
Loading…
Add table
Reference in a new issue