Re: [patch] Fix ftpfs uploading behavior -rc1



Hello,
Pavel Machek wrote:
> Hi!
>
>>I reworked ftpfs uploading patch and now I invite you to test it
>>hardly.  There are 3 changed files and one new field (linear) in
>>vfs_s_super structure.  This flag inform ftpfs_fh_open about ordered
>>linear transfer in this ftp connection.  Now temporary file is used
>>only if file is copied over ftpfs from ftp server to the same ftp
>>server.  I think it is not good idea to open new control connection.
>>
>
> Do you think linear field in vfs_s_super is right thing?
>
> It seems very wrong to me. That state is certainly not
> per-superblock....
>
> Pavel

I consider to rename this field to u.ftp.control_connection_buzy
or data_transfer and call MEDATA->linear_start in vfs_s_open
instead of vfs_s_read. Or even eliminate linear_* family and
handle O_LINEAR flag in fh_open/fh_close.  But this requires
changes not only in ftpfs.c but also in fish.c.


Index: direntry.c
===================================================================
RCS file: /cvs/gnome/mc/vfs/direntry.c,v
retrieving revision 1.40
diff -u -p -u -p -r1.40 direntry.c
--- direntry.c	6 Mar 2002 08:46:35 -0000	1.40
+++ direntry.c	15 Mar 2002 14:51:18 -0000
@@ -788,6 +788,10 @@ vfs_s_open (vfs *me, char *file, int fla

     if (IS_LINEAR(flags)) {
- 	fh->linear = LS_LINEAR_CLOSED;
+ print_vfs_message (_("Starting linear transfer...")); + if (!MEDATA->linear_start (me, FH, 0)){
+ 	    g_free(fh);
+ 	    return NULL;
+	}
} else if ((MEDATA->fh_open) && (MEDATA->fh_open (me, fh, flags, mode))){
 	    g_free(fh);
 	    return NULL;
@@ -816,8 +817,10 @@ vfs_s_read (void *fh, char *buffer, int

-     if (FH->linear == LS_LINEAR_CLOSED){
-        print_vfs_message (_("Starting linear transfer..."));
- if (!MEDATA->linear_start (me, FH, 0))
- 	    return -1;
-     }
-
-     if (FH->linear == LS_LINEAR_CLOSED)
. . .

--
Regards,
Andrew V. Samoilov.





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