Skip to content

Commit

Permalink
Merge pull request #89 from bjia56/sdp-newlines
Browse files Browse the repository at this point in the history
ice: fix newlines after candidates
  • Loading branch information
sepfy authored Aug 19, 2024
2 parents f0c639b + 4e8ef32 commit 0d33bbe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ice.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static uint16_t ice_candidate_local_preference(IceCandidate *candidate) {

static void ice_candidate_priority(IceCandidate *candidate) {

// priority = (2^24)*(type preference) + (2^8)*(local preference) + (256 - component ID)
// priority = (2^24)*(type preference) + (2^8)*(local preference) + (256 - component ID)
candidate->priority = (1 << 24) * ice_candidate_type_preference(candidate->type) + (1 << 8) * ice_candidate_local_preference(candidate) + (256 - candidate->component);
}

Expand Down Expand Up @@ -73,7 +73,7 @@ void ice_candidate_to_description(IceCandidate *candidate, char *description, in
}

addr_to_string(&candidate->addr, addr_string, sizeof(addr_string));
snprintf(description, length, "a=candidate:%d %d %s %" PRIu32 " %s %d typ %s\n",
snprintf(description, length, "a=candidate:%d %d %s %" PRIu32 " %s %d typ %s\r\n",
candidate->foundation,
candidate->component,
candidate->transport,
Expand Down Expand Up @@ -119,7 +119,7 @@ int ice_candidate_from_description(IceCandidate *candidate, char *description, c
}
} else if (addr_from_string(buf, &candidate->addr) == 0) {
return -1;
}
}
break;
case 5:
addr_set_port(&candidate->addr, atoi(buf));
Expand Down

0 comments on commit 0d33bbe

Please sign in to comment.