[PATCH] eel_read_entire_file does not work with ftp uris (bug #89047)



Hi guys.

If you run eel_read_entire_file with a ftp uris you will notice that it
never ends.
This probably is due to a bug in the ftp gnome-vfs module.
The problem in fact is that gnome_vfs_read (with ftp uris) does not
return GNOME_VFS_ERROR_EOF when the end of file is reached (it returns
GNOME_VFS_OK in that case).

This bug can be fixed using the attached patch, but probably in the
future
it will be a good idea to fix the root problem in the ftp gnome-vfs
module.

Note that this bug causes a never ending loop in gedit (to see it
try to load ftp://ftp.gnome.org/robots.txt in gedit) so please, for the
moment, apply the current patch.

I'm on a RedHat Linux 7.0, but I have seen this bug on RH 7.2 too.


Ciao,
Paolo


-- 
Paolo Maggi                      E-mail: maggi athena polito it
Dip. Automatica e Informatica    Tel.  : + 39 011 564 7078 
Politecnico di Torino            Fax   : + 39 011 564 7099

A Bugless Program is an Abstract Theoretical Concept.


? eel.patch
Index: eel/eel-vfs-extensions.c
===================================================================
RCS file: /cvs/gnome/eel/eel/eel-vfs-extensions.c,v
retrieving revision 1.15
diff -u -r1.15 eel-vfs-extensions.c
--- eel/eel-vfs-extensions.c	28 Jun 2002 02:36:52 -0000	1.15
+++ eel/eel-vfs-extensions.c	25 Jul 2002 16:08:14 -0000
@@ -107,7 +107,10 @@
 		}
 
 		total_bytes_read += bytes_read;
-	} while (result == GNOME_VFS_OK);
+
+	/* It should not check for bytes_read != 0, but there are problems with 
+         * ftp uris */
+	} while ((result == GNOME_VFS_OK) && (bytes_read != 0));
 
 	/* Close the file. */
 	result = gnome_vfs_close (handle);


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