Browse Source

srtp re-invite fixes

git.mgm/mediaproxy-ng/github/master
Richard Fuchs 13 years ago
parent
commit
de5b172f32
3 changed files with 6 additions and 9 deletions
  1. +2
    -1
      daemon/call.c
  2. +1
    -7
      daemon/crypto.h
  3. +3
    -1
      tests/simulator-ng.pl

+ 2
- 1
daemon/call.c View File

@ -1376,7 +1376,8 @@ static void steal_peer(struct peer *dest, struct peer *src) {
sr->peer_advertised = srs->peer_advertised;
sr->stun = srs->stun;
sr->rtcp = srs->rtcp;
crypto_context_move(&sr->crypto.in, &srs->crypto.in);
crypto_context_move(&sr->other->crypto.in, &srs->other->crypto.in);
crypto_context_move(&sr->crypto.out, &srs->crypto.out);
srs->fd.fd = -1;


+ 1
- 7
daemon/crypto.h View File

@ -116,12 +116,6 @@ static inline void crypto_cleanup(struct crypto_context *c) {
if (c->crypto_suite->session_key_cleanup)
c->crypto_suite->session_key_cleanup(c);
}
static inline void crypto_context_pair_uninit(struct crypto_context_pair *p) {
p->in.session_key_ctx[0] = NULL;
p->in.session_key_ctx[1] = NULL;
p->out.session_key_ctx[0] = NULL;
p->out.session_key_ctx[1] = NULL;
}
static inline void crypto_context_move(struct crypto_context *dst, struct crypto_context *src) {
int i;
@ -129,7 +123,7 @@ static inline void crypto_context_move(struct crypto_context *dst, struct crypto
return;
crypto_cleanup(dst);
*dst = *src;
for (i = 0; i < G_N_ELEMENTS(dst->session_key_ctx); i++)
for (i = 0; i < G_N_ELEMENTS(src->session_key_ctx); i++)
src->session_key_ctx[i] = NULL;
}


+ 3
- 1
tests/simulator-ng.pl View File

@ -626,6 +626,7 @@ sub update_lookup {
for my $j (0 .. $num_streams) {
if (!$$fds_t[$j]) {
$NUM_STREAMS++;
undef($$tcx_o{in});
while (1) {
undef($$fds_t[$j]);
undef($$cfds_t[$j]);
@ -664,7 +665,7 @@ a=rtcp:$cp
!
$$tr{sdp_media_params} and $sdp .= $$tr{sdp_media_params}($tcx);
}
# $i or print("transport is $$tr{name} -> $$tr_o{name}\n");
$i or print("transport is $$tr{name} -> $$tr_o{name}\n");
my $dict = {sdp => $sdp, command => $commands[$i], 'call-id' => $callid,
'from-tag' => $$tags[0],
@ -743,6 +744,7 @@ while (time() < $end) {
if (rand() < .5) {
print(", side $sides[$i]: new port");
undef($$c{fds}[$i]);
$NUM_STREAMS--;
}
else {
print(", side $sides[$i]: same port");


Loading…
Cancel
Save