mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 04:22:34 +03:00
(ftpfs_dir_load): minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
7ce3ca0991
commit
12a6af8f29
@ -1765,12 +1765,25 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
||||
}
|
||||
|
||||
if (sock == -1)
|
||||
goto fallback;
|
||||
{
|
||||
fallback:
|
||||
if (ftp_super->strict == RFC_AUTODETECT)
|
||||
{
|
||||
/* It's our first attempt to get a directory listing from this
|
||||
server (UNIX style LIST command) */
|
||||
ftp_super->strict = RFC_STRICT;
|
||||
/* I hate goto, but recursive call needs another 8K on stack */
|
||||
/* return ftpfs_dir_load (me, dir, remote_path); */
|
||||
cd_first = TRUE;
|
||||
goto again;
|
||||
}
|
||||
|
||||
/* Clear the interrupt flag */
|
||||
tty_enable_interrupt_key ();
|
||||
vfs_print_message ("%s", _("ftpfs: failed; nowhere to fallback to"));
|
||||
ERRNOR (EACCES, -1);
|
||||
}
|
||||
|
||||
vfs_parse_ls_lga_init ();
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
int i;
|
||||
@ -1787,7 +1800,6 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
||||
me->verrno = ECONNRESET;
|
||||
close (sock);
|
||||
ftp_super->ctl_connection_busy = FALSE;
|
||||
tty_disable_interrupt_key ();
|
||||
ftpfs_get_reply (me, ftp_super->sock, NULL, 0);
|
||||
vfs_print_message (_("%s: failure"), me->name);
|
||||
return (-1);
|
||||
@ -1844,21 +1856,6 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
||||
|
||||
vfs_print_message (_("%s: done."), me->name);
|
||||
return 0;
|
||||
|
||||
fallback:
|
||||
if (ftp_super->strict == RFC_AUTODETECT)
|
||||
{
|
||||
/* It's our first attempt to get a directory listing from this
|
||||
server (UNIX style LIST command) */
|
||||
ftp_super->strict = RFC_STRICT;
|
||||
/* I hate goto, but recursive call needs another 8K on stack */
|
||||
/* return ftpfs_dir_load (me, dir, remote_path); */
|
||||
cd_first = TRUE;
|
||||
goto again;
|
||||
}
|
||||
|
||||
vfs_print_message ("%s", _("ftpfs: failed; nowhere to fallback to"));
|
||||
ERRNOR (EACCES, -1);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user