Commit graph

106 commits

Author SHA1 Message Date
Klaas Freitag
7b22972630 Add excluded files to the tree with IGNORE instruction 2013-08-06 18:01:34 +02:00
Klaas Freitag
d585742609 Log if the Etag in the journal is empty. 2013-08-06 12:12:53 +02:00
Daniel Molkentin
8c9799cede Ignore false-positive compiler warnings 2013-08-02 15:19:41 +02:00
Daniel Molkentin
8d99364d63 Eliminate all warnings
- use proper casts
- use aproproate types
- offer to build with -Werror
- make printf attribute hinting gnu format style
- remove unused helper methods
- begin to use inttyes.h macros where suitable
- move var declarations to the beginning of the method
- properly use _FILE_OFFSET_BITS
- silence variables unused depending on the define
2013-07-31 13:12:10 +02:00
Olivier Goffart
af7e36422e Add ignore files that need cleanup
Add the possibility to ignore files but specify they should be deleted
if the directory is deleted.
2013-07-29 15:03:25 +02:00
Olivier Goffart
7a8b07443f Fix cases where the file has been replaced by another with the same mtime
IL issue 169
2013-07-23 16:03:50 +02:00
Olivier Goffart
1c9fa48d60 Create a function to free a csync_file_stat 2013-07-02 18:25:17 +02:00
Olivier Goffart
0dbecb129e Log the fact that csync was aborted 2013-06-19 18:41:30 +02:00
Olivier Goffart
ed76e5f1f2 Fix conflict file appearing when a file cannot be stated
We still need to fetch the md5 from the database to be able to store it
back.
2013-06-13 15:06:35 +02:00
Klaas Freitag
e92dd4c1da Removed some logs that are not needed. 2013-06-05 16:35:48 +02:00
Klaas Freitag
92b0af4b0a Compare the correct type. 2013-05-22 16:13:27 +02:00
Olivier Goffart
d8d4f118d7 Fix possible leak 2013-05-15 17:59:13 +02:00
Klaas Freitag
1a648a612e Merge remote-tracking branch 'ogoffart/rename_folders_merged' into dav 2013-05-13 16:28:31 +02:00
Klaas Freitag
276ccd3fb6 Fix setting of csync error code in updater. 2013-05-09 14:12:26 +02:00
Daniel Molkentin
ee5aaf76c5 Introduce csync_abort()
If called, it will set a bool in the context,
which will be respected by all expensive visitors.
2013-05-08 16:57:12 +02:00
Olivier Goffart
3c87cd71d7 Merge branch 'rename_folders' into dav
Conflicts:
	modules/csync_owncloud.c
	src/csync.c
	src/csync.h
	src/csync_propagate.c
	src/csync_propagate.h
	src/csync_statedb.c
	src/csync_statedb.h
	src/csync_util.c
	src/std/c_path.h
2013-05-07 15:24:12 +02:00
Olivier Goffart
b1fc9b2a64 Don't reset the md5 if the mtime change locally.
Consider this case when one creates a file with an invalid filename (for
the server) in a directory in the local side.
say: foo/bar/%invalid%.txt

The following would happen:
- in the update for the local parent folder  foo/bar/, the md5 is 0
  because the mtime has changed
- During the reconcile, we try to send %invalid%, but there will be an
  error and nothing will be changed on the server, the etags stay the
  same
- We do not do any PROPFIND at the end so we do not fetch the etag
  anymore.  The md5 is still 0 and will be saved like that in the DB
- Next run, since the etags have  not changed on the server, we read
  from the DB.  But a md5 of 0 in the DB means the folder was removed on
  the server.  That would remove the local folder (BAD!)

So we load the md5 from the db even if the local mtime change.
That means we need to compare the mtime in the local case rather than
the md5 to see if something has changed.
2013-05-03 19:21:21 +02:00
Olivier Goffart
b49aaaabfc Fix too many PROPFIND when starting a sync
csync would not update the etag (md5) for directoru in the database if
the etag has changed, but none of the files within that directory
actually changed
2013-05-03 19:21:21 +02:00
Olivier Goffart
cf23799e78 Only mark a folder as modified if files within it are modified. 2013-05-03 19:21:21 +02:00
Olivier Goffart
eb38f5beb1 Don't reset the md5 if the mtime change locally.
Consider this case when one creates a file with an invalid filename (for
the server) in a directory in the local side.
say: foo/bar/%invalid%.txt

The following would happen:
- in the update for the local parent folder  foo/bar/, the md5 is 0
  because the mtime has changed
- During the reconcile, we try to send %invalid%, but there will be an
  error and nothing will be changed on the server, the etags stay the
  same
- We do not do any PROPFIND at the end so we do not fetch the etag
  anymore.  The md5 is still 0 and will be saved like that in the DB
- Next run, since the etags have  not changed on the server, we read
  from the DB.  But a md5 of 0 in the DB means the folder was removed on
  the server.  That would remove the local folder (BAD!)

So we load the md5 from the db even if the local mtime change.
That means we need to compare the mtime in the local case rather than
the md5 to see if something has changed.
2013-04-24 14:09:20 +02:00
Olivier Goffart
112285c9aa Fix too many PROPFIND when starting a sync
csync would not update the etag (md5) for directoru in the database if
the etag has changed, but none of the files within that directory
actually changed
2013-04-17 16:25:52 +02:00
Klaas Freitag
84febf4b77 Merge branch 'dav_0.70.5' into dav 2013-04-15 15:37:17 +02:00
Klaas Freitag
c38514934c A good word. 2013-04-09 14:41:36 +02:00
Daniel Molkentin
aa390dd17e Set path and phash for ignored files 2013-04-08 14:21:00 +02:00
Klaas Freitag
0bea2ea8f9 Push len computing to the right place. 2013-04-03 16:38:35 +02:00
Klaas Freitag
34668e42b3 Merge branch 'dav_0.70.5' into dav - WIP
Conflicts:
	CMakeLists.txt
	CPackConfig.cmake
	src/csync.h
	src/csync_update.c
	tests/ownCloud/t1.pl
2013-04-02 14:44:01 +02:00
Klaas Freitag
ef7c5c261d Fix memory allocation for path. 2013-03-22 21:48:01 +01:00
Klaas Freitag
5657ff3d34 Fix: set path correctly. 2013-03-22 16:29:04 +01:00
Klaas Freitag
19f07f9aea Handle non statable files correctly, read missing info from db. 2013-03-20 21:56:09 +01:00
Klaas Freitag
5a8d90cc25 Fix path handling in update routine. 2013-03-19 16:22:11 +01:00
Klaas Freitag
db70a3b2ae Skip files which are not statable and ignore links and such. 2013-03-19 14:20:38 +01:00
Klaas Freitag
e3a4ec453c Handle non statable files gracefully. 2013-03-19 14:20:03 +01:00
Klaas Freitag
13c44ad25c Skip files which are not statable and ignore links and such. 2013-03-19 14:02:12 +01:00
Klaas Freitag
d943b2880a Handle non statable files gracefully. 2013-03-19 11:48:46 +01:00
Olivier Goffart
b99677f985 Only mark a folder as modified if files within it are modified. 2013-03-11 20:38:17 +01:00
Olivier Goffart
170e5389b3 Do not issue a rename when the file was modified localy 2013-02-06 18:40:03 +01:00
Olivier Goffart
0c874f0c3c fix some issues while moving. Now it works in simple cases 2013-02-06 18:40:02 +01:00
Olivier Goffart
d88c58deae WIP: rename folders 2013-02-06 18:40:02 +01:00
Klaas Freitag
ccc9419a58 Reduce the sqlite_compile errors dramatically. 2013-01-16 16:27:59 +01:00
Olivier Goffart
6f1e70aae6 Always use the db even if the mtime change localy.
As long as the md5 is the same, use the db, even if the mtime change
localy.
2013-01-10 11:32:42 +01:00
Klaas Freitag
eb640aae00 Fix parsing of GMT times and handle time difference more tolerant. 2012-11-08 14:52:14 +01:00
Klaas Freitag
2bb52ef6f9 Merge branch 'master' into dav - get cmocka tests and database move.
Conflicts:
	CMakeLists.txt
	cmake/Modules/FindCMocka.cmake
	src/csync.c
	src/csync_exclude.c
	src/csync_reconcile.c
	src/csync_statedb.c
	src/csync_update.c
	src/csync_util.c
	src/vio/csync_vio.c
	tests/CMakeLists.txt
	tests/csync_tests/check_csync_exclude.c
	tests/csync_tests/check_csync_statedb_load.c
	tests/csync_tests/check_csync_statedb_query.c
	tests/csync_tests/check_csync_update.c
	tests/std_tests/check_std_c_path.c
2012-10-27 19:27:14 +02:00
Andreas Schneider
6023db367b update: Fix a memory leak in _csync_detect_update().
Found by Coverity.
2012-10-19 20:37:13 +02:00
Andreas Schneider
47f1560d87 update: Don't leak dh on error.
Found by Coverity.
2012-10-19 20:37:13 +02:00
Benjamin Legrand
cb8a501241 Fix a typeo and rename REPLCIA to REPLICA.
BUG #8

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2012-10-19 15:59:51 +02:00
Klaas Freitag
aad8e5320a Some more memory cleanups after valgrinding. 2012-10-18 13:26:44 +02:00
Klaas Freitag
687efaaaf6 Some more memory free - after valgrind analyze. 2012-10-16 11:52:50 +02:00
Klaas Freitag
7c20897036 Also reset read_from_db flag in context in error case. 2012-10-16 11:52:11 +02:00
Klaas Freitag
2af0d6f1a4 Be careful with memory, some fixes for that. 2012-09-26 15:32:38 +02:00
Klaas Freitag
2354b9c52f Fix detection of local file renames. 2012-09-24 15:56:42 +03:00