Commit graph

140 commits

Author SHA1 Message Date
Olivier Goffart
1a6a6758d3 We need to restore the read_from_db flag AFTER closedir
Else, we might dispatch to the wrong close call (the one from owncloud
instead of the one from the db,  resulting in a memory leak
2013-10-31 11:38:00 +01:00
Olivier Goffart
8c4ecb4fba Only use etag to know if we should use the db or not
Null file id might just mean the server don't support file id.
So use the database even if fileid is null
2013-10-31 10:02:20 +01:00
Klaas Freitag
4412ec38e4 Properly check if the file type has changed. 2013-10-30 17:34:40 +01:00
Klaas Freitag
84b07b3798 First attempt to implement server side move. 2013-10-25 13:25:07 +02:00
Klaas Freitag
578a41f766 In case the file id is not in the db, do not get data from db.
If the file_id is not yet in the database it is not ok to read the file
tree data from the db.
2013-10-25 13:16:34 +02:00
Klaas Freitag
8b4b89ecad Copy the file id. 2013-10-25 13:15:25 +02:00
Klaas Freitag
0bba93e8b5 Rename vio function get_file_id to get_etag.
Since we introduce a file id now that has another semantics than the etag
the name would be very misleading.
2013-10-23 15:02:13 +02:00
Klaas Freitag
e7b94e437e Merge remote-tracking branch 'freitag/dav' into ocsync 2013-10-23 14:37:12 +02:00
Klaas Freitag
e16560249c Use atoll to convert inode from db query results. 2013-10-22 17:49:49 +02:00
Klaas Freitag
3421f1871f Disable inode check for all platforms. (core #4953) 2013-10-14 11:42:43 +02:00
Klaas Freitag
c34b861332 Disable inode check for all platforms. (core #4953) 2013-10-10 12:22:59 +02:00
Olivier Goffart
be6e208328 Merge branch 'dav' into ocsync
Conflicts:
	src/csync_update.c
2013-10-03 12:08:51 +02:00
Klaas Freitag
ef9f0edd61 Ignore all csync journal files right at beginning. 2013-10-01 13:18:36 +02:00
Klaas Freitag
0c2f9177d1 For silently ignored files return immediately. 2013-10-01 13:18:06 +02:00
Klaas Freitag
f1b4a7a0ae Disable comparison of local inode values for the win32 platform.
Bug owncloud/mirall#779 reports about continous upload of files
even though nothing has changed. Logfiles show the fact that the
inode on windows is not reliable for this. Disabled as a result
to fix bug #779.
2013-09-25 11:39:06 +02:00
Klaas Freitag
33d55c0757 Remove unused commented code. 2013-09-25 11:34:50 +02:00
Klaas Freitag
62f4d118ea Use new interface to csync_excluded. 2013-09-12 15:30:47 +02:00
Klaas Freitag
526d23583a Use new interface to csync_excluded. 2013-09-12 14:47:17 +02:00
Klaas Freitag
4cc1ef3624 Merge remote-tracking branch 'freitag/dav' into ocsync
Conflicts:
	src/csync_propagate.c
	src/csync_statedb.c
2013-09-04 15:51:38 +02:00
Klaas Freitag
ce554eb44a Let csync exclude report the exclude reason. 2013-09-02 17:23:17 +02:00
Olivier Goffart
56d5359f5b Fix compilation after merge
Still untetested
2013-08-18 18:55:32 +02:00
Daniel Molkentin
6cda2f0c24 Do not report removable ignored files 2013-08-18 17:52:45 +02:00
Olivier Goffart
4e04a2ccb0 Addapt to new error codes 2013-08-18 17:29:23 +02:00
Olivier Goffart
b5ed352aa3 Merge remote-tracking branch 'origin/master' into ocsync
Only confluct resolution, do not compile or works

Conflicts:
	CMakeLists.txt
	CPackConfig.cmake
	ConfigureChecks.cmake
	client/csync_client.c
	cmake/Modules/DefineCompilerFlags.cmake
	cmake/Modules/DefineInstallationPaths.cmake
	cmake/Modules/FindIconv.cmake
	cmake/Modules/FindIniparser.cmake
	cmake/Modules/FindNeon.cmake
	config.h.cmake
	config/CMakeLists.txt
	config/ocsync.conf
	doc/CMakeLists.txt
	modules/csync_owncloud.c
	modules/csync_sftp2.c
	src/CMakeLists.txt
	src/csync.c
	src/csync.h
	src/csync_config.c
	src/csync_exclude.c
	src/csync_lock.c
	src/csync_macros.h
	src/csync_misc.c
	src/csync_misc.h
	src/csync_private.h
	src/csync_propagate.c
	src/csync_statedb.c
	src/csync_statedb.h
	src/csync_update.c
	src/csync_util.c
	src/csync_util.h
	src/std/c_dir.c
	src/std/c_file.c
	src/std/c_private.h
	src/std/c_string.c
	src/std/c_string.h
	src/std/c_time.c
	src/vio/csync_vio.c
	src/vio/csync_vio.h
	src/vio/csync_vio_file_stat.h
	src/vio/csync_vio_local.c
	src/vio/csync_vio_method.h
	tests/CMakeLists.txt
	tests/csync_tests/check_csync_statedb_load.c
	tests/csync_tests/check_csync_statedb_query.c
	tests/csync_tests/check_csync_treewalk.c
	tests/csync_tests/check_csync_update.c
	tests/ownCloud/HTTP/DAV.pm
	tests/ownCloud/ownCloud/Test.pm
	tests/std_tests/check_std_c_str.c
	tests/vio_tests/check_vio.c
2013-08-18 16:21:18 +02:00
Klaas Freitag
76ee4cb3ba Add symlinks to the file tree with instruction IGNORE 2013-08-07 12:14:29 +02:00
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
Andreas Schneider
d80da2a088 LICENSE: Change license of libcsync from GPL to LGPL.
All contributors have agreed to change the license of libcsync to LGPL.
2013-07-29 14:04:37 +02:00
Andreas Schneider
dbd242442f update: Make sure ulen is initialized. 2013-07-25 08:36:23 +02:00
Andreas Schneider
c00e401306 update: Make sure we don't have an invalid path pointer. 2013-07-24 16:01:00 +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
Andreas Schneider
8953ed544c statedb: Remove context where it isn't needed. 2013-07-04 10:29:48 +02:00
Andreas Schneider
d05b077851 statedb: Always pass down the db pointer. 2013-07-04 10:29:19 +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