Bug 1184226 - Suppressing received packets when disabled, r=ekr
authorMartin Thomson <martin.thomson@gmail.com>
Wed, 15 Jul 2015 13:03:01 -0700
changeset 253057 af0cd6e1245cdabe14bf735607081e34df2f95a8
parent 253056 ba76c8f3b3737ec19204f52bd7820f885bee803e
child 253058 68404184c42f483a1895453858f208a3e4d6feb0
push id62329
push usermartin.thomson@gmail.com
push dateWed, 15 Jul 2015 20:03:27 +0000
treeherdermozilla-inbound@af0cd6e1245c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersekr
bugs1184226
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1184226 - Suppressing received packets when disabled, r=ekr
media/mtransport/transportlayerdtls.cpp
--- a/media/mtransport/transportlayerdtls.cpp
+++ b/media/mtransport/transportlayerdtls.cpp
@@ -70,18 +70,20 @@ struct Packet {
     len_ = len;
   }
 
   UniquePtr<uint8_t[]> data_;
   int32_t len_;
 };
 
 void TransportLayerNSPRAdapter::PacketReceived(const void *data, int32_t len) {
-  input_.push(new Packet());
-  input_.back()->Assign(data, len);
+  if (enabled_) {
+    input_.push(new Packet());
+    input_.back()->Assign(data, len);
+  }
 }
 
 int32_t TransportLayerNSPRAdapter::Recv(void *buf, int32_t buflen) {
   if (input_.empty()) {
     PR_SetError(PR_WOULD_BLOCK_ERROR, 0);
     return -1;
   }