[glib: 2/8] GWinHTTPVfs: use URI parser for parsing URIs



commit ccbadcfb0457bf028eecbaa432ad694ad46cf2df
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Fri Feb 8 20:20:22 2019 +0000

    GWinHTTPVfs: use URI parser for parsing URIs
    
    If a URI can't be handled by by WinHTTPVfs, it should pass that URI
    along to the URI parser of the wrapped Vfs, not to its generic parser.
    Theoretically, generic parser should also be able to handle URIs,
    but this is subject to Vfs semantics.
    
    In case of Windows, the wrapped Vfs is GLocalVfs, which is *local* and
    treats any generic names as either file:// URIs or as filesystem
    paths. It only ever treats URIs as URIs when they are passed
    to its URI parser. This breaks the testsuite when g-icon GIO test passes
    unhandleable sftp:// URI, and expects it to come through unmolested,
    yet GLocalVfs, getting that URI as a generic parse name, treats it as
    a filesystem path, and then "canonicalizes" it by prepending CWD.
    
    Fix this by making WinHTTPVfs pass any URIs it gets to the URI parser
    of the wrapped Vfs. This way unknown URIs remain URI-ish. This seems
    like a reasonable things to do, since the URI parser should not be
    given anything other than URIs, so there's no reason to try generic
    parsing with these strings.
    
    Closes: #875

 gio/win32/gwinhttpvfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/win32/gwinhttpvfs.c b/gio/win32/gwinhttpvfs.c
index d32a4cbe1..038368f81 100644
--- a/gio/win32/gwinhttpvfs.c
+++ b/gio/win32/gwinhttpvfs.c
@@ -173,7 +173,7 @@ g_winhttp_vfs_get_file_for_uri (GVfs       *vfs,
       return _g_winhttp_file_new (winhttp_vfs, uri);
 
   /* For other URIs fallback to the wrapped GVfs */
-  return g_vfs_parse_name (winhttp_vfs->wrapped_vfs, uri);
+  return g_vfs_get_file_for_uri (winhttp_vfs->wrapped_vfs, uri);
 }
 
 static const gchar * const *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]