aboutsummaryrefslogtreecommitdiff
path: root/plugins/ice/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ice/src')
-rw-r--r--plugins/ice/src/dtls_srtp.vala10
-rw-r--r--plugins/ice/src/transport_parameters.vala8
2 files changed, 12 insertions, 6 deletions
diff --git a/plugins/ice/src/dtls_srtp.vala b/plugins/ice/src/dtls_srtp.vala
index 8a9b5dfa..e8fc01c7 100644
--- a/plugins/ice/src/dtls_srtp.vala
+++ b/plugins/ice/src/dtls_srtp.vala
@@ -216,9 +216,7 @@ public class Handler {
private static int pull_timeout_function(void* transport_ptr, uint ms) {
Handler self = transport_ptr as Handler;
- DateTime current_time = new DateTime.now_utc();
- current_time.add_seconds(ms/1000);
- int64 end_time = current_time.to_unix();
+ int64 end_time = get_monotonic_time() + ms * 1000;
self.buffer_mutex.lock();
while (self.buffer_queue.size == 0) {
@@ -228,9 +226,9 @@ public class Handler {
return -1;
}
- DateTime new_current_time = new DateTime.now_utc();
- if (new_current_time.compare(current_time) > 0) {
- break;
+ if (get_monotonic_time() > end_time) {
+ self.buffer_mutex.unlock();
+ return 0;
}
}
self.buffer_mutex.unlock();
diff --git a/plugins/ice/src/transport_parameters.vala b/plugins/ice/src/transport_parameters.vala
index e4862edc..f854a367 100644
--- a/plugins/ice/src/transport_parameters.vala
+++ b/plugins/ice/src/transport_parameters.vala
@@ -40,6 +40,7 @@ public class Dino.Plugins.Ice.TransportParameters : JingleIceUdp.IceUdpTransport
yield base.terminate(we_terminated, reason_string, reason_text);
this.disconnect(datagram_received_id);
agent = null;
+ dtls_srtp_handler = null;
}
public override void send_datagram(Bytes datagram) {
@@ -324,4 +325,11 @@ public class Dino.Plugins.Ice.TransportParameters : JingleIceUdp.IceUdpTransport
return candidate;
}
+
+ public override void dispose() {
+ base.dispose();
+ agent = null;
+ dtls_srtp_handler = null;
+ connections.clear();
+ }
}