From 4f52b831df5cdb8d689b782e7b9bbe78e8ae180b Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 12 Jul 2002 00:05:11 +0000 Subject: [PATCH] * xdirentry.h: Eliminate use_proxy field. * ftpfs.c (open_archive_int): Use SUP.proxy instead of SUP.use_proxy. (open_archive): Set SUP.proxy to ftpfs_proxy_host. * ftpfs.h: Eliminate unused structures. --- vfs/ChangeLog | 6 ++++ vfs/ftpfs.c | 7 +++-- vfs/ftpfs.h | 82 +------------------------------------------------ vfs/xdirentry.h | 3 +- 4 files changed, 12 insertions(+), 86 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 37f8b4858..1cef0b201 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,5 +1,11 @@ 2002-07-11 Pavel Roskin + * xdirentry.h: Eliminate use_proxy field. + * ftpfs.c (open_archive_int): Use SUP.proxy instead of + SUP.use_proxy. + (open_archive): Set SUP.proxy to ftpfs_proxy_host. + * ftpfs.h: Eliminate unused structures. + * vfs.h: Rename URL_DEFAULTANON to URL_ALLOW_ANON. * utilvfs.c (vfs_split_url): Return NULL as username if URL_ALLOW_ANON is set and no username is found in the URL, diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c index 782c789c7..f515c217c 100644 --- a/vfs/ftpfs.c +++ b/vfs/ftpfs.c @@ -766,7 +766,7 @@ open_archive_int (vfs *me, vfs_s_super *super) int retry_seconds, count_down; /* We do not want to use the passive if we are using proxies */ - if (SUP.use_proxy) + if (SUP.proxy) SUP.use_passive_connection = 0; retry_seconds = 0; @@ -822,8 +822,9 @@ open_archive (vfs *me, vfs_s_super *super, char *archive_name, char *op) SUP.user = user; SUP.port = port; SUP.home = NULL; - SUP.proxy= 0; - SUP.use_proxy = ftpfs_check_proxy (host); + SUP.proxy = 0; + if (ftpfs_check_proxy (host)) + SUP.proxy = ftpfs_proxy_host; SUP.password = password; SUP.use_passive_connection = ftpfs_use_passive_connections | source_route; SUP.use_source_route = source_route; diff --git a/vfs/ftpfs.h b/vfs/ftpfs.h index 67a967f76..271cf7183 100644 --- a/vfs/ftpfs.h +++ b/vfs/ftpfs.h @@ -5,86 +5,6 @@ #if !defined(__FTPFS_H) #define __FTPFS_H -#include "xdirentry.h" - -struct direntry -{ - char *name; - int count; - char *linkname; - char *local_filename, *remote_filename; - int local_is_temp:1; - int freshly_created:1; - struct stat local_stat; - struct stat s; - struct stat *l_stat; - struct connection *bucket; - - int data_sock; /* For linear_ operations */ - int linear_state; -#define LS_NONLIN 0 /* Not using linear access at all */ -#define LS_LINEAR_CLOSED 1 /* Using linear access, but not open, yet */ -#define LS_LINEAR_OPEN 2 /* Using linear access, open */ -}; - -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 -#define FTPFS_RESOLVING_SYMLINKS 3 - -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 use_source_route; - int use_passive_connection; - int remote_is_amiga; /* No leading slash allowed for AmiTCP (Amiga) */ - 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 "; use "CWD "/ - "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; @@ -100,4 +20,4 @@ void ftpfs_init_passwd (void); #define OPT_FLUSH 1 #define OPT_IGNORE_ERROR 2 -#endif +#endif /* __FTPFS_H */ diff --git a/vfs/xdirentry.h b/vfs/xdirentry.h index 3e6d7674d..c6b344f04 100644 --- a/vfs/xdirentry.h +++ b/vfs/xdirentry.h @@ -101,9 +101,8 @@ typedef struct vfs_s_super { char *password; int port; - char *proxy; + char *proxy; /* proxy server, NULL if no proxy */ int failed_on_login; /* used to pass the failure reason to upper levels */ - int use_proxy; /* use a proxy server */ int use_source_route; int use_passive_connection; int remote_is_amiga; /* No leading slash allowed for AmiTCP (Amiga) */