mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-10 11:13:01 +00:00
Reconstruct the RTSP URL, in order to remove the auth part from the URL sent to the server
Don't modify the user-specified s->filename at all, keep all modifications locally and in rt->control_uri. Originally committed as revision 22642 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
a8bb9ea532
commit
2a21adf924
@ -1451,7 +1451,9 @@ redirect:
|
|||||||
/* search for options */
|
/* search for options */
|
||||||
option_list = strchr(path, '?');
|
option_list = strchr(path, '?');
|
||||||
if (option_list) {
|
if (option_list) {
|
||||||
filename = strchr(s->filename, '?');
|
/* Strip out the RTSP specific options, write out the rest of
|
||||||
|
* the options back into the same string. */
|
||||||
|
filename = option_list;
|
||||||
while (option_list) {
|
while (option_list) {
|
||||||
/* move the option pointer */
|
/* move the option pointer */
|
||||||
option = ++option_list;
|
option = ++option_list;
|
||||||
@ -1467,8 +1469,11 @@ redirect:
|
|||||||
} else if (!strcmp(option, "tcp")) {
|
} else if (!strcmp(option, "tcp")) {
|
||||||
lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_TCP);
|
lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_TCP);
|
||||||
} else {
|
} else {
|
||||||
strcpy(++filename, option);
|
/* Write options back into the buffer, using memmove instead
|
||||||
filename += strlen(option);
|
* of strcpy since the strings may overlap. */
|
||||||
|
int len = strlen(option);
|
||||||
|
memmove(++filename, option, len);
|
||||||
|
filename += len;
|
||||||
if (option_list) *filename = '&';
|
if (option_list) *filename = '&';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1505,10 +1510,13 @@ redirect:
|
|||||||
NULL, 0, NI_NUMERICHOST);
|
NULL, 0, NI_NUMERICHOST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Construct the URI used in request; this is similar to s->filename,
|
||||||
|
* but with authentication credentials removed and RTSP specific options
|
||||||
|
* stripped out. */
|
||||||
|
ff_url_join(rt->control_uri, sizeof(rt->control_uri), "rtsp", NULL,
|
||||||
|
host, port, "%s", path);
|
||||||
/* request options supported by the server; this also detects server
|
/* request options supported by the server; this also detects server
|
||||||
* type */
|
* type */
|
||||||
av_strlcpy(rt->control_uri, s->filename,
|
|
||||||
sizeof(rt->control_uri));
|
|
||||||
for (rt->server_type = RTSP_SERVER_RTP;;) {
|
for (rt->server_type = RTSP_SERVER_RTP;;) {
|
||||||
snprintf(cmd, sizeof(cmd),
|
snprintf(cmd, sizeof(cmd),
|
||||||
"OPTIONS %s RTSP/1.0\r\n", rt->control_uri);
|
"OPTIONS %s RTSP/1.0\r\n", rt->control_uri);
|
||||||
|
Loading…
Reference in New Issue
Block a user