Bug 412280 nsGnomeVFSInputStream::DoOpen probably shouldn't treat values other than GNOME_VFS_OK from gnome_vfs_get_file_info as OK r=biesi a=dsicore
authortimeless@mozdev.org
Sat, 09 Feb 2008 15:19:01 -0800
changeset 11472 decf0416889d2a384cd2a2a487feb82e8d816ac4
parent 11471 73143823fd2628b81843a22d9131402d23e6c74c
child 11473 fabc3a2f238ae278306584ba7c8c66de5b069a33
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbiesi, dsicore
bugs412280
milestone1.9b4pre
Bug 412280 nsGnomeVFSInputStream::DoOpen probably shouldn't treat values other than GNOME_VFS_OK from gnome_vfs_get_file_info as OK r=biesi a=dsicore
extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
--- a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
+++ b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
@@ -419,30 +419,33 @@ nsGnomeVFSInputStream::DoOpen()
   //     gnome_vfs_get_file_info_from_handle were actually implemented by the
   //     smb:// module, since that would have allowed us to potentially save a
   //     round trip to the server to discover the mime type of the document in
   //     the case where gnome_vfs_open would have been used.  (Oh well!  /me
   //     throws hands up in the air and moves on...)
 
   GnomeVFSFileInfo info = {0};
   rv = gnome_vfs_get_file_info(mSpec.get(), &info, GNOME_VFS_FILE_INFO_DEFAULT);
-  if (rv == GNOME_VFS_OK && info.type == GNOME_VFS_FILE_TYPE_DIRECTORY)
+  if (rv == GNOME_VFS_OK)
   {
-    rv = gnome_vfs_directory_list_load(&mDirList, mSpec.get(),
-                                       GNOME_VFS_FILE_INFO_DEFAULT);
+    if (info.type == GNOME_VFS_FILE_TYPE_DIRECTORY)
+    {
+      rv = gnome_vfs_directory_list_load(&mDirList, mSpec.get(),
+                                         GNOME_VFS_FILE_INFO_DEFAULT);
 
-    LOG(("gnomevfs: gnome_vfs_directory_list_load returned %d (%s) [spec=\"%s\"]\n",
-        rv, gnome_vfs_result_to_string(rv), mSpec.get()));
-  }
-  else
-  {
-    rv = gnome_vfs_open(&mHandle, mSpec.get(), GNOME_VFS_OPEN_READ);
+      LOG(("gnomevfs: gnome_vfs_directory_list_load returned %d (%s) [spec=\"%s\"]\n",
+          rv, gnome_vfs_result_to_string(rv), mSpec.get()));
+    }
+    else
+    {
+      rv = gnome_vfs_open(&mHandle, mSpec.get(), GNOME_VFS_OPEN_READ);
 
-    LOG(("gnomevfs: gnome_vfs_open returned %d (%s) [spec=\"%s\"]\n",
-        rv, gnome_vfs_result_to_string(rv), mSpec.get()));
+      LOG(("gnomevfs: gnome_vfs_open returned %d (%s) [spec=\"%s\"]\n",
+          rv, gnome_vfs_result_to_string(rv), mSpec.get()));
+    }
   }
 
   gnome_vfs_module_callback_pop(GNOME_VFS_MODULE_CALLBACK_AUTHENTICATION);
 
   if (rv == GNOME_VFS_OK)
   {
     if (mHandle)
     {