[gvfs] dav: Ignore file size for directories



commit c5df6116e37a3afb34559724b9fc5c4a4a632d5c
Author: Ondrej Holy <oholy redhat com>
Date:   Tue May 15 15:05:02 2018 +0200

    dav: Ignore file size for directories
    
    Most of the servers don't use "getcontentlength" node (which is used
    to set file size) for directories anyway. However, some servers report
    total size of files inside the directory, which is not expected and
    causes issues for clients. Let's simply ignore file size for directories
    if set.
    
    https://gitlab.gnome.org/GNOME/nautilus/issues/431

 daemon/gvfsbackenddav.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index 967f1db..6591f14 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -1109,6 +1109,13 @@ ms_response_to_file_info (MsResponse *response,
       icon = g_themed_icon_new ("folder");
       symbolic_icon = g_themed_icon_new ("folder-symbolic");
       file_info_set_content_type (info, "inode/directory");
+
+      /* Ignore file size for directories. Most of the servers don't report it
+       * for directories anyway. However, some servers report total size of
+       * files inside the directory, which is not expected and causes issues
+       * for clients.
+       */
+      g_file_info_remove_attribute (info, G_FILE_ATTRIBUTE_STANDARD_SIZE);
     }
   else
     {


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