<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div><br></div><div><br></div><div>On Fri, Oct 9, 2020, at 10:34, Rémi Denis-Courmont wrote:<br></div><blockquote type="cite" id="qt" style=""><div>Hi,<br></div><div><br></div><div>#3435 does not specify the context, and I'm not going to ask the notoriously troll-prone Slackware VLC maintainer what they meant 11 years ago. The far most common occurrences of unencoded URL white spaces are playlist files (in a large sense) and redirects. Both are already handled. As far as I am concerned, the bug is fixed.<br></div></blockquote><div><br></div><div>I would add a third case: user input. From CLI and from Qt dialog.<br></div><div><br></div><blockquote type="cite" id="qt" style=""><div><br></div><div>I don't even see what filesystems have to do with this. The directory access modules are perfectly capable of encoding file paths correctly from the very beginning.<br></div><div><br></div><div>The only real problem that I know, is the UI dialog which rejects invalid chars. And this patchset doesn't address that.<br></div><div><br></div><div class="qt-gmail_quote"><div>Le 9 octobre 2020 11:23:29 GMT+03:00, Alexandre Janniaux <ajanni@videolabs.io> a écrit :<br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><pre class="qt-k9mail"><div>Hi,<br></div><div><br></div><div>On Fri, Oct 09, 2020 at 10:01:36AM +0200, Thomas Guillem wrote:<br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(114, 159, 207);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div> "VLC should automatically replace spaces with %20 like all browsers do"<br></div><div><br></div><div> It's not the case when I type: ./vlc "https://server/file name.mp3"<br></div><div><br></div><div> So, how can you say that #3435 is fixed?<br></div><div><br></div><div> You are right about one point, it should not be done in http modules, but at a higher level when we know the url come from an user.<br></div></blockquote><div><br></div><div>If it comes from the user, shouldn't it be fixed in the interface? (which<br></div><div>would be the only point where the URL would be fixed up, including non<br></div><div>interactive inputs interface like playlist demuxers).<br></div><div><br></div><div>A note here: fixing url in one way will always break some other invalid<br></div><div>use cases that happened to work before. That's a non-issue because they<br></div><div>are invalid anyway but we should probably focus on the use case that<br></div><div>actually brings UX improvement like the space change, which happens<br></div><div>regularily if you have a list of files to play from a server and get<br></div><div>the name (not encoded) from the FS.<br></div><div><br></div><div>Regards,<br></div><div>--<br></div><div>Alexandre Janniaux<br></div><div>Videolabs<br></div><div><br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(114, 159, 207);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div>On Fri, Oct 9, 2020, at 09:59, Rémi Denis-Courmont wrote:<br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(173, 127, 168);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div> Hi,<br></div><div><br></div><div> #3435 is fixed. VLC can parse file paths and insufficiently encoded URLs from playlists or redirects just fine. We have to do the fixup there in the producer so that relative-to-absolute resolution works.m properly.<br></div><div><br></div><div> Validation must be done in access because it can't be done earlier due to the different rules for different MRL schemes.<br></div><div><br></div><div> Le 9 octobre 2020 10:41:28 GMT+03:00, Thomas Guillem <thomas@gllm.fr> a écrit :<br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(138, 226, 52);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div> I remember a previous discussion where we said it was the responsibility of the access modules to do this fixup.<br></div><div><br></div><div> cf. <a href="https://trac.videolan.org/vlc/ticket/18991">https://trac.videolan.org/vlc/ticket/18991</a> and <a href="https://git.videolan.org/?p=vlc.git;a=commit;h=762ca1e8a01278b34ddb34765f3339690aad5d2e">https://git.videolan.org/?p=vlc.git;a=commit;h=762ca1e8a01278b34ddb34765f3339690aad5d2e</a><br></div><div><br></div><div> I'm not sure that URLs are fixed up at this point.<br></div><div><br></div><div> How do you propose to fix #3435 <<a href="https://trac.videolan.org/vlc/ticket/3435">https://trac.videolan.org/vlc/ticket/3435</a>> then? Because you said it was fixed but it is *not*. VLC can't handle unvalid http URLs with a " ". Every other player or browsers can.<br></div><div><br></div><div> On Fri, Oct 9, 2020, at 09:26, Rémi Denis-Courmont wrote:<br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(252, 175, 62);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div> URLs are already fixed up when they get to this point. Fixing up URLs twice is a recipe for disaster. We've tried.<br></div><div><br></div><div> -1<br></div><div><br></div><div> Le 9 octobre 2020 09:56:58 GMT+03:00, Thomas Guillem <thomas@gllm.fr> a écrit :<br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(233, 185, 110);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div> This will allow VLC to open unvalid URLs (using a space instead of the<br></div><div> %20 encoding, for example). Every other browsers or players are doing<br></div><div> this fixup.<br></div><div><br></div><div> Fixes #3435 modules/access/http/access.c | 12 ++++++++++--<br></div><div>  1 file changed, 10 insertions(+), 2 deletions(-)<br></div><div><br></div><div> diff --git a/modules/access/http/access.c b/modules/access/http/access.c<br></div><div> index a3805d0d426..123daaf51d3 100644<br></div><div> --- a/modules/access/http/access.c<br></div><div> +++ b/modules/access/http/access.c<br></div><div> @@ -171,19 +171,27 @@ static int Open(vlc_object_t *obj)<br></div><div>      struct vlc_url_t crd_url;<br></div><div>      char *psz_realm = NULL;<br></div><div><br></div><div> -    vlc_UrlParse(&crd_url, access->psz_url);<br></div><div> +    char *url_fixup = vlc_uri_fixup(access->psz_url);<br></div><div> +    if (url_fixup == NULL)<br></div><div> +        goto error;<br></div><div> +<br></div><div> +    vlc_UrlParse(&crd_url, url_fixup);<br></div><div>      vlc_credential_init(&crd, &crd_url);<br></div><div><br></div><div>      sys->manager = vlc_http_mgr_create(obj, jar);<br></div><div>      if (sys->manager == NULL)<br></div><div> +    {<br></div><div> +        free(url_fixup);<br></div><div>          goto error;<br></div><div> +    }<br></div><div><br></div><div>      char *ua = var_InheritString(obj, "http-user-agent");<br></div><div>      char *referer = var_InheritString(obj, "http-referrer");<br></div><div>      bool live = var_InheritBool(obj, "http-continuous");<br></div><div><br></div><div>      sys->resource = (live ? vlc_http_live_create : vlc_http_file_create)(<br></div><div> -        sys->manager, access->psz_url, ua, referer);<br></div><div> +        sys->manager, url_fixup, ua, referer);<br></div><div> +    free(url_fixup);<br></div><div>      free(referer);<br></div><div>      free(ua);<br></div></blockquote><div>--<br></div><div>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.<hr>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></blockquote></blockquote><div>--<br></div><div>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.<hr>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></blockquote></blockquote><div><br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(114, 159, 207);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div><hr>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></blockquote><div><hr>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></pre></blockquote></div><div><br></div><div>-- <br></div><div>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. <br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></blockquote><div><br></div></body></html>