transmit our timestamp in network order. Fixes a problem with sending data to Linux and BSD hosts which Travis helped debug. Also only update SRTT when data has been acknowledged.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20787 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
56490cf3b7
commit
006e498fa9
@ -1075,7 +1075,7 @@ TCPEndpoint::_SendQueued(bool force, uint32 sendWindow)
|
||||
if (fFlags & FLAG_OPTION_TIMESTAMP) {
|
||||
segment.options |= TCP_HAS_TIMESTAMPS;
|
||||
segment.TSecr = fReceivedTSval;
|
||||
segment.TSval = htonl(tcp_now());
|
||||
segment.TSval = tcp_now();
|
||||
}
|
||||
|
||||
if ((segment.flags & TCP_FLAG_SYNCHRONIZE)
|
||||
@ -1665,15 +1665,15 @@ TCPEndpoint::_Acknowledged(tcp_segment_header &segment)
|
||||
if (fSendUnacknowledged == fSendMax)
|
||||
gStackModule->cancel_timer(&fRetransmitTimer);
|
||||
|
||||
if (fSendQueue.Used() < previouslyUsed) {
|
||||
// this ACK acknowledged data
|
||||
|
||||
if (segment.options & TCP_HAS_TIMESTAMPS)
|
||||
_UpdateSRTT(tcp_diff_timestamp(ntohl(segment.TSecr)));
|
||||
_UpdateSRTT(tcp_diff_timestamp(segment.TSecr));
|
||||
else {
|
||||
// TODO Fallback to RFC 793 type estimation
|
||||
}
|
||||
|
||||
if (fSendQueue.Used() < previouslyUsed) {
|
||||
// this ACK acknowledged data
|
||||
|
||||
if (is_writable(fState)) {
|
||||
// notify threads waiting on the socket to become writable again
|
||||
fSendList.Signal();
|
||||
|
Loading…
Reference in New Issue
Block a user