| Index: net/tools/quic/quic_packet_reader.cc
|
| diff --git a/net/tools/quic/quic_packet_reader.cc b/net/tools/quic/quic_packet_reader.cc
|
| index e239e58c72d53a250ffb2aa57cca7b125fce6cea..f81fcec1d7891c7270d0a4720775ef6ed9be0369 100644
|
| --- a/net/tools/quic/quic_packet_reader.cc
|
| +++ b/net/tools/quic/quic_packet_reader.cc
|
| @@ -98,7 +98,6 @@ bool QuicPacketReader::ReadAndDispatchManyPackets(
|
| return false; // recvmmsg failed.
|
| }
|
|
|
| - QuicTime fallback_timestamp = QuicTime::Zero();
|
| QuicWallTime fallback_walltimestamp = QuicWallTime::Zero();
|
| for (int i = 0; i < packets_read; ++i) {
|
| if (mmsg_hdr_[i].msg_len == 0) {
|
| @@ -114,12 +113,9 @@ bool QuicPacketReader::ReadAndDispatchManyPackets(
|
|
|
| IPEndPoint client_address = IPEndPoint(packets_[i].raw_address);
|
| IPAddress server_ip;
|
| - QuicTime packet_timestamp = QuicTime::Zero();
|
| QuicWallTime packet_walltimestamp = QuicWallTime::Zero();
|
| - bool latched_walltimestamps = FLAGS_quic_socket_walltimestamps;
|
| QuicSocketUtils::GetAddressAndTimestampFromMsghdr(
|
| - &mmsg_hdr_[i].msg_hdr, &server_ip, &packet_timestamp,
|
| - &packet_walltimestamp, latched_walltimestamps);
|
| + &mmsg_hdr_[i].msg_hdr, &server_ip, &packet_walltimestamp);
|
| if (!IsInitializedAddress(server_ip)) {
|
| QUIC_BUG << "Unable to get server address.";
|
| continue;
|
| @@ -127,24 +123,15 @@ bool QuicPacketReader::ReadAndDispatchManyPackets(
|
|
|
| // This isn't particularly desirable, but not all platforms support socket
|
| // timestamping.
|
| - if (latched_walltimestamps) {
|
| - if (packet_walltimestamp.IsZero()) {
|
| - if (fallback_walltimestamp.IsZero()) {
|
| - fallback_walltimestamp = clock.WallNow();
|
| - }
|
| - packet_walltimestamp = fallback_walltimestamp;
|
| - }
|
| - packet_timestamp = clock.ConvertWallTimeToQuicTime(packet_walltimestamp);
|
| - } else {
|
| - if (packet_timestamp == QuicTime::Zero()) {
|
| - if (fallback_timestamp == QuicTime::Zero()) {
|
| - fallback_timestamp = clock.Now();
|
| - }
|
| - packet_timestamp = fallback_timestamp;
|
| + if (packet_walltimestamp.IsZero()) {
|
| + if (fallback_walltimestamp.IsZero()) {
|
| + fallback_walltimestamp = clock.WallNow();
|
| }
|
| + packet_walltimestamp = fallback_walltimestamp;
|
| }
|
| + QuicTime timestamp = clock.ConvertWallTimeToQuicTime(packet_walltimestamp);
|
| QuicReceivedPacket packet(reinterpret_cast<char*>(packets_[i].iov.iov_base),
|
| - mmsg_hdr_[i].msg_len, packet_timestamp, false);
|
| + mmsg_hdr_[i].msg_len, timestamp, false);
|
| IPEndPoint server_address(server_ip, port);
|
| processor->ProcessPacket(server_address, client_address, packet);
|
| }
|
| @@ -169,17 +156,14 @@ bool QuicPacketReader::ReadAndDispatchSinglePacket(
|
| const QuicClock& clock,
|
| ProcessPacketInterface* processor,
|
| QuicPacketCount* packets_dropped) {
|
| - bool latched_walltimestamps = FLAGS_quic_socket_walltimestamps;
|
| char buf[kMaxPacketSize];
|
|
|
| IPEndPoint client_address;
|
| IPAddress server_ip;
|
| - QuicTime timestamp = QuicTime::Zero();
|
| QuicWallTime walltimestamp = QuicWallTime::Zero();
|
| - int bytes_read = QuicSocketUtils::ReadPacket(
|
| - fd, buf, arraysize(buf), packets_dropped, &server_ip, ×tamp,
|
| - &walltimestamp, latched_walltimestamps, &client_address);
|
| -
|
| + int bytes_read =
|
| + QuicSocketUtils::ReadPacket(fd, buf, arraysize(buf), packets_dropped,
|
| + &server_ip, &walltimestamp, &client_address);
|
| if (bytes_read < 0) {
|
| return false; // ReadPacket failed.
|
| }
|
| @@ -190,16 +174,10 @@ bool QuicPacketReader::ReadAndDispatchSinglePacket(
|
| }
|
| // This isn't particularly desirable, but not all platforms support socket
|
| // timestamping.
|
| - if (latched_walltimestamps) {
|
| - if (walltimestamp.IsZero()) {
|
| - walltimestamp = clock.WallNow();
|
| - }
|
| - timestamp = clock.ConvertWallTimeToQuicTime(walltimestamp);
|
| - } else {
|
| - if (timestamp == QuicTime::Zero()) {
|
| - timestamp = clock.Now();
|
| - }
|
| + if (walltimestamp.IsZero()) {
|
| + walltimestamp = clock.WallNow();
|
| }
|
| + QuicTime timestamp = clock.ConvertWallTimeToQuicTime(walltimestamp);
|
|
|
| QuicReceivedPacket packet(buf, bytes_read, timestamp, false);
|
| IPEndPoint server_address(server_ip, port);
|
|
|