fixed regression - cache system stopped working on regular http server
updated readme / help Update README.md Update README.md
This commit is contained in:
parent
f3d5ffc3fc
commit
cf1d46edf4
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -4,12 +4,18 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
## [1.2.0] - 2019-10-24
|
||||
### Added
|
||||
- Subsonic server support - this is dedicated to my Debian package maintainer
|
||||
Jerome Charaoui
|
||||
|
||||
### Changed
|
||||
- Wrapped all calloc() calls with error handling functions.
|
||||
- Various code refactoring
|
||||
|
||||
### Fixed
|
||||
- Remove the erroneous error messages when the user supplies wrong command line
|
||||
options.
|
||||
- Separated out network initialisation code and root LinkTable retrieval code.
|
||||
|
||||
## [1.1.10] - 2019-09-10
|
||||
### Added
|
||||
|
|
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
|||
VERSION=1.1.10
|
||||
VERSION=1.2.0
|
||||
|
||||
CFLAGS+= -O2 -Wall -Wextra -Wshadow\
|
||||
-rdynamic -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE -D_GNU_SOURCE\
|
||||
|
|
23
README.md
23
README.md
|
@ -1,4 +1,5 @@
|
|||
# HTTPDirFS - HTTP Directory Filesystem, with a permanent cache
|
||||
# HTTPDirFS - HTTP Directory Filesystem with a permanent cache
|
||||
|
||||
Have you ever wanted to mount those HTTP directory listings as if it was a
|
||||
partition? Look no further, this is your solution. HTTPDirFS stands for Hyper
|
||||
Text Transfer Protocol Directory Filesystem.
|
||||
|
@ -11,9 +12,12 @@ downloaded, so you don't need to these segments again if you access them later.
|
|||
This feature is triggered by the ``--cache`` flag. This makes this filesystem
|
||||
much faster than ``rclone mount``.
|
||||
|
||||
## News
|
||||
HTTPDirFS now supports mounting Airsonic / Subsonic servers
|
||||
|
||||
## Usage
|
||||
|
||||
./httpdirfs -f --cache $URL $YOUR_MOUNT_POINT
|
||||
./httpdirfs -f --cache $URL $MOUNT_POINT
|
||||
|
||||
An example URL would be
|
||||
[Debian CD Image Server](https://cdimage.debian.org/debian-cd/). The ``-f`` flag
|
||||
|
@ -47,6 +51,10 @@ HTTPDirFS options:
|
|||
after encountering an error. (default: 5)
|
||||
--user-agent Set user agent string (default: "HTTPDirFS")
|
||||
|
||||
Subsonic options:
|
||||
--sonic-username The username for your Airsonic / Subsonic server
|
||||
--sonic-password The username for your Airsonic / Subsonic server
|
||||
|
||||
FUSE options:
|
||||
|
||||
-d -o debug enable debug output (implies -f)
|
||||
|
@ -77,6 +85,17 @@ filesystem supports it. Otherwise your hard drive / SSD will get heavy I/O from
|
|||
cache file creation. For a list of filesystem that supports sparse allocation,
|
||||
please refer to [Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_file_systems#Allocation_and_layout_policies).
|
||||
|
||||
## Airsonic / Subsonic server support
|
||||
This is a new feature to 1.2.0. Now you can mount the music collection on your
|
||||
Airsonic / Subsonic server, and browse them using your favourite file browser.
|
||||
You simply have to supply both ``--sonic-username`` and ``--sonic-password`` to
|
||||
trigger the Airsonic / Subsonic server mode. For example:
|
||||
|
||||
./httpdirfs -f --cache --sonic-username $USERNAME --sonic-password $PASSWORD $URL $MOUNT_POINT
|
||||
|
||||
You definitely want to enable the cache for this one, otherwise it is painfully
|
||||
slow.
|
||||
|
||||
## Configuration file support
|
||||
This program has basic support for using a configuration file. The configuration
|
||||
file that the program reads is ``${XDG_CONFIG_HOME}/httpdirfs/config``, which by
|
||||
|
|
10
src/cache.c
10
src/cache.c
|
@ -782,11 +782,12 @@ Cache *Cache_open(const char *fn)
|
|||
/* Create the cache in-memory data structure */
|
||||
Cache *cf = Cache_alloc();
|
||||
|
||||
/* Fill in the fs_path */
|
||||
cf->fs_path = calloc(MAX_PATH_LEN + 1, sizeof(char));
|
||||
strncpy(cf->fs_path, fn, MAX_PATH_LEN);
|
||||
|
||||
/* Set the path for the local cache file, if we are in sonic mode */
|
||||
if (CONFIG.sonic_mode) {
|
||||
/* Fill in the fs_path */
|
||||
cf->fs_path = calloc(MAX_PATH_LEN + 1, sizeof(char));
|
||||
strncpy(cf->fs_path, fn, MAX_PATH_LEN);
|
||||
/* Set the path for the local cache file */
|
||||
fn = link->sonic_id_str;
|
||||
}
|
||||
|
||||
|
@ -1007,7 +1008,6 @@ long Cache_read(Cache *cf, char * const output_buf, const off_t len,
|
|||
|
||||
uint8_t *recv_buf = CALLOC(cf->blksz, sizeof(uint8_t));
|
||||
fprintf(stderr, "Cache_read(): thread %lu: ", pthread_self());
|
||||
fprintf(stderr, "cf->fs_path: %s\n", cf->fs_path);
|
||||
long recv = path_download(cf->fs_path, (char *) recv_buf, cf->blksz,
|
||||
dl_offset);
|
||||
if (recv < 0) {
|
||||
|
|
|
@ -296,6 +296,9 @@ HTTPDirFS options:\n\
|
|||
--retry-wait Set delay in seconds before retrying an HTTP request\n\
|
||||
after encountering an error. (default: 5)\n\
|
||||
--user-agent Set user agent string (default: \"HTTPDirFS\")\n\
|
||||
\n\
|
||||
");
|
||||
|
||||
For mounting a Airsonic / Subsonic server:\n\
|
||||
--sonic-username The username for your Airsonic / Subsonic server\n\
|
||||
--sonic-password The username for your Airsonic / Subsonic server\n\
|
||||
\n\");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue