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