From 924eeb3587141a1071ac960256e4d34172fb5b7b Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 2 Feb 2020 19:09:25 +0900 Subject: [PATCH] Document host and servicepath The various bits of host, url, and servicepath seem to overlap. References #1203. --- doc/man/s3fs.1 | 6 ++++++ src/s3fs.cpp | 16 ++++++++-------- src/s3fs_util.cpp | 6 ++++++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/doc/man/s3fs.1 b/doc/man/s3fs.1 index b618c91..a690a4b 100644 --- a/doc/man/s3fs.1 +++ b/doc/man/s3fs.1 @@ -206,6 +206,12 @@ If the disk free space is smaller than this value, s3fs do not use diskspace as maximum size, in MB, of a single-part copy before trying multipart copy. .TP +\fB\-o\fR host (default="https://s3.amazonaws.com") +Set a non-Amazon host, e.g., https://example.com. +.TP +\fB\-o\fR sevicepath (default="/") +Set a service path when the non-Amazon host requires a prefix. +.TP \fB\-o\fR url (default="https://s3.amazonaws.com") sets the url to use to access Amazon S3. If you want to use HTTP, then you can set "url=http://s3.amazonaws.com". If you do not use https, please specify the URL with the url option. diff --git a/src/s3fs.cpp b/src/s3fs.cpp index ba10f5d..d043c02 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -4826,14 +4826,6 @@ static int my_fuse_opt_proc(void* data, const char* arg, int key, struct fuse_ar } return 0; } - if(0 == STR2NCMP(arg, "host=")){ - host = strchr(arg, '=') + sizeof(char); - return 0; - } - if(0 == STR2NCMP(arg, "servicepath=")){ - service_path = strchr(arg, '=') + sizeof(char); - return 0; - } if(0 == strcmp(arg, "no_check_certificate")){ S3fsCurl::SetCheckCertificate(false); return 0; @@ -4957,6 +4949,14 @@ static int my_fuse_opt_proc(void* data, const char* arg, int key, struct fuse_ar S3fsCurl::SetContentMd5(true); return 0; } + if(0 == STR2NCMP(arg, "host=")){ + host = strchr(arg, '=') + sizeof(char); + return 0; + } + if(0 == STR2NCMP(arg, "servicepath=")){ + service_path = strchr(arg, '=') + sizeof(char); + return 0; + } if(0 == STR2NCMP(arg, "url=")){ host = strchr(arg, '=') + sizeof(char); // strip the trailing '/', if any, off the end of the host diff --git a/src/s3fs_util.cpp b/src/s3fs_util.cpp index 0263096..1eeaae0 100644 --- a/src/s3fs_util.cpp +++ b/src/s3fs_util.cpp @@ -1265,6 +1265,12 @@ void show_help () " - maximum size, in MB, of a single-part copy before trying \n" " multipart copy.\n" "\n" + " host (default=\"https://s3.amazonaws.com\")\n" + " - Set a non-Amazon host, e.g., https://example.com.\n" + "\n" + " servicepath (default=\"/\")\n" + " - Set a service path when the non-Amazon host requires a prefix.\n" + "\n" " url (default=\"https://s3.amazonaws.com\")\n" " - sets the url to use to access Amazon S3. If you want to use HTTP,\n" " then you can set \"url=http://s3.amazonaws.com\".\n"