mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 17:40:23 +00:00
vcap/rtsp: support userinfo with password in URI
The colon before password was incorrectly assumed to be a port number.
This commit is contained in:
@@ -477,11 +477,15 @@ check_uri(size_t uri_len, char *uri)
|
||||
return false;
|
||||
}
|
||||
char *authority = uri + strlen(rtsp_uri_pref);
|
||||
if (strchr(authority, ':') == NULL) {
|
||||
char *host = authority;
|
||||
if (strchr(authority, '@') != NULL) { // skip userinfo
|
||||
host = strchr(authority, '@') + 1;
|
||||
}
|
||||
if (strchr(host, ':') == NULL) {
|
||||
char *path = NULL;
|
||||
if (strchr(authority, '/') != NULL) { // store path
|
||||
path = strdup(strchr(authority, '/') + 1);
|
||||
*strchr(authority, '/') = '\0';
|
||||
if (strchr(host, '/') != NULL) { // store path
|
||||
path = strdup(strchr(host, '/') + 1);
|
||||
*strchr(host, '/') = '\0';
|
||||
}
|
||||
snprintf(uri + strlen(uri), uri_len - strlen(uri), ":%d",
|
||||
DEFAULT_RTSP_PORT);
|
||||
|
||||
Reference in New Issue
Block a user