mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-04 18:47:07 +00:00
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>
This commit is contained in:
parent
26ab701072
commit
68d4643a67
|
@ -8143,6 +8143,15 @@ static void test_AcceptEx(void)
|
|||
ok(bret, "GetOverlappedResult failed, error %ld\n", GetLastError());
|
||||
ok(bytesReturned == 0, "bytesReturned isn't supposed to be %ld\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 %ld\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);
|
||||
|
|
|
@ -1846,6 +1846,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…
Reference in a new issue