]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Merge branch '2438.magic-folder-stable.9' of https://github.com/tahoe-lafs/tahoe... 2438.magic-folder-stable.10
authorDaira Hopwood <daira@jacaranda.org>
Sat, 30 Jan 2016 23:31:11 +0000 (23:31 +0000)
committerDaira Hopwood <daira@jacaranda.org>
Sat, 30 Jan 2016 23:31:11 +0000 (23:31 +0000)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
1  2 
src/allmydata/frontends/magic_folder.py
src/allmydata/magicfolderdb.py

index 353b8facc8d2e2ad14d7448667dd20e8bd180353,323e926f974a64b9348021306a194364dc38d774..bd226156d23b81c576b988c32d1babe63c3d3512
@@@ -612,9 -616,13 +616,13 @@@ class Downloader(QueueMixin, WriteFileM
              node = None
              for success, result in deferredList:
                  if success:
 -                    else:
 -                        if result[1]['version'] > max_version:
 -                            node, metadata = result
 -                            max_version = result[1]['version']
+                     if 'version' not in result[1]:
+                         self._log("invalid remote metadata detected")
+                         continue
++
 +                    if result[1]['version'] > max_version:
 +                        node, metadata = result
 +                        max_version = result[1]['version']
              return node, metadata
          collective_dirmap_d.addCallback(highest_version)
          return collective_dirmap_d
  
                  file_node, metadata = listing_map[encoded_relpath_u]
                  local_version = self._get_local_latest(relpath_u)
-                 remote_version = metadata.get('version', None)
++
+                 if 'version' not in metadata:
+                     self._log("invalid remote metadata detected for %r" % (relpath_u,))
+                     continue
 -                else:
 -                    remote_version = metadata['version']
++
++                remote_version = metadata['version']
                  self._log("%r has local version %r, remote version %r" % (relpath_u, local_version, remote_version))
  
-                 if local_version is None or remote_version is None or local_version < remote_version:
+                 if local_version is None or local_version < remote_version:
                      self._log("%r added to download queue" % (relpath_u,))
                      if scan_batch.has_key(relpath_u):
                          scan_batch[relpath_u] += [(file_node, metadata)]
index 982b5fe298f8b02f52182d6b608b292d8bbdccf1,fdda3f0624f6a306a225ff9ad66c32dc1c72f8f5..1729e3f860ec8a6c83bf39994f73119a485a76b8
@@@ -17,12 -17,12 +17,12 @@@ CREATE TABLE local_file
   path                VARCHAR(1024) PRIMARY KEY, -- UTF-8 filename relative to local magic folder dir
   -- note that size is before mtime and ctime here, but after in function parameters
   size                INTEGER,                   -- ST_SIZE, or NULL if the file has been deleted
-  mtime               NUMBER,                      -- ST_MTIME
-  ctime               NUMBER,                      -- ST_CTIME
+  mtime               REAL,                      -- ST_MTIME
+  ctime               REAL,                      -- ST_CTIME
   version             INTEGER,
-- last_uploaded_uri   VARCHAR(256),                -- URI:CHK:...
-- last_downloaded_uri VARCHAR(256),                -- URI:CHK:...
-  last_downloaded_timestamp TIMESTAMP
++ last_uploaded_uri   VARCHAR(256),              -- URI:CHK:...
++ last_downloaded_uri VARCHAR(256),              -- URI:CHK:...
+  last_downloaded_timestamp REAL
  );
  """