mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
a04ee60c23
* setup.c: save and restore new global variable/option ftp_use_unix_list_options Tue Sep 15 20:31:32 1998 Norbert Warmuth <k3190@fh-sw.de> * ftpfs.c (ftp_use_unix_list_options): New global variable/option. If true we try to use 'LIST -la <path>'. When it fails we use the two commands 'CWD <path>' and 'LIST' instead. (resolve_symlink): rewritten. Don't get a second directory listing with `LIST -lLa'. Instead use the cache to get the file stat of symbolic links. If the directory the symlink points to isn't already in the cache the directory listing will be fetched and stored in the directory cache (without resolving symlinks recursively). The new method to resolve symlinks is faster if symlinks the same directory or the directory the symlink points to is already in the cache. This function was small and nice until I discovered that it was broken for symlinks to symlinks. Now it looks ugly and perhaps I will revert it to use "LIST -lLa" again. With a fast connection it doesn't matter which methode we use but with a slow connection I wouldn't hesitate to burn more cpu cycles on the client side. (retrieve_dir): Added parameter to tell whether to resolve symlinks (don't resolve symlinks in directory listings retrieved while resolving symlinks). When we don't get a directory listing with 'LIST -la <path>' then try to get it with `CWD <path>; LIST'. Tue Sep 15 20:27:29 1998 Norbert Warmuth <k3190@fh-sw.de * ftpfs.c (login_server): s/ftpfs_get_host/my_get_host/ (retrieve_file_start2): Don't create target file O_EXCL, in copy_file_file we check existance of the target file and know that we want to truncate it (this change was already done a while back but it was reverted with the vfs-split). Tue Sep 15 20:15:42 1998 Norbert Warmuth <k3190@fh-sw.de> * ftpfs.h (struct connection): added boolean which indicates that the ftp server doesn't unterstand Unix ls options * ftpfs.h (struct dir): added enum to store symlink status of the in memory directory cache (directory has no symbolic links; symbolic links but not yet resolved; symbolic links which are resolved) Tue Sep 15 20:02:08 1998 Norbert Warmuth <k3190@fh-sw.de> * shared_ftp_fish.c, fish.c: updated references to retrieve_dir to honour the additional boolean parameter
86 lines
2.0 KiB
C
86 lines
2.0 KiB
C
/* ftpfs.h */
|
|
|
|
#if !defined(__FTPFS_H)
|
|
#define __FTPFS_H
|
|
|
|
struct direntry
|
|
{
|
|
char *name;
|
|
int count;
|
|
char *linkname;
|
|
char *local_filename;
|
|
int local_is_temp:1;
|
|
int freshly_created:1;
|
|
int tmp_reget;
|
|
struct stat local_stat;
|
|
char *remote_filename;
|
|
struct stat s;
|
|
struct stat *l_stat;
|
|
struct connection *bucket;
|
|
};
|
|
|
|
struct dir
|
|
{
|
|
int count;
|
|
struct timeval timestamp;
|
|
char *remote_path;
|
|
struct linklist *file_list;
|
|
int symlink_status;
|
|
};
|
|
|
|
/* valid values for dir->symlink_status */
|
|
#define FTPFS_NO_SYMLINKS 0
|
|
#define FTPFS_UNRESOLVED_SYMLINKS 1
|
|
#define FTPFS_RESOLVED_SYMLINKS 2
|
|
|
|
struct connection {
|
|
char *host;
|
|
char *user;
|
|
char *current_directory;
|
|
char *home;
|
|
char *updir;
|
|
char *password;
|
|
int port;
|
|
int sock;
|
|
struct linklist *dcache;
|
|
ino_t __inode_counter;
|
|
int lock;
|
|
int failed_on_login; /* used to pass the failure reason to upper levels */
|
|
int use_proxy; /* use a proxy server */
|
|
int result_pending;
|
|
int use_source_route;
|
|
int use_passive_connection;
|
|
int isbinary;
|
|
int cwd_defered; /* current_directory was changed but CWD command hasn't
|
|
been sent yet */
|
|
int strict_rfc959_list_cmd; /* ftp server doesn't understand
|
|
"LIST -la <path>"; use "CWD <path>"/
|
|
"LIST" instead */
|
|
};
|
|
|
|
#define qhost(b) (b)->host
|
|
#define quser(b) (b)->user
|
|
#define qcdir(b) (b)->current_directory
|
|
#define qport(b) (b)->port
|
|
#define qsock(b) (b)->sock
|
|
#define qlock(b) (b)->lock
|
|
#define qdcache(b) (b)->dcache
|
|
#define qhome(b) (b)->home
|
|
#define qupdir(b) (b)->updir
|
|
#define qproxy(b) (b)->use_proxy
|
|
|
|
/* Increased since now we may use C-r to reread the contents */
|
|
#define FTPFS_DIRECTORY_TIMEOUT 30 * 60
|
|
|
|
#define DO_RESOLVE_SYMLINK 1
|
|
#define DO_OPEN 2
|
|
#define DO_FREE_RESOURCE 4
|
|
|
|
extern char *ftpfs_anonymous_passwd;
|
|
extern char *ftpfs_proxy_host;
|
|
extern int ftpfs_directory_timeout;
|
|
extern int ftpfs_always_use_proxy;
|
|
|
|
void ftpfs_init_passwd ();
|
|
#endif
|