Skip to content

Commit

Permalink
Merge pull request #135 from Sean-Der/use-candidate
Browse files Browse the repository at this point in the history
Only send STUN USE_CANDIDATE if controlling Agent
  • Loading branch information
sepfy authored Sep 20, 2024
2 parents e673618 + 2ba058d commit b87a511
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ static void agent_create_binding_request(Agent* agent, StunMessage* msg) {
snprintf(username, sizeof(username), "%s:%s", agent->remote_ufrag, agent->local_ufrag);
stun_msg_write_attr(msg, STUN_ATTR_TYPE_USERNAME, strlen(username), username);
stun_msg_write_attr(msg, STUN_ATTR_TYPE_PRIORITY, 4, (char*)&agent->nominated_pair->priority);
stun_msg_write_attr(msg, STUN_ATTR_TYPE_USE_CANDIDATE, 0, NULL);
if (agent->mode == AGENT_MODE_CONTROLLING) {
stun_msg_write_attr(msg, STUN_ATTR_TYPE_USE_CANDIDATE, 0, NULL);
}
stun_msg_write_attr(msg, STUN_ATTR_TYPE_ICE_CONTROLLED, 8, (char*)&tie_breaker);
stun_msg_finish(msg, STUN_CREDENTIAL_SHORT_TERM, agent->remote_upwd, strlen(agent->remote_upwd));
}
Expand Down

0 comments on commit b87a511

Please sign in to comment.