diff options
Diffstat (limited to 'p2p/base/relayport.cc')
-rw-r--r-- | p2p/base/relayport.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/p2p/base/relayport.cc b/p2p/base/relayport.cc index ff8c07c..ddfca71 100644 --- a/p2p/base/relayport.cc +++ b/p2p/base/relayport.cc @@ -155,10 +155,11 @@ class RelayEntry : public talk_base::MessageHandler, void OnSocketClose(talk_base::AsyncPacketSocket* socket, int error); // Called when a packet is received on this socket. - void OnReadPacket(talk_base::AsyncPacketSocket* socket, - const char* data, size_t size, - const talk_base::SocketAddress& remote_addr); - + void OnReadPacket( + talk_base::AsyncPacketSocket* socket, + const char* data, size_t size, + const talk_base::SocketAddress& remote_addr, + const talk_base::PacketTime& packet_time); // Called when the socket is currently able to send. void OnReadyToSend(talk_base::AsyncPacketSocket* socket); @@ -393,9 +394,11 @@ int RelayPort::GetError() { void RelayPort::OnReadPacket( const char* data, size_t size, - const talk_base::SocketAddress& remote_addr, ProtocolType proto) { + const talk_base::SocketAddress& remote_addr, + ProtocolType proto, + const talk_base::PacketTime& packet_time) { if (Connection* conn = GetConnection(remote_addr)) { - conn->OnReadPacket(data, size); + conn->OnReadPacket(data, size, packet_time); } else { Port::OnReadPacket(data, size, remote_addr, proto); } @@ -682,9 +685,11 @@ void RelayEntry::OnSocketClose(talk_base::AsyncPacketSocket* socket, HandleConnectFailure(socket); } -void RelayEntry::OnReadPacket(talk_base::AsyncPacketSocket* socket, - const char* data, size_t size, - const talk_base::SocketAddress& remote_addr) { +void RelayEntry::OnReadPacket( + talk_base::AsyncPacketSocket* socket, + const char* data, size_t size, + const talk_base::SocketAddress& remote_addr, + const talk_base::PacketTime& packet_time) { // ASSERT(remote_addr == port_->server_addr()); // TODO: are we worried about this? @@ -698,7 +703,7 @@ void RelayEntry::OnReadPacket(talk_base::AsyncPacketSocket* socket, // by the server, The actual remote address is the one we recorded. if (!port_->HasMagicCookie(data, size)) { if (locked_) { - port_->OnReadPacket(data, size, ext_addr_, PROTO_UDP); + port_->OnReadPacket(data, size, ext_addr_, PROTO_UDP, packet_time); } else { LOG(WARNING) << "Dropping packet: entry not locked"; } @@ -751,7 +756,7 @@ void RelayEntry::OnReadPacket(talk_base::AsyncPacketSocket* socket, // Process the actual data and remote address in the normal manner. port_->OnReadPacket(data_attr->bytes(), data_attr->length(), remote_addr2, - PROTO_UDP); + PROTO_UDP, packet_time); } void RelayEntry::OnReadyToSend(talk_base::AsyncPacketSocket* socket) { |