summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorsergeyu <sergeyu@chromium.org>2016-01-15 16:07:30 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-16 00:08:38 +0000
commit8cf7497b319ee3b7c0fe6449790c13d78a8b61e5 (patch)
tree00eb7388486edc89a48a761ffa44b80a335d5d42 /remoting
parent221cf6eb467969b9d8bcc30bf1794b65a0aa68f6 (diff)
downloadchromium_src-8cf7497b319ee3b7c0fe6449790c13d78a8b61e5.zip
chromium_src-8cf7497b319ee3b7c0fe6449790c13d78a8b61e5.tar.gz
chromium_src-8cf7497b319ee3b7c0fe6449790c13d78a8b61e5.tar.bz2
Update ChromiumPacketSocket factory to apply PacketOptions it receives.
In Chromium libjingle is compiled with ENABLED_EXTERNAL_AUTH. This means that the sending PacketSocketFactory is responsible for updating send time in the outgoing RTP packets and calculating HMAC. ChromiumPacketSocket previously wasn't doing that, so the receiver could not validate the RTP packets. BUG=547158 Review URL: https://codereview.chromium.org/1574353003 Cr-Commit-Position: refs/heads/master@{#369885}
Diffstat (limited to 'remoting')
-rw-r--r--remoting/protocol/chromium_socket_factory.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/remoting/protocol/chromium_socket_factory.cc b/remoting/protocol/chromium_socket_factory.cc
index 6f9dfeb..773657d 100644
--- a/remoting/protocol/chromium_socket_factory.cc
+++ b/remoting/protocol/chromium_socket_factory.cc
@@ -10,12 +10,14 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "base/time/time.h"
#include "jingle/glue/utils.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/udp/udp_server_socket.h"
#include "remoting/protocol/socket_util.h"
+#include "third_party/libjingle/source/talk/media/base/rtputils.h"
#include "third_party/webrtc/base/asyncpacketsocket.h"
#include "third_party/webrtc/base/nethelpers.h"
@@ -194,7 +196,12 @@ int UdpPacketSocket::SendTo(const void* data, size_t data_size,
return EWOULDBLOCK;
}
- send_queue_.push_back(PendingPacket(data, data_size, endpoint));
+ PendingPacket packet(data, data_size, endpoint);
+ cricket::ApplyPacketOptions(
+ reinterpret_cast<uint8_t*>(packet.data->data()), data_size,
+ options.packet_time_params,
+ (base::TimeTicks::Now() - base::TimeTicks()).InMilliseconds());
+ send_queue_.push_back(packet);
send_queue_size_ += data_size;
DoSend();