Hub lists fail to cache on Linux

Bug #395400 reported by Steven Sheehy on 2009-07-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AirDC++
Low
Unassigned
DC++
High
Unassigned

Bug Description

Thrown: FileException: No such file or directory: /home/steven/.dc++/HubLists/http_/hublist.openhublist.org/hublist.xml.bz2

This file cannot be created because it contains '/' in the filename and the sub directories "http_" and "hublist.openhublist.org" do not exist to create hublist.xml.bz2 in. The hub list URL needs to be normalized to a form suitable for both Windows and Linux. For example:

http://hublist.openhublist.org/hublist.xml.bz2 -> hublist.openhublist.org#hublist.xml.bz2

Or Util::validateFileName() needs to be split into Util::validateFilePath() and Util::validateFileName() so that validateFileName() can replace PATH_SEPARATORs in the name. This will allow the hublist to be saved as "http__hublist.openhublist.org_hublist.xml.bz2".

Fredrik Ullner (ullner) wrote :

The attached patch should replace the path separator with an underscore.

(I should note that when testing on Windows, just downloading a hublist, DC++ (prepatch) would create the file with underscore already and not with a directory.)

poy (poy) wrote :

that solution would flatten any file path. the issue here is that validateFileName is used for both paths (directories + separators + files) and plain files, so it can't differenciate.

Steven's suggested split seems to be the best way forward.

Fredrik Ullner (ullner) on 2013-11-30
tags: added: core
maksis (maksis) on 2013-12-01
Changed in airdcpp:
status: New → Confirmed
importance: Undecided → Low
maksis (maksis) wrote :
Changed in airdcpp:
status: Confirmed → Fix Committed
Fredrik Ullner (ullner) on 2013-12-02
Changed in dcplusplus:
status: Confirmed → In Progress
maksis (maksis) on 2013-12-04
Changed in airdcpp:
status: Fix Committed → Fix Released
poy (poy) wrote :

the changeset linked above is perfect - can you make a patch for DC++?

Fredrik Ullner (ullner) wrote :

Apply .diff or .patch to the end of a Github URL and you'll get a patch:
https://github.com/airdcpp/airgit/commit/d101c6a81ba7913a10867aa6a2063e50cb1abf09.diff
 (I only found this out a yesterday or so.)

poy (poy) wrote :

that's cool, but a patch tailored to DC++ would be preferable. one should in particular ensure we don't have more calls to the previous function that have to be renamed.

Fredrik Ullner (ullner) wrote :

This is diff targetting DC++, based on the same principle as AirDC++.

poy (poy) wrote :

looks fine; feel free to push.

Fredrik Ullner (ullner) on 2014-02-05
Changed in dcplusplus:
status: In Progress → Fix Committed
poy (poy) wrote :

Fixed in DC++ 0.840.

Changed in dcplusplus:
status: Fix Committed → Fix Released
poy (poy) wrote :

the current patch is leading to unwanted log file path changes (eg hub.example.com.log instead of hub_example_com.log). reverted in rev 7423e91f22ae.

Changed in dcplusplus:
importance: Low → High
status: Fix Released → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers