Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[RELOAD-60] Performed tests, fixed bugs found, update works now.

  • Loading branch information...
commit 772e708b799c9ef5207885802f3ce3d23d68e319 1 parent 5522e45
Mikael Kindborg authored
Showing with 13 additions and 8 deletions.
  1. +4 −3 libs/MAFS/File.c
  2. +9 −5 libs/Wormhole/WebAppMoblet.cpp
View
7 libs/MAFS/File.c
@@ -35,14 +35,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
// broken header files in linux/native
int sprintf(char *buf, const char *fmt, ...);
+// Macros for or debugging.
#define LOG(x, ...) //lprintfln
-
-// For debugging.
-#if(0)
// Problems with newlib prevent use of lprintfln in this file.
// Here are macros to make maWriteLog easier to use.
#define MYLOG(message) maWriteLog(message, strlen(message))
// Print a message and an int value.
+#if(0)
static char sLogBuf[1024];
#define MYLOGN(message, intValue) if(1){\
sprintf(sLogBuf, "%s%d", message, intValue);\
@@ -438,6 +437,8 @@ static int extractRecursively(VolumeEntry* vol, const char* basePath, int isRoot
{
// Open file.
sprintf(path, "%s%s", basePath, vol->name);
+ //MYLOG("@@@EXTRACTING:");
+ //MYLOG(path);
file = openFileForWriting(path);
if (-1 == file) { return -1; }
View
14 libs/Wormhole/WebAppMoblet.cpp
@@ -295,16 +295,18 @@ namespace Wormhole
// Assume checksum has changed (or does not exist).
bool hasChanged = true;
- // Read existing checksum value and check it.
+ // Checksum file path.
MAUtil::String filePath = getFileUtil()->getLocalPath();
filePath += "MoSyncFileBundleChecksum";
- // Get checksum of the file system bundle.
+ // Read checksum of the file system bundle.
int checksum = getFileUtil()->getFileSystemChecksum(1);
+ // REad checksum from file and compare.
MAUtil::String data;
if (getFileUtil()->readTextFromFile(filePath, data))
{
+ // Read from file succeeded. Compate values.
int existingChecksum = (int)strtol(data.c_str(), NULL, 10);
hasChanged = checksum != existingChecksum;
}
@@ -320,15 +322,17 @@ namespace Wormhole
// Get checksum of the file system bundle.
int checksum = getFileUtil()->getFileSystemChecksum(1);
+ // Checksum file path.
+ MAUtil::String filePath = getFileUtil()->getLocalPath();
+ filePath += "MoSyncFileBundleChecksum";
+
// Save checksum value.
if (checksum != 0)
{
- char checksumBuf[32];
+ char checksumBuf[128];
sprintf(checksumBuf, "%d", checksum);
getFileUtil()->writeTextToFile(filePath, checksumBuf);
}
-
- return hasChanged;
}
} // namespace
Please sign in to comment.
Something went wrong with that request. Please try again.