From f122cf000d85cd17171aa9d44b7265082c25b60e Mon Sep 17 00:00:00 2001 From: Fufu Fang Date: Tue, 23 Apr 2019 03:05:03 +0100 Subject: [PATCH] updated BUG section of README.md --- README.md | 3 +++ src/cache.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 08780f7..6900a02 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,9 @@ This program downloads the HTML web pages/files using [libcurl](https://curl.hax I wrote the cache system myself. It was a Herculean effort. I am immensely proud of it. +## Bugs +HTTPDirFS is particularly bad at handling any web servers that use percent-encoding. If anyone has got a quick fix, please submit a pull request. + ## Acknowledgement - I would like to thank [Cosmin Gorgovan](https://scholar.google.co.uk/citations?user=S7UZ6MAAAAAJ&hl=en) for the technical and moral support. - I would like to thank [-Archivist]([https://www.reddit.com/user/-Archivist/](https://www.reddit.com/user/-Archivist/)) for not providing FTP or WebDAV access to his server. This piece of software was written in direct response to his appalling behaviour. diff --git a/src/cache.c b/src/cache.c index b823d48..a66e8a8 100644 --- a/src/cache.c +++ b/src/cache.c @@ -608,7 +608,6 @@ static void Seg_set(Cache *cf, off_t offset, int i) long Cache_read(Cache *cf, char *output_buf, off_t size, off_t offset) { pthread_mutex_lock(&(cf->rw_lock)); - long sent; if (Seg_exist(cf, offset)) { /* @@ -620,7 +619,8 @@ long Cache_read(Cache *cf, char *output_buf, off_t size, off_t offset) /* Calculate the aligned offset */ off_t dl_offset = offset / cf->blksz * cf->blksz; /* Download the segment */ - long recv = path_download(cf->path, (char *) RECV_BUF, cf->blksz, dl_offset); + long recv = path_download(cf->path, (char *) RECV_BUF, cf->blksz, + dl_offset); /* Send it off */ memmove(output_buf, RECV_BUF + (offset-dl_offset), size); sent = size;