Browse Source

need to handle the no-reply case to avoid deadlocks with bad cookies

git.mgm/mediaproxy-ng/2.1
Richard Fuchs 14 years ago
parent
commit
4cb63b5edf
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      daemon/control_udp.c

+ 8
- 0
daemon/control_udp.c View File

@ -173,10 +173,18 @@ restart:
mutex_lock(&u->lock);
g_hash_table_replace(u->fresh_cookies, g_string_chunk_insert(u->fresh_chunks, out[RE_UDP_COOKIE]),
g_string_chunk_insert(u->fresh_chunks, reply));
g_hash_table_remove(u->stale_cookies, out[RE_UDP_COOKIE]);
cond_broadcast(&u->cond);
mutex_unlock(&u->lock);
free(reply);
}
else {
mutex_lock(&u->lock);
g_hash_table_remove(u->fresh_cookies, out[RE_UDP_COOKIE]);
g_hash_table_remove(u->stale_cookies, out[RE_UDP_COOKIE]);
cond_broadcast(&u->cond);
mutex_unlock(&u->lock);
}
out:
pcre_free(out);


Loading…
Cancel
Save