Commit Graph

302 Commits

Author SHA1 Message Date
Fufu Fang c2f409dcc7
updated coding convention file 2021-08-30 11:25:17 +01:00
Fufu Fang 0f3cc61875
relabelled all log outputs 2021-08-30 11:24:32 +01:00
Fufu Fang 0219d7460a
only network.c needs to be cleaned up 2021-08-30 05:17:15 +01:00
Fufu Fang 2a4c61477a
clean up lprintf statements - we have link.c and network.c left. 2021-08-30 03:43:45 +01:00
Fufu Fang 7813487c50
improved error message, removed unnecessary locks 2021-08-30 02:50:03 +01:00
Fufu Fang 14c4b3b486
updated logging facility 2021-08-29 22:46:24 +01:00
Fufu Fang f37cdefa47
Various changes
- Rather than using a flag to indicate operating mode, now we use
a variable.
- Change log printing level names
- Change the return for Cache_exist
2021-08-29 14:07:22 +01:00
Fufu Fang b895fcb318
added the single-file-mode in the configuration struct 2021-08-29 11:09:41 +01:00
Fufu Fang 05ebf76094
fixed LinkTable_uninitialised_fill() status output 2021-08-29 10:58:11 +01:00
Fufu Fang 4bf5631714
Revert 60b885181a
It breaks the cache system completely.
2021-08-29 10:52:49 +01:00
Fufu Fang 8777cf90bc
send help message to stdout 2021-08-22 02:56:38 +01:00
Fufu Fang 878f120fc2
Temporarily increasing the debugging level on the master branch
This will be reverted when the README is complete.
2021-08-22 02:28:00 +01:00
Fufu Fang 6d5267089f
improved debug messages 2021-08-22 02:26:09 +01:00
Fufu Fang 67ec1ad7e5
Separated out config.c and config.h 2021-08-22 00:51:37 +01:00
Fufu Fang 89df992053
fixed errorneous error handling 2021-08-21 02:40:20 +01:00
MecryWork 33bbd21e9f
Fix memory overflow
Co-authored-by: MecryWork
2021-08-12 13:28:37 +01:00
MecryWork 60b885181a
fix: Seg_exist function crashes when the second parameter is 0
Co-authored-by: liuchenghao
2021-08-09 10:36:09 +01:00
Fufu Fang 5f86703f17
janatorial changes 2021-08-08 15:50:35 +01:00
Fufu Fang e76b079fe6
Fix issue #59
Stop duplicated link from showing for Apache server configured
with IconsAreLinks option.
2021-08-08 14:25:28 +01:00
Fufu Fang 8e6ff1a93d
replaced calloc with CALLOC wrapper function 2021-08-08 14:25:24 +01:00
Fufu Fang 861481e6e1
Fixed issue #71
Now allows link which start with percentage encoding
2021-08-05 00:34:07 +01:00
liuchenghao 2791f96603 fix: Failed to mount an empty file in the cache state 2021-07-27 15:55:19 +08:00
Hristo Iliev e553463dc4 Patches to build on macOS 2021-05-27 21:49:51 +03:00
Fufu Fang 12a2f87ada
Update documentation for sonic.c / sonic.h 2019-10-28 12:54:01 +00:00
Fufu Fang ea13c175cd
merged id3 non-root mode parser and index mode parser together 2019-10-28 12:54:01 +00:00
Fufu Fang 4b02980380
Added --config flag, updated CHANGELOG.md 2019-10-28 01:45:13 +00:00
Fufu Fang 55ad0cd9fc
converted sonic_id to a string, to support epoupon LMS 2019-10-28 01:09:55 +00:00
Fufu Fang e9c8689f8d
added -insecure_tls 2019-10-28 00:50:28 +00:00
Fufu Fang 75da12bb80
fixed error in help 2019-10-28 00:20:59 +00:00
Fufu Fang 05776305cb
added --sonic-insecure authentication mode, now reports *sonic server errors 2019-10-28 00:16:44 +00:00
Fufu Fang c2be88c6e4
Added flag to disable the check on server's support for HTTP range requests 2019-10-27 21:54:26 +00:00
Fufu Fang b7f25ca7ed
fixed regression of Sonic index mode 2019-10-27 21:33:58 +00:00
Fufu Fang ff1d34855c
Sonic ID3 mode is now working properly, but Sonic index mode stopped working 2019-10-27 21:21:30 +00:00
Fufu Fang 4b2ac94fe1
fixed linktable traversal 2019-10-27 11:31:25 +00:00
Fufu Fang 83f88dbe38
not sure why it crashes 2019-10-27 11:08:23 +00:00
Fufu Fang ef53cb83f6
Attempting to add ID3 support 2019-10-25 18:52:53 +01:00
Fufu Fang 8a4d47d71d
added flags for Sonic ID3 mode support 2019-10-25 17:07:08 +01:00
Fufu Fang 3bd7e67041
now enforce http range request check on *sonic server as well. 2019-10-25 17:06:55 +01:00
Fufu Fang 1105f8a0ba
removed spurious debugging messages 2019-10-25 03:07:36 +01:00
Fufu Fang 647b106a7c
fixed segfault if the root of the airsonic folder has music file 2019-10-25 02:55:41 +01:00
Fufu Fang 0a5dd74b44
Minor documentation / stylistic updates 2019-10-24 03:15:30 +01:00
Fufu Fang 79d469d3b6
fixed --help text 2019-10-24 03:03:11 +01:00
Fufu Fang cf1d46edf4
fixed regression - cache system stopped working on regular http server
updated readme / help

Update README.md

Update README.md
2019-10-24 02:38:59 +01:00
Fufu Fang f3d5ffc3fc
now cache works on subsonic server 2019-10-24 02:15:05 +01:00
Fufu Fang 8206b4fa37
subsonic support is now added - no cache though 2019-10-24 00:57:37 +01:00
Fufu Fang a8ef8c88b5
added code to check if the server supports range requests 2019-10-24 00:44:18 +01:00
Fufu Fang cf700e5d3d
Changed sonic mode detection, fixed file listing 2019-10-23 22:34:46 +01:00
Fufu Fang f73643e32c
fixed a regression associated with invalid link detection 2019-10-23 22:10:33 +01:00
Fufu Fang 0f7623d1e7
succesfully mounted the filesystem, now need to actually download the music file 2019-10-23 21:36:08 +01:00
Fufu Fang 5062f511bd
Finished writing the code to generate Subsonic LinkTable
- Also refactored various bits and pieces
2019-10-23 21:04:25 +01:00
Fufu Fang b7c63f4418
renamed MemoryStruct to DataStruct, removed spurious link type detection logic 2019-10-22 20:26:21 +01:00
Fufu Fang cde4a13005
successfully downloading xml file from subsonic server 2019-10-22 01:53:28 +01:00
Fufu Fang ed8452a4a3
factored out network / root link table initialisation code 2019-10-22 01:49:53 +01:00
Fufu Fang dec32b0bb4
removed main.c's extra warning messages when doing exit(EXIT_FAILURE) 2019-10-22 01:13:28 +01:00
Fufu Fang 65a9e7f908
half way writing sonic_LinkTable_new
- now need to write the parser
2019-10-22 00:42:46 +01:00
Fufu Fang 1a9c10f783
more changes to the subsonic module
completed sonic_gen_auth_str()

completed sonic_gen_url_first_part()

change calloc to CALLOC (the wrapper function with error handling)
2019-10-21 23:12:02 +01:00
Fufu Fang eaabc877a0
added md5 checksum generation and salt generation 2019-10-21 02:11:54 +01:00
Fufu Fang bc23ee03a2
Fixed regression: LinkTable caching now works again. 2019-09-04 19:53:11 +01:00
Fufu Fang 1493190692
Improved HTTP temporary failure error handling
- Added HTTP response code for Cloudflare timeout
- Improved HTTP temporary failure error handling during LinkTable generation
- Now checked all HTTP response code in a single function
2019-09-04 18:42:59 +01:00
Fufu Fang ff67794b02
Now retry on HTTP 520 (Unknown error) 2019-09-04 17:57:15 +01:00
Fufu Fang 56e1095287
tidying stuff up 2019-09-04 17:43:30 +01:00
Fufu Fang aa4aae58b2
Added volatile into a variable, based on advice from andyhhp from SRCF.
[22:40] <andyhhp> curl_process_msgs()'s use of "static int slept" is dangerous and racy.  an optimising compiler can and probably will do bad things
[22:45] <ff266> with respect to "static int slept", should i just put a volatile in front of it? So "volatile static int slept"?
[22:46] <ff266> I meant "static volatile int slept;"
[22:47] <andyhhp> lets say yes for the sake of argument
[22:47] <andyhhp> "its complicated"
[22:47] <andyhhp> but that will broadly do what you want
2019-09-04 17:43:29 +01:00
Fufu Fang 79004cb7ee
andyhhp from SRCF told me to put "void" into functions that take no parameter. 2019-09-04 17:43:29 +01:00
Fufu Fang b6777c0478
Bugfix: No longer deadlock after encountering HTTP 429 while filling up a Linktable.
- Renamed some functions
- After initialise parse of the HTML file, files are no longer assigned as LINK_FILE. They are now assigned as LINK_UNINITIALISED_FILE.
- Link_req_file_stat() now crashes if the link type is other than LINK_UNINITIALISED_FILE.
2019-09-04 17:43:18 +01:00
Fufu Fang 367ce58e7f
change the maximum number of stack frames returned by backtrace() 2019-09-03 19:29:37 +01:00
Fufu Fang cf49bf86b8
improved LinkTable_fill() status message 2019-09-03 15:12:38 +01:00
Fufu Fang 656edbf578
improved error messages when mutex locking/unlocking fails 2019-09-03 14:59:30 +01:00
Fufu Fang c7dfa241d4
Backtrace will now be printed when the program crashes
- Note that static functions are not included in the printed backtrace.
2019-09-03 14:53:32 +01:00
Fufu Fang 9ff099cd3a
added a status indicator when filling up the linktable 2019-09-03 14:02:41 +01:00
Fufu Fang 765f4e00d0
Updated Makefile, fixed issue #44
- When header files get changed, the relevant object will get recompiled.
2019-09-02 17:56:23 +01:00
Fufu Fang ee397d1513
Data_read() no longer gives warning messages when reaching the end of the cache file. 2019-09-02 16:51:42 +01:00
Fufu Fang 4c0b7da34b
stop the background download thread from pre-fetching beyond EOF 2019-09-02 16:05:55 +01:00
Fufu Fang eb463478a8
The background download thread is being spawned again. 2019-09-02 15:47:10 +01:00
Fufu Fang 6c8a15d8cc
Fixed buffer over-read at the boundary.
- Say we are using a lock size of 1024k, we send a request for 128k at 1008k. It won't trigger the download, because we already download 1024k at 0. So it would read off from the empty disk space!
- This problem only occurs during the first time you download a file. During subsequent accesses, when you are only reading from the cache, this problem does not occur.
2019-09-02 15:19:41 +01:00
Fufu Fang 9e3e4747ae
fixed Cache_bgdl()
- Cache_bgdl() used to corrupt the cache file
2019-09-02 09:04:20 +01:00
Fufu Fang e06ea6dc06
Wrapped mutex lock / unlock functions into function rather than macro 2019-09-01 21:36:58 +01:00
Fufu Fang ed5457c76f
Bugfix: partially fixed the cache lock
- now when the same file is opened twice, the fread() output is consistent.
2019-09-01 11:39:47 +01:00
Fufu Fang 20f30a0e38
Tidied up some of the comments and formatting 2019-09-01 08:52:18 +01:00
Fufu Fang 1a44a4d960
Wrapped mutex locking and unlocking functions in error checking macro 2019-09-01 01:21:40 +01:00
Fufu Fang 92a9658c66
Cache system bug fix
- Now keep track of the number of times a file has been opened. The on-disk
cache file no longer gets opened multiple times, if a file is opened multiple
times.
2019-09-01 00:43:50 +01:00
Fufu Fang afb2a8fe6c
Directory listing performance improvement while file transfers are going on
- Added a LinkTable generation priority lock
- This allows LinkTable generation to be run exclusively. This
effectively gives LinkTable generation priority over file transfer.
2019-08-31 21:21:28 +01:00
Fufu Fang d6fbcb4113 fixed issue #40
curl handles should NOT be added when there are transfers going on!!!
2019-08-31 08:10:36 +01:00
Fufu Fang 600f3c3fe5 added more documentation 2019-08-27 10:52:46 +01:00
Fufu Fang 20577e516c updated README.me, suppress "-Wunused-function" in crypto lock function in network.c 2019-08-24 18:13:47 +01:00
Fufu Fang e409e816eb Merge branch 'master' of github.com:fangfufu/httpdirfs 2019-08-23 23:21:26 +01:00
Fufu Fang 23611b8b1c Version 1.1.7
- Now mutex associated debugging outputs are not compiled by default.
- Tagging version 1.1.7
2019-08-23 23:15:01 +01:00
Jerome Charaoui 6ba5ccda0e tweak usage texts 2019-08-23 12:44:06 -04:00
Jerome Charaoui 145f70aa33 refer to usage info on argument parsing error 2019-08-23 12:43:23 -04:00
Jerome Charaoui e71576ded6 print limited FUSE options 2019-08-23 12:42:39 -04:00
Jerome Charaoui 290ad9482e rename long help function 2019-08-23 12:40:19 -04:00
Fufu Fang 45cee81e15 reverting segment size back to 8MB 2019-07-28 09:38:54 +01:00
Fufu Fang 71da71148f removed excess fflush 2019-07-28 09:31:49 +01:00
Fufu Fang ab15800b3a improved error message 2019-07-28 08:20:17 +01:00
Fufu Fang c72b0d4a7f added pthread_detach() for cleanup 2019-07-27 02:49:38 +01:00
Fufu Fang 91af975ff8 changed default segment size, moved the locking sequence of bgt_lock and rw_lock 2019-07-26 00:06:36 +01:00
Fufu Fang 64cd6ca2c6 added more debug messages 2019-07-24 17:55:32 +01:00
Fufu Fang c660159a18 added mutex locking / unlocking messages 2019-07-22 09:25:30 +01:00
Fufu Fang ee2d3edcbf Fixed issue #37
If a cache file already exists, the download segment size is set
to the size set by the metadata. The user specified download
segment size is ignored for existing cache files.
2019-07-21 17:53:35 +01:00
Fufu Fang 6aa180db5e updated some error message 2019-07-21 17:08:25 +01:00
Fufu Fang ed37aa5ca0 removed CURL_LOCK_DATA_CONNECT to solve #36 without disabling HTTP2 2019-07-21 08:41:02 +01:00
Fufu Fang 4491377f64 forces HTTP1.1 to fix issue #36 2019-07-20 19:25:25 +01:00
Fufu Fang 78d816716c Fixed issue #34 - file / directory detection 2019-07-20 17:19:40 +01:00
Fufu Fang a4fd2e17dc changed variable size to fix Wstringop-truncation warnings 2019-07-20 15:33:08 +01:00
Fufu Fang 22b672d4e2 updated help message and readme 2019-04-30 08:24:56 +01:00
Fufu Fang 283520136c Closing issue #33, now set a default cache directory 2019-04-30 08:06:09 +01:00
Fufu Fang 99b530ee15 changed the way the full path for the config file is calculated. 2019-04-29 23:40:48 +01:00
Fufu Fang 88efbdf87c path_append now check both path and filename for '/' 2019-04-29 23:40:21 +01:00
Fufu Fang f1c7e6e97e setting CURLMOPT_MAX_HOST_CONNECTIONS just in case 2019-04-28 01:24:35 +01:00
Fufu Fang 74878cfcfe rearranged the orders of the help text 2019-04-27 04:59:46 +01:00
Fufu Fang 4acf91a2b8 added --max-seg-count command line option 2019-04-27 04:52:39 +01:00
Fufu Fang 2a93e95aea improved debug message formatting 2019-04-27 03:28:28 +01:00
Fufu Fang ba8c7232e2 HTTP 429, LinkTable_print(), variable shadowing
changed the way HTTP 429 gets handled while querying for file stats
fixed LinkTable_print(), added variable shawdowing warning in Makefile
2019-04-27 02:42:29 +01:00
Fufu Fang 2a2ac2dce2 rewrote curl_multi_perform_once() 2019-04-27 01:53:09 +01:00
Fufu Fang 2cee4b33a7 cosmetic changes 2019-04-26 23:29:16 +01:00
Fufu Fang 3c0a5fdf65 removed excess #include directive 2019-04-26 23:10:09 +01:00
Fufu Fang 040092b8bb improved error message during sleeping 2019-04-26 20:39:29 +01:00
Fufu Fang 7c1c1d2195 added retry-wait command line option 2019-04-26 20:37:49 +01:00
Fufu Fang 6cef84874c fixed LinkTable_print() 2019-04-26 19:49:20 +01:00
Fufu Fang 17587852ff fixed LinkTable_gap_fill 2019-04-26 19:47:03 +01:00
Fufu Fang 1dc54afdeb Improved LinkTable_fill() and LinkTable_gapfill() 2019-04-26 19:30:39 +01:00
Fufu Fang 245d4a3ff4 removed the restriction for Link_get_stat() 2019-04-26 18:53:26 +01:00
Fufu Fang 9fe02d8304 reverted LINK_INVALID to '\0' 2019-04-26 18:50:41 +01:00
Fufu Fang 99761b249a restored LinkTable_print() 2019-04-26 18:45:38 +01:00
Fufu Fang 8110438cd1 reduce the amount of debug output 2019-04-26 18:30:35 +01:00
Fufu Fang e2c47260a0 now calculate the number of invalid links in the linktable 2019-04-26 18:25:40 +01:00
Fufu Fang 3f41aba125 remove unnecessary lock 2019-04-26 18:09:39 +01:00
Fufu Fang 84f2ebc970 improved error messages 2019-04-26 16:24:55 +01:00
Fufu Fang 39820e3814 improved performance when encountering HTTP 429 2019-04-26 16:20:01 +01:00
Fufu Fang 9717d016ed added LinkTable_gap_fill() to fill in the gaps in the link table when it is loaded from the disk 2019-04-26 15:35:48 +01:00
Fufu Fang 15cbe8a693 removed some locks 2019-04-26 14:36:54 +01:00
Fufu Fang 7d81d742d3 more error messages in curl_process_msgs() for handling HTTP 429 2019-04-26 14:25:52 +01:00
Fufu Fang 04c0499fae added HTTP 429 handling for file stat query 2019-04-26 14:14:42 +01:00
Fufu Fang 93f9701aa8 minor error message formatting 2019-04-26 13:32:59 +01:00
Fufu Fang 774f14c8e7 if we get HTTP 429, wait for 5 secs 2019-04-26 13:20:55 +01:00
Fufu Fang 9065dcffb5 minor bug fix 2019-04-26 11:43:35 +01:00
Fufu Fang edc3df733c minor bug fix 2019-04-26 11:42:11 +01:00
Fufu Fang 85d66adf6c added command line switch to configure user agent and the maximum number of network connections allowed 2019-04-26 11:39:03 +01:00
Fufu Fang f4fd419528 added command line option to change the number of the maximum number of network connection allowed 2019-04-26 11:27:39 +01:00
Fufu Fang 80a98a79f9 improved thread synchronisation, to stop Cache_read() from downloading the segment that is being downloaded in the background by Cache_bgdl() 2019-04-26 10:57:07 +01:00
Fufu Fang f479482d7b stop Cache_bgdl() from downloading past the last segment, remove excess debug message 2019-04-26 10:36:25 +01:00
Fufu Fang 5f6fc3f761 Now caches the directory structures by dumping LinkTables to the disk. 2019-04-26 08:26:47 +01:00
Fufu Fang 9a5f37d91f replaced strndupcat with path_append, added LinkTable_disk_*() functions 2019-04-26 07:39:45 +01:00
Fufu Fang 825bd4d3fb added the command line switch to control the download segment size 2019-04-25 21:34:07 +01:00
Fufu Fang b6b101bc63 removed unnecessary goto statements 2019-04-25 13:14:54 +01:00
Fufu Fang df025b1caf improved the correctness of Cache_bgdl() 2019-04-25 08:50:04 +01:00
Fufu Fang f5acebafe2 Merge branch 'master' of github.com:fangfufu/httpdirfs 2019-04-25 01:17:18 +01:00
Fufu Fang f628939713 Now dynamically allocate the receive buffers on the heap. 2019-04-25 00:58:29 +01:00
Fufu Fang 86999915e8
Merge pull request #29 from Lewiscowles1986/patch-1
Make larger block size
2019-04-24 23:59:02 +01:00
Fufu Fang e442871899 added Cache_background_download() to enable the download of the next block 2019-04-24 23:58:26 +01:00
Lewis Cowles 6d02b0554b
Make larger block size
The queue is inherently serial, not a queue data structure, and the code has no concurrency / parallelization added, but making the block-size larger should increase supported file-size & use disk cache more efficiently.
2019-04-24 06:22:43 +01:00