udp: set is_connected flag on our socket once connected.

Change-Id: Ie5fcc5152af813d74d33c20ed7c3e81f9e828518
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2548
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Jérôme Duval 2020-05-01 23:53:19 +02:00 committed by waddlesplash
parent 0424248dcb
commit a03ed4fa08
2 changed files with 9 additions and 1 deletions

View File

@ -384,7 +384,10 @@ UdpDomainSupport::ConnectEndpoint(UdpEndpoint *endpoint,
// we need to activate no matter whether or not we have just disconnected,
// as calling connect() always triggers an implicit bind():
return _BindEndpoint(endpoint, *endpoint->LocalAddress());
status_t status = _BindEndpoint(endpoint, *endpoint->LocalAddress());
if (status == B_OK)
gSocketModule->set_connected(endpoint->Socket());
return status;
}

View File

@ -829,6 +829,11 @@ socket_connected(net_socket* _socket)
TRACE("socket_connected(%p)\n", socket);
if (socket->parent == NULL) {
socket->is_connected = true;
return B_OK;
}
BReference<net_socket_private> parent = socket->parent.GetReference();
if (parent.Get() == NULL)
return B_BAD_VALUE;