[raop] Put ipv6 IP literals in brackets as per rfc3986

This commit is contained in:
ejurgensen 2018-09-16 22:19:27 +02:00
parent 2a9d3f7474
commit 97233d4753

View File

@ -1611,7 +1611,10 @@ raop_send_req_announce(struct raop_session *rs, evrtsp_req_cb cb, const char *lo
/* Session ID and session URL */
gcry_randomize(&session_id, sizeof(session_id), GCRY_STRONG_RANDOM);
ret = snprintf(rs->session_url, sizeof(rs->session_url), "rtsp://%s/%u", address, session_id);
if (family == AF_INET)
ret = snprintf(rs->session_url, sizeof(rs->session_url), "rtsp://%s/%u", address, session_id);
else
ret = snprintf(rs->session_url, sizeof(rs->session_url), "rtsp://[%s]/%u", address, session_id);
if ((ret < 0) || (ret >= sizeof(rs->session_url)))
{
DPRINTF(E_LOG, L_RAOP, "Session URL length exceeds 127 characters\n");