Commit 85229f99 authored by Madaro Livio's avatar Madaro Livio Committed by Youness Alaoui

Keep TURN credentials (realm/nonce) from allocation for the refresh request.

Calling nice_agent_remove_stream will try to release the TURN allocation (lifetime=0)
but it won't work because the CandidateRefresh doesn't contain credentials
for user authentication (if it happens right after the allocation).
The server replies with an authentication error but the client closed the socket
and does not reply to it.
parent c38c3326
......@@ -2250,6 +2250,17 @@ priv_add_new_turn_refresh (CandidateDiscovery *cdisco, NiceCandidate *relay_cand
cand->component = cdisco->component;
cand->agent = cdisco->agent;
memcpy (&cand->stun_agent, &cdisco->stun_agent, sizeof(StunAgent));
/* Use previous stun response for authentication credentials */
if (cdisco->stun_resp_msg.buffer != NULL) {
memcpy(cand->stun_resp_buffer, cdisco->stun_resp_buffer,
sizeof(cand->stun_resp_buffer));
memcpy(&cand->stun_resp_msg, &cdisco->stun_resp_msg, sizeof(StunMessage));
cand->stun_resp_msg.buffer = cand->stun_resp_buffer;
cand->stun_resp_msg.agent = NULL;
cand->stun_resp_msg.key = NULL;
}
nice_debug ("Agent %p : Adding new refresh candidate %p with timeout %d",
agent, cand, (lifetime - 60) * 1000);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment