Commit Graph

302 Commits

Author SHA1 Message Date
Nathaniel Wesley Filardo 72d15ab6c7 fs_open: return EROFS for non-RO opens
The use of EACCES leads to slightly confusing error messages in
downstream consumers, so prefer EROFS to better articulate what's
actually happening.

While here, use O_RDWR to mask the open flags while testing for
non-RO access.  This is at least encouraged by POSIX with their
suggestion that "O_RDONLY | O_WRONLY == O_RDWR".
2022-06-28 15:00:48 +01:00
Nathaniel Wesley Filardo ffb2658abb getopt_long returns an int, not a char
On platforms with an unsigned char, such as Arm, this results in
always taking error paths around initialization.

Fixes https://github.com/fangfufu/httpdirfs/issues/103
2022-06-28 14:45:31 +01:00
Fufu Fang 3b25cf31ef
Merge pull request #101 from moschlar/patch-1
Fix --insecure-tls in help and README
2022-04-23 02:49:50 +01:00
Fufu Fang d2207e7a4e
fixed --version switch 2022-04-23 02:49:16 +01:00
Moritz Schlarb 4d45525c64
Update main.c 2022-04-04 15:37:36 +02:00
Fufu Fang 40c750fac9 moved the location of error string 2021-09-04 13:37:45 +01:00
Fufu Fang 67edcc906f Clean up for the master branch 2021-09-04 12:41:33 +01:00
Fufu Fang cbe8c83195 stable version for master 2021-09-04 03:15:26 +01:00
Fufu Fang ebcfb0a79e periodic backup 2021-09-04 03:00:25 +01:00
Fufu Fang 5d539c30b1 started writing the ramcache 2021-09-04 01:28:01 +01:00
Fufu Fang 939e287c87 adjusted includes 2021-09-03 21:39:31 +01:00
Fufu Fang 6819ad09e4 removed unnecessary includes 2021-09-03 21:23:52 +01:00
Fufu Fang 7c6433f0cd more refactoring 2021-09-03 17:00:32 +01:00
Fufu Fang 1efe5932cf more refactoring 2021-09-03 16:58:08 +01:00
Fufu Fang ee32ddebc9 simplified network code 2021-09-03 16:36:50 +01:00
Fufu Fang dd8d887f94 more refactoring 2021-09-03 16:29:00 +01:00
Fufu Fang d403fa339b minor refactoring 2021-09-03 15:41:22 +01:00
Fufu Fang cd6bb5bee8 more refactoring 2021-09-03 14:56:11 +01:00
Fufu Fang bc88a681e3 check return for curl_easy_setopt, also new libcurl debug level 2021-09-03 12:57:52 +01:00
Fufu Fang 08eb04fb0e refactoring - now check return code from curl_easy_getinfo 2021-09-03 12:47:48 +01:00
Fufu Fang c64a139b46 refactoring transfer_blocking 2021-09-03 12:40:35 +01:00
Fufu Fang 177b738522 removed ts_ptr from Link 2021-09-02 16:52:39 +01:00
Fufu Fang d7086c6ecf Now clear the link->cache_ptr after closing the cache 2021-09-02 16:24:55 +01:00
Fufu Fang b96ed88bec improved debug statements 2021-09-02 16:07:39 +01:00
Fufu Fang 2d42313e8f compiles, but not running properly 2021-09-02 15:36:53 +01:00
Fufu Fang 31f8509f42 moved the *sonic related fields into a separate struct 2021-09-01 21:29:13 +01:00
Fufu Fang e7f06285df improved Makefile, fixed potential memory leak at Data_create 2021-09-01 12:34:53 +01:00
Fufu Fang 86003d2b6a Meta_create() now calls fclose itself 2021-09-01 12:19:20 +01:00
Fufu Fang 464c8e4863 Merged transfer status struct and transfer data struct 2021-09-01 11:56:18 +01:00
Fufu Fang a76366c481 improved error handling in path_download 2021-09-01 11:03:27 +01:00
Fufu Fang 8f9935ee5d moved cache_opened to cache.h 2021-09-01 10:39:33 +01:00
Fufu Fang 95b86825ed Added minimum transfer size in TransferDataStruct 2021-09-01 03:53:19 +01:00
Fufu Fang 08c1eeba49 added initial debug statements 2021-08-31 21:30:24 +01:00
Fufu Fang 3c7e79089b
changed error handling for empty file 2021-08-31 18:54:58 +01:00
Fufu Fang 5e87ac92b0
Change error handling in cache.c, Updated Changelog.md 2021-08-31 18:49:49 +01:00
Fufu Fang 1e98b16602
Now prints version number at startup 2021-08-31 14:00:47 +01:00
Fufu Fang f42264d3c3
Added single file mode
Implemented feature request
https://github.com/fangfufu/httpdirfs/issues/86
2021-08-31 13:52:25 +01:00
Fufu Fang af45bcfa19
replaced strlen with strnlen 2021-08-31 12:31:02 +01:00
Fufu Fang 07603c36ba
improved log out, fixed help message output, Makefile now generates man page 2021-08-31 12:23:43 +01:00
Fufu Fang 6713362a5f
improved error handling 2021-08-31 11:59:28 +01:00
Fufu Fang 04212c3d55
added double free detection 2021-08-31 11:54:42 +01:00
Fufu Fang e02042cade
improved logging 2021-08-31 11:50:59 +01:00
Fufu Fang 45d8cb8136
changed indentation style 2021-08-31 11:18:39 +01:00
Fufu Fang f791ceb308
shortened error log format, changed indentation style 2021-08-31 11:15:00 +01:00
Fufu Fang b03954482e
changed linktable offset 2021-08-31 10:37:56 +01:00
Fufu Fang 7b6277cb3d
now check for the invalid CONFIG.mode 2021-08-31 00:23:50 +01:00
Fufu Fang 81ed433182
changed some comments and indentation 2021-08-31 00:13:17 +01:00
Fufu Fang 7542db7077
changed default log level 2021-08-30 12:05:02 +01:00
Fufu Fang 82c87d5120
fixed some comments 2021-08-30 12:03:51 +01:00
Fufu Fang 510969a780
fixed deadlock 2021-08-30 11:55:04 +01:00
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