Commit Graph

565 Commits

Author SHA1 Message Date
Fufu Fang 07475660f1
updated LinkTable invalidation 2024-05-11 23:15:32 +01:00
Fufu Fang a5a53442b2
updated the description for refreshing directories 2024-05-11 17:28:23 +01:00
Fufu Fang 9e383ad7a3
Moved linktable freshness check around
Fixed https://github.com/fangfufu/httpdirfs/issues/141
2024-05-11 01:53:30 +01:00
Fufu Fang 127f2194d0
added more comments 2024-05-07 01:44:01 +01:00
Fufu Fang 4fb95ee5a0
attempt to fix codeql 2024-05-06 00:47:22 +01:00
Fufu Fang 720db5aafa
fixed cache system for percentage encoded file in single-file mode 2024-05-06 00:12:03 +01:00
Fufu Fang 28293b5ccd
fixed erroneous error check 2024-05-05 03:14:51 +01:00
Fufu Fang 1a20318654
added more debug statements 2024-05-05 02:55:10 +01:00
Fufu Fang 9a7eabd170
modified debug message 2024-05-05 02:04:31 +01:00
Fufu Fang 01fd2e9559
changed the way debug level works 2024-05-05 02:00:46 +01:00
Fufu Fang be666d72e9
removed semi-colon at the end of a macro 2024-05-05 00:32:00 +01:00
Fufu Fang 1fa3830dec
run through the formatter 2024-05-03 07:39:14 +01:00
Fufu Fang 8aa7c570c8
added a todo note 2024-05-03 07:37:44 +01:00
Fufu Fang 389a657170
improved debug message 2024-05-03 07:33:41 +01:00
Fufu Fang 257bb22e80
Merge branch 'master' into debug 2024-05-03 07:20:08 +01:00
Fufu Fang a299819b7d
fixed a memory leak, improved error handling in cache system 2024-05-03 07:19:24 +01:00
Fufu Fang 3e7d9f0294
start labelling what might be wrong. 2024-05-03 06:44:59 +01:00
Fufu Fang 63455c54cc
initial commit to the debug branch 2024-05-03 06:44:33 +01:00
Fufu Fang d4c7d8c92a
added more debug message 2024-05-03 06:44:01 +01:00
Fufu Fang dfc83d0e1c
improved debug message 2024-05-03 06:24:50 +01:00
Fufu Fang 96a7c248d3
improved debug message 2024-05-03 05:59:09 +01:00
Fufu Fang f92fe4232a
attempt to fix codeQL 2024-05-02 07:07:58 +01:00
Fufu Fang 91351689f1
LinkTable now saves the refresh time 2024-05-02 06:59:22 +01:00
Fufu Fang 1a3f36a92c
Corrected an implementation error and added more comments 2024-05-02 04:45:34 +01:00
Fufu Fang d6d4af0c8c
Update README.md
Fix https://github.com/fangfufu/httpdirfs/issues/136
2024-04-20 01:30:52 +01:00
Fufu Fang f48ee93931
Update README.md 2024-02-01 09:58:05 +00:00
Fufu Fang 983b1edfbd
Updated README 2024-02-01 06:28:36 +00:00
Fufu Fang 707d9b9253
Configure online code scanning tools
- Added .deepsource.toml for Deep Source
- Added configuration for GitHub CodeQL
2024-02-01 02:53:26 +00:00
Fufu Fang 81aac8bb57
fixed spelling, ran through the formatter 2024-01-13 12:31:47 +00:00
Mattias Runge-Broberg 35a213942c
Fix for single file mode not working
- Fix for not sending ranges which exceed the content-length which will result
in an error.
- Fix for byte range being set to 1 byte too large, it should be the end index,
not the size as described in
https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests
2024-01-13 12:30:52 +00:00
Fufu Fang 595c6d275e
Remove spurious code
Remote spurious code flagged by 8451da6ac7,
which was introduced by e76b079fe6
Closes https://github.com/fangfufu/httpdirfs/issues/124
2023-10-03 23:10:24 +01:00
chrysn bd33966337 Allow leading `./` segments in links 2023-10-02 23:44:18 +01:00
Jonathan Kamens 29c3eb8f67 Convert build process to use autotools (autoconf, automake, etc.)
This commit converts the build process from a hand-written Makefile
that works on Linux, FreeBSD, and macOS, to an automatically generated
Makefile managed by the autotools toolset.

This incldues:

* Add the compile, config.guess, config.sub, depcomp, install-sh, and
  missing helper scripts that autotools requires to be shipped with
  the package in order for configure to work.
* Rename Makefile to Makefile.am and restructure it for compatibility
  with autotools and specifically with the stuff in our configure
  script.
* Create the configure.ac source file which is turned into the
  configure script.
* Rename Doxyfile to Doxyfile.in so that the source directories can be
  substituted into it at configure time.
* Tweak .gitignore to ignore temporary and output files related to
  autotools.
* Generate Makefile.in, aclocal.m4, and configure using `autoreconf`
  and include them as checked-in source files.

While I can't fully document how autotools works here the basic
workflow is that when you need to make changes to the build, you
update Makefile.am and/or configure.ac as needed, run `autoreconf`,
and commit the changes you made as well as any resulting changes to
Makefile.in, aclocal.m4, and configure. Makefile should _not_ be
committed into the source tree; it should always be generated using
configure on the system where the build is being run.
2023-09-29 23:45:47 +01:00
Jonathan Kamens ed93a133df Fix minor logic bug and code smell in make_link_relative
Don't assume that the reason why we didn't find enough slashes in a
URL is because the user didn't specify the slash at the end of the
host name, unless we did find the first two slashes.

Add some curly braces around an if block to make it clear to people
and the compiler which statement an `else` applies to. The logic was
correct before but the indentation was wrong, making it especially
confusing.
2023-09-29 23:45:47 +01:00
Jonathan Kamens 7bcd43068d Fix broken curl HTTP response code check
The check for the HTTP response code from the curl library was written
incorrectly and guaranteed to always fail. I've fixed the logic to
reflect what I believe was intended.
2023-09-29 23:45:47 +01:00
Jonathan Kamens ab49ca76b6 Add missing return value check for fread call 2023-09-29 23:45:47 +01:00
Jonathan Kamens 8451da6ac7 Comment out small block of code that doesn't do anything
There's a small block of code that calls strnlen on a string, saves
the esult in a variable, conditionally decrements the variable, and
then does nothing with it, making the entire block of code a no-op.

I don't want to just remove it entirely since it's possible that there
was intended to be some sort of check here that was inadvertently
omitted. So to make the compiler stop complaining I've commented out
the code, but I've left a comment above it explaining why it was
commented out and pointing out that maybe something different needs to
be done with it.
2023-09-29 23:45:47 +01:00
Jonathan Kamens e253b4a9ee Eliminate some compiler warnings 2023-09-29 23:45:47 +01:00
Jonathan Kamens 8f0ef158c0 Remove spurious arguments to print_version() 2023-09-29 23:45:47 +01:00
Jonathan Kamens c532661d29 Add missing error-checking for return value of fread
Several calls to fread were missing checks to ensure that the expected
amount of data was read.
2023-09-29 23:45:47 +01:00
Jonathan Kamens 7363adaf12 Handle sites that put unencoded characters in URLs that curl dislikes
Some sites put unencoded characters in their href attributes that
really should be encoded, most notably spaces. Curl won't accept a URL
with a space in it, and perhaps other such characters as well. Address
this by properly encoding characters in URLs before feeding them to
Curl.
2023-09-29 12:47:55 +01:00
Jonathan Kamens e94b5441f3 Add a few more debug messages to help trace program execution 2023-09-29 12:47:55 +01:00
Jonathan Kamens 3beccd2c2d Enabling debugging on command line should enable debug logging
I believe an appropriate expectation is that if the user enables
debugging with a command-line flag, then that should also enable
messagse designated as debug messages in the code to be printed.
2023-09-29 12:47:55 +01:00
Jonathan Kamens 4d323b846f Do the right thing with sites that use absolute links
On some sites, the link to each subfolder is an absolute link rather
than a relative one. To accommodate this, convert the links from
absolute to relative before storing them in the link table.
2023-09-29 12:47:55 +01:00
Jonathan Kamens 41cb4b80bc Do the right thing with sites that require the final slash
Some web sites will return 404 if you fetch a directory without the
final slash. For example, https://archive.mozilla.org/pub/ works,
https://archive.mozilla.org/pub does not. We need to do two things to
accommodate this:

* When processing the root URL of the filesystem, instead of stripping
  off the final slash, just set the offset to ignore it.
* In the link structure, store the actual URL tail of the link
  separately from its name, final slash and all if there is one, and
  append that instead of the name when constructing the URL for curl.
2023-09-29 12:47:55 +01:00
Fufu Fang 1e80844831 ran the code through formatter 2023-07-26 07:48:33 +08:00
Fufu Fang 6d8db94458 minor formatting changes for PR #114 2023-07-26 07:48:22 +08:00
Fufu Fang 282605b0ac fix: changed deprecated libcurl call 2023-07-25 14:57:08 +08:00
Mike Morrison a309994b9e
Add setting to refresh directory contents (#114)
Refresh a directory's contents when fs_readdir is called
if it has been more than the number of seconds specified by
--refresh_timeout since the directory was last indexed.
2023-03-31 13:26:15 +01:00
Kian-Meng Ang 9a7016f29b
Fix typos (#117)
Found via `codespell`
2023-03-28 05:00:07 +01:00