From ccdd8e8859ea1bcc24eab6a68a3cd163f9c0740d Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Thu, 7 Feb 2002 19:22:20 +0000 Subject: [PATCH] * ftpfs.c (dir_load): Speed up cd_first calculation. (ftpfs_flushdir): Resurrect. --- vfs/ChangeLog | 5 +++++ vfs/ftpfs.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index f8f86feb0..854b7998a 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,8 @@ +2002-02-07 Andrew V. Samoilov + + * ftpfs.c (dir_load): Speed up cd_first calculation. + (ftpfs_flushdir): Resurrect. + 2002-02-06 Andrew V. Samoilov * ftpfs.c (dir_load): Use "LIST -la" instead of "LIST -la ." diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c index 049431099..9e4b5623b 100644 --- a/vfs/ftpfs.c +++ b/vfs/ftpfs.c @@ -836,6 +836,12 @@ archive_same(vfs *me, vfs_s_super *super, char *archive_name, char *op, void *co return port; } +void +ftpfs_flushdir (void) +{ + force_expiration = 1; +} + static int dir_uptodate(vfs *me, vfs_s_inode *ino) { @@ -955,7 +961,7 @@ initconn (vfs *me, vfs_s_super *super) /* If passive setup fails, fallback to active connections */ /* Active FTP connection */ if ((bind (data, (struct sockaddr *)&data_addr, len) == 0) && - (getsockname(data, (struct sockaddr *) &data_addr, &len) == 0) && + (getsockname (data, (struct sockaddr *) &data_addr, &len) == 0) && (listen (data, 1) == 0)) { unsigned char *a = (unsigned char *)&data_addr.sin_addr; @@ -1205,7 +1211,7 @@ dir_load(vfs *me, vfs_s_inode *dir, char *remote_path) #endif char buffer[BUF_8K]; - int cd_first = (strchr (remote_path, ' ') != NULL) || ftpfs_first_cd_then_ls || (SUP.strict == RFC_STRICT); + int cd_first = ftpfs_first_cd_then_ls || (strchr (remote_path, ' ') != NULL) || (SUP.strict == RFC_STRICT); again: print_vfs_message(_("ftpfs: Reading FTP directory %s... %s%s"), remote_path, SUP.strict == RFC_STRICT ? _("(strict rfc959)") : "",