@@ -128,12 +128,13 @@ parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc)
128128 {"proxy" , required_argument , NULL , 'P' }, /* 5 */
129129 {"proxy-username" , required_argument , NULL , 'L' }, /* 6 */
130130 {"proxy-password" , required_argument , NULL , 'L' }, /* 7 */
131- {"cache" , required_argument , NULL , 'L' }, /* 8 */
131+ {"cache" , no_argument , NULL , 'L' }, /* 8 */
132132 {"dl-seg-size" , required_argument , NULL , 'L' }, /* 9 */
133133 {"max-seg-count" , required_argument , NULL , 'L' }, /* 10 */
134134 {"max-conns" , required_argument , NULL , 'L' }, /* 11 */
135135 {"user-agent" , required_argument , NULL , 'L' }, /* 12 */
136136 {"retry-wait" , required_argument , NULL , 'L' }, /* 13 */
137+ {"cache-location" , required_argument , NULL , 'L' }, /* 14 */
137138 {0 , 0 , 0 , 0 }
138139 };
139140 while ((c =
@@ -181,7 +182,7 @@ parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc)
181182 NETWORK_CONFIG .proxy_pass = strdup (optarg );
182183 break ;
183184 case 8 :
184- CacheSystem_init ( optarg ) ;
185+ NETWORK_CONFIG . cache_enabled = 1 ;
185186 break ;
186187 case 9 :
187188 DATA_BLK_SZ = atoi (optarg ) * 1024 * 1024 ;
@@ -198,6 +199,9 @@ parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc)
198199 case 13 :
199200 HTTP_429_WAIT = atoi (optarg );
200201 break ;
202+ case 14 :
203+ NETWORK_CONFIG .cache_dir = strdup (optarg );
204+ break ;
201205 default :
202206 fprintf (stderr , "Error: Invalid option\n" );
203207 add_arg (fuse_argv , fuse_argc , "--help" );
@@ -250,13 +254,15 @@ static void print_http_options()
250254 https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html\n\
251255 --proxy-username Username for the proxy\n\
252256 --proxy-password Password for the proxy\n\
253- --cache Set a cache folder, by default this is disabled\n\
257+ --cache Enable cache, by default this is disabled\n\
258+ --cache-location Set a custom cache location, by default it is \n\
259+ located in ${XDG_CACHE_HOME}/httpdirfs \n\
254260 --dl-seg-size The size of each download segment in MB,\n\
255261 default to 8MB.\n\
256262 --max-seg-count The maximum number of download segments a file\n\
257- can have. By default it is set to 1048576 . This\n\
258- means the maximum memory usage per file is 1MB \n\
259- memory. This allows caching file up to 8TB in\n\
263+ can have. By default it is set to 128*1024 . This\n\
264+ means the maximum memory usage per file is 128KB \n\
265+ memory. This allows caching file up to 1TB in\n\
260266 size, assuming you are using the default segment\n\
261267 size.\n\
262268 --max-conns The maximum number of network connections that\n\
0 commit comments