diff data/fileio/FileSource.cpp @ 336:5cd7f6d10d47

* Fix mishandling of encoded urls
author Chris Cannam
date Thu, 15 Nov 2007 13:19:25 +0000
parents 1d656dcda8ef
children 4175a4930186 6f6ab834449d
line wrap: on
line diff
--- a/data/fileio/FileSource.cpp	Sun Nov 11 20:31:12 2007 +0000
+++ b/data/fileio/FileSource.cpp	Thu Nov 15 13:19:25 2007 +0000
@@ -77,6 +77,7 @@
         waitForStatus();
 
         if (!isAvailable()) {
+
             // The URL was created on the assumption that the string
             // was human-readable.  Let's try again, this time
             // assuming it was already encoded.
@@ -85,7 +86,19 @@
                       << "\" as human-readable URL; "
                       << "trying again treating it as encoded URL"
                       << std::endl;
+
+            // even though our cache file doesn't exist (because the
+            // resource was 404), we still need to ensure we're no
+            // longer associating a filename with this url in the
+            // refcount map -- or createCacheFile will think we've
+            // already done all the work and no request will be sent
+            deleteCacheFile();
+
             m_url.setEncodedUrl(fileOrUrl.toAscii());
+
+            m_ok = false;
+            m_done = false;
+            m_lastStatus = 0;
             init(showProgress);
         }
     }