implement -o exit_after_connect
this is useful as a connectivity check
This commit is contained in:
7
ftpfs.c
7
ftpfs.c
@@ -174,6 +174,7 @@ static struct fuse_opt ftpfs_opts[] = {
|
|||||||
FTPFS_OPT("codepage=%s", codepage, 0),
|
FTPFS_OPT("codepage=%s", codepage, 0),
|
||||||
FTPFS_OPT("iocharset=%s", iocharset, 0),
|
FTPFS_OPT("iocharset=%s", iocharset, 0),
|
||||||
FTPFS_OPT("nomulticonn", multiconn, 0),
|
FTPFS_OPT("nomulticonn", multiconn, 0),
|
||||||
|
FTPFS_OPT("exit_after_connect", exit_after_connect, 1),
|
||||||
|
|
||||||
FUSE_OPT_KEY("-h", KEY_HELP),
|
FUSE_OPT_KEY("-h", KEY_HELP),
|
||||||
FUSE_OPT_KEY("--help", KEY_HELP),
|
FUSE_OPT_KEY("--help", KEY_HELP),
|
||||||
@@ -1502,6 +1503,7 @@ static void usage(const char* progname) {
|
|||||||
" utf8 try to transfer file list with utf-8 encoding\n"
|
" utf8 try to transfer file list with utf-8 encoding\n"
|
||||||
" codepage=STR set the codepage the server uses\n"
|
" codepage=STR set the codepage the server uses\n"
|
||||||
" iocharset=STR set the charset used by the client\n"
|
" iocharset=STR set the charset used by the client\n"
|
||||||
|
" exit_after_connect after connecting to the FTP server, instead of passing control to FUSE, exit\n"
|
||||||
"\n"
|
"\n"
|
||||||
"CurlFtpFS cache options: \n"
|
"CurlFtpFS cache options: \n"
|
||||||
" cache=yes|no enable/disable cache (default: yes)\n"
|
" cache=yes|no enable/disable cache (default: yes)\n"
|
||||||
@@ -1800,7 +1802,10 @@ int main(int argc, char** argv) {
|
|||||||
fuse_opt_insert_arg(&args, 1, tmp);
|
fuse_opt_insert_arg(&args, 1, tmp);
|
||||||
g_free(tmp);
|
g_free(tmp);
|
||||||
|
|
||||||
res = curlftpfs_fuse_main(&args);
|
|
||||||
|
if (!ftpfs.exit_after_connect) {
|
||||||
|
res = curlftpfs_fuse_main(&args);
|
||||||
|
}
|
||||||
|
|
||||||
cancel_previous_multi();
|
cancel_previous_multi();
|
||||||
curl_multi_cleanup(ftpfs.multi);
|
curl_multi_cleanup(ftpfs.multi);
|
||||||
|
Reference in New Issue
Block a user