changeset 336:5cd7f6d10d47

* Fix mishandling of encoded urls
author Chris Cannam
date Thu, 15 Nov 2007 13:19:25 +0000
parents aa8dbac62024
children f14e2f7b24f7
files data/fileio/FileSource.cpp
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
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);
         }
     }