fangfufu / httpdirfs

A filesystem which allows you to mount HTTP directory listings or a single file, with a permanent cache. Now with Airsonic / Subsonic support!
Other
778 stars 59 forks source link

Problem associated with stripping the last ``/`` in the URL. #142

Open WizzardSK opened 6 months ago

WizzardSK commented 6 months ago

This issue had been modified as the root cause became more clear.

It appears that stripping the last / can cause problems for some servers: https://github.com/fangfufu/httpdirfs/issues/142#issuecomment-2105934381

Perhaps we need to add / at the end of the URL for directories.

From @WizzardSK

Maybe the problem is that some folders ending with ".com" remove that slash? I dont understand that.


Original text:

When I browse mounted folder which contains folder with dot in the name, it causes segfault:

Warning:src/link.c:893:Link_download_full: cannot retrieve URL: https://myserver/Tiger%20-%20Game.com, HTTP 404 ./httpdirfs: line 11: 5282 Segmentation fault (core dumped) "$tmp_dir/ld-linux-x86-64.so.2" --library-path "$tmp_dir" "$tmp_dir/httpdirfs" "$@"

fangfufu commented 6 months ago

The segfault is due to HTTP 404, rather than having "." in the file name, I think. I cannot reproduce locally.

WizzardSK commented 6 months ago

Ok, maybe you are right, can you please try on this folder? https://myrient.erista.me/files/No-Intro/Tiger%20-%20Game.com/

I mount just https://myrient.erista.me/files and then want to browse No-Intro folder

fangfufu commented 6 months ago

Sure, I will give it a go later today. :)

fangfufu commented 6 months ago

Hmm it hangs on my machine. Have you got a full log? When I manually kill it, it stops at Linktable_print.

fangfufu commented 6 months ago

Okay, I think the hanging might be due to some sort of rate limiting mechanism on the server. I cannot reproduce the problem you described. Which distro are you using?

fangfufu commented 6 months ago

Do you own that server, btw?

WizzardSK commented 6 months ago

I am using Kubuntu 24.04. I do not own that server. Can attach full log later, not at the computer now. So it hangs on your system too on segfault?

fangfufu commented 6 months ago

For that particular server, you could consider using https://wiki.archlinux.org/title/CurlFtpFS

fangfufu commented 6 months ago

So it hangs on your system too on segfault?

It hangs, but it doesn't segfault.

WizzardSK commented 6 months ago

Just some more info. It causes segfault when I access it from Krusader. When I access it in Midnight Commander or in command line, it looks like the folder is empty.

this is the last log entry when opening in MC:

Warning:src/link.c:893:Link_download_full: cannot retrieve URL: https://myrient.erista.me/files/No-Intro/Tiger%20-%20Game.com, HTTP 404 Warning:src/link.c:893:Link_download_full: cannot retrieve URL: https://myrient.erista.me/files/No-Intro/Tiger%20-%20Game.com, HTTP 404

fangfufu commented 6 months ago

Ahh it appears to be related to the behaviour of stripping the last /.

Try and access these two links below: https://myrient.erista.me/files/No-Intro/Tiger%20-%20Game.com/ https://myrient.erista.me/files/No-Intro/Tiger%20-%20Game.com

The hanging is related to accessing the link without the /.

WizzardSK commented 6 months ago

It indeed works weird. I cannot open that problematic folder without / on the end. But all other folders add that slash automatically and do not have that problem. Maybe the problem is that some folders ending with ".com" remove that slash? I dont understand that.

fangfufu commented 6 months ago

This is related to PR https://github.com/fangfufu/httpdirfs/pull/121

fangfufu commented 6 months ago

@WizzardSK , well that web server you linked to is not "well-behaved", I can't quite replicate its behaviour on my local Apache, that server you pointed at crashes my httpdirfs every time.

On your system, what is its last LinkTable_print print out? I want to find out the URL associated with that directory entry.

WizzardSK commented 6 months ago

It depends of which folder I check the last. When I use command line, I switcih to parent folder, it shows something like this: LinkTable_print: 338 D 0 iQue - iQue (Decrypted) https://myrient.erista.me/files/No-Intro/iQue%20-%20iQue%20%28Decrypted%29

Then when I switch to that bad fodler, I see this: Warning:src/link.c:893:Link_download_full: cannot retrieve URL: https://myrient.erista.me/files/No-Intro/Tiger%20-%20Game.com, HTTP 404

fangfufu commented 6 months ago

Could you post a full log please?

WizzardSK commented 6 months ago

Ok, I tried that in Krusader this time to show how it crashes on segfault

log.txt

fangfufu commented 6 months ago

Cheers!

Btw, does the software crash on other servers that you use?

WizzardSK commented 6 months ago

Cannot confirm, cause I only use this server.

Dňa ne 12. 5. 2024, 20:11 Fufu Fang @.***> napísal(a):

Cheers!

Btw, does the software crash on other servers that you use?

— Reply to this email directly, view it on GitHub https://github.com/fangfufu/httpdirfs/issues/142#issuecomment-2106333375, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKHCB4THZRQC622JPA4E3FTZB6WENAVCNFSM6AAAAABHQUSBZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGMZTGMZXGU . You are receiving this because you were mentioned.Message ID: @.***>