Browse Source

avoid unnecessary DTLS restarts

fixes #47

thanks to szcom for debugging this
pull/53/head
Richard Fuchs 11 years ago
parent
commit
407722599b
2 changed files with 7 additions and 3 deletions
  1. +5
    -3
      daemon/call.c
  2. +2
    -0
      daemon/dtls.c

+ 5
- 3
daemon/call.c View File

@ -1726,7 +1726,7 @@ static void __fill_stream(struct packet_stream *ps, const struct endpoint *ep, u
ps->endpoint = *ep;
ps->endpoint.port += port_off;
/* we reset crypto params whenever the endpoint changes */
if (memcmp(&ps->advertised_endpoint, &ps->endpoint, sizeof(ps->endpoint))) {
if (PS_ISSET(ps, FILLED) && memcmp(&ps->advertised_endpoint, &ps->endpoint, sizeof(ps->endpoint))) {
crypto_reset(&ps->crypto);
dtls_shutdown(ps);
}
@ -2016,8 +2016,10 @@ static void __fingerprint_changed(struct call_media *m) {
GList *l;
struct packet_stream *ps;
if (m->fingerprint.hash_func)
ilog(LOG_INFO, "DTLS fingerprint changed, restarting DTLS");
if (!m->fingerprint.hash_func)
return;
ilog(LOG_INFO, "DTLS fingerprint changed, restarting DTLS");
for (l = m->streams.head; l; l = l->next) {
ps = l->data;


+ 2
- 0
daemon/dtls.c View File

@ -684,6 +684,8 @@ void dtls_shutdown(struct packet_stream *ps) {
if (!ps || !ps->sfd)
return;
__DBG("dtls_shutdown");
d = &ps->sfd->dtls;
if (!d->init)
return;


Loading…
Cancel
Save