]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Blah 2553.do-not-read-from-own-dmd.1
authorDaira Hopwood <daira@jacaranda.org>
Mon, 2 Nov 2015 22:00:47 +0000 (22:00 +0000)
committerDaira Hopwood <daira@jacaranda.org>
Mon, 2 Nov 2015 22:00:47 +0000 (22:00 +0000)
src/allmydata/frontends/magic_folder.py

index 09b646d9ad686a39bea278abec93324a6abb00a4..35db9597afbe5fcb47328c70ac68bb216aca5ce7 100644 (file)
@@ -123,6 +123,7 @@ class QueueMixin(HookMixin):
         self._turn_delay = 0
 
     def _get_filepath(self, relpath_u):
+        self._log("_get_filepath(%r)" % (relpath_u,))
         return extend_filepath(self._local_filepath, relpath_u.split(u"/"))
 
     def _get_relpath(self, filepath):
@@ -299,6 +300,7 @@ class Uploader(QueueMixin):
         if relpath_u is None:
             return
         precondition(isinstance(relpath_u, unicode), relpath_u)
+        precondition(not relpath_u.endswith(u'/'), relpath_u)
 
         d = defer.succeed(None)
 
@@ -357,7 +359,7 @@ class Uploader(QueueMixin):
                     self._notifier.watch(fp, mask=self.mask, callbacks=[self._notify], recursive=True)
 
                 uploadable = Data("", self._client.convergence)
-                _assert(encoded_path_u.endswith(magicpath.path2magic(u"/")))
+                encoded_path_u += magicpath.path2magic(u"/")
                 self._log("encoded_path_u =  %r" % (encoded_path_u,))
                 upload_d = self._upload_dirnode.add_file(encoded_path_u, uploadable, metadata={"version":0}, overwrite=True)
                 def _succeeded(ign):