From 0a42f4aa263145d37ab0a96882c7d44fa01071dc Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 7 May 2014 08:53:33 -0400 Subject: [PATCH] fix timeout handling for silenced streams --- daemon/call.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 4c07229f5..045e43f3f 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -815,9 +815,11 @@ static void call_timer_iterator(void *key, void *val, void *ptr) { ps = it->data; mutex_lock(&ps->in_lock); - sfd = ps->sfd; - if (!sfd || !ps->media) + if (!ps->media) goto next; + sfd = ps->sfd; + if (!sfd) + goto no_sfd; if (MEDIA_ISSET(ps->media, DTLS) && sfd->dtls.init && !sfd->dtls.connected) dtls(ps, NULL, NULL); @@ -827,11 +829,12 @@ static void call_timer_iterator(void *key, void *val, void *ptr) { hlp->ports[sfd->fd.localport] = sfd; obj_hold(sfd); +no_sfd: if (good) goto next; check = cm->conf.timeout; - if (!MEDIA_ISSET(ps->media, RECV) || !ps->sfd) + if (!MEDIA_ISSET(ps->media, RECV) || !sfd) check = cm->conf.silent_timeout; if (poller_now - ps->last_packet < check)