tiny TCP cleanups
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20815 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
53f23f85a2
commit
a1a9e858a2
@ -384,7 +384,7 @@ EndpointManager::Unbind(TCPEndpoint *endpoint)
|
||||
endpoint->fEndpointNextWithSamePort = NULL;
|
||||
fConnectionHash.Remove(endpoint);
|
||||
|
||||
endpoint->socket->address.ss_len = 0;
|
||||
endpoint->LocalAddress()->sa_len = 0;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
@ -707,7 +707,7 @@ TCPEndpoint::SetReceiveBufferSize(size_t length)
|
||||
bool
|
||||
TCPEndpoint::IsBound() const
|
||||
{
|
||||
return !AddressModule()->is_empty_address((sockaddr *)&socket->address, true);
|
||||
return !AddressModule()->is_empty_address(LocalAddress(), true);
|
||||
}
|
||||
|
||||
|
||||
@ -814,7 +814,7 @@ TCPEndpoint::Spawn(TCPEndpoint *parent, tcp_segment_header &segment,
|
||||
TRACE("Spawn()");
|
||||
|
||||
// TODO: proper error handling!
|
||||
if (_PrepareSendPath((sockaddr *)&socket->peer) < B_OK)
|
||||
if (_PrepareSendPath(PeerAddress()) < B_OK)
|
||||
return DROP;
|
||||
|
||||
fOptions = parent->fOptions;
|
||||
@ -1158,8 +1158,8 @@ TCPEndpoint::_SendQueued(bool force, uint32 sendWindow)
|
||||
return status;
|
||||
}
|
||||
|
||||
AddressModule()->set_to((sockaddr *)&buffer->source, (sockaddr *)&socket->address);
|
||||
AddressModule()->set_to((sockaddr *)&buffer->destination, (sockaddr *)&socket->peer);
|
||||
AddressModule()->set_to((sockaddr *)&buffer->source, LocalAddress());
|
||||
AddressModule()->set_to((sockaddr *)&buffer->destination, PeerAddress());
|
||||
|
||||
uint32 size = buffer->size;
|
||||
segment.sequence = fSendNext;
|
||||
@ -1616,8 +1616,8 @@ TCPEndpoint::_PrepareSendPath(const sockaddr *peer)
|
||||
}
|
||||
|
||||
// make sure connection does not already exist
|
||||
status_t status = fManager->SetConnection(this,
|
||||
(sockaddr *)&socket->address, peer, fRoute->interface->address);
|
||||
status_t status = fManager->SetConnection(this, LocalAddress(), peer,
|
||||
fRoute->interface->address);
|
||||
if (status < B_OK)
|
||||
return status;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user