Klaas Freitag
64927899af
Use pointer to stat struct for id_list.
2013-04-22 10:22:20 +02:00
Klaas Freitag
84febf4b77
Merge branch 'dav_0.70.5' into dav
2013-04-15 15:37:17 +02:00
Klaas Freitag
7171da53e8
Check that file is unchanged before copying in propagator.
2013-04-09 16:43:21 +02:00
Andreas Schneider
7934cde2db
csync: Pass the errno to csync_errno_to_status().
...
This is needed to be sure we are thread-safe. See also the manpage of
strerror_r(3).
2013-04-06 18:48:16 +02:00
Andreas Schneider
b701bf3d9b
csync: Rename UNSPEC_ERROR to UNSUCCESSFUL.
2013-04-06 18:48:16 +02:00
Klaas Freitag
4e6d54194f
Check for file equalness after having created a conflict file.
...
If the files are equal and the conflict was created because the
timestamps were screwed the conflict is removed again. This only
works on the local repository so far.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-04-06 18:48:11 +02:00
Klaas Freitag
2204c94770
Introduce csync status codes
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-04-05 17:40:22 +02:00
Klaas Freitag
093b166319
Rename pi to progress_info.
2013-04-04 12:58:29 +02:00
Klaas Freitag
815f652f08
Move tmpname generation to utility function c_tmpname for cleander code.
2013-04-04 12:57:44 +02:00
Olivier Goffart
9939e325cf
Fix crash when setting a NULL error
2013-04-03 10:53:20 +02:00
Olivier Goffart
296011436a
Store the error string in the database when blacklisting
2013-03-28 13:54:01 +01:00
Olivier Goffart
6659ee6d76
store the error string for files in the tree
2013-03-28 13:54:01 +01:00
Klaas Freitag
79c51540da
Check for file equalness after having created a conflict file.
...
If the files are equal and the conflict was created because the
timestamps were screwed the conflict is removed again. This only
works on the local repository so far.
Conflicts:
src/csync_propagate.c
2013-03-26 11:57:32 +01:00
Klaas Freitag
43fa6e4418
Check for file equalness after having created a conflict file.
...
If the files are equal and the conflict was created because the
timestamps were screwed the conflict is removed again. This only
works on the local repository so far.
2013-03-22 21:04:09 +01:00
Klaas Freitag
f88e9baf15
Handle renames in read only shares correctly.
2013-03-19 14:18:34 +01:00
Andreas Schneider
ab70947755
propagate: Fix renaming in the propagation.
2013-03-19 13:56:20 +01:00
Klaas Freitag
7630ab5807
Moved variable declaration.
2013-03-14 13:41:27 +01:00
Klaas Freitag
c263532ba3
Merge remote-tracking branch 'ogoffart/davbf' into dav
2013-03-14 13:36:55 +01:00
Olivier Goffart
2205c9a339
Resume chunked upload if conneciton is lost
2013-03-12 11:42:17 +01:00
Olivier Goffart
b4ec9f887c
Do not fetch folder id after propagation.
...
Delay that for the next sync.
(cherry picked from commit 1eb534dd53
)
2013-03-11 20:38:17 +01:00
Olivier Goffart
6a5ad6e81e
Revert "Do not fetch folder id after propagation."
...
This reverts commit 1eb534dd53
.
Because folder re-appears in some cases
(IL issue #143 )
2013-03-08 17:47:39 +01:00
Klaas Freitag
cf75a71b8b
Make use of push_to_tmp_first function.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-03-08 15:55:03 +01:00
Klaas Freitag
d7a4a574ab
Add a vio capabilites function to let a module define its capabilities.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-03-08 15:54:55 +01:00
Olivier Goffart
e05b44b06d
Fix blacklist with renamed files
...
When renaming blacklisted files, we still need to find the other node to
mark the error
2013-03-07 11:07:38 +01:00
Klaas Freitag
47b1e64059
Handle renames in read only shares correctly.
2013-03-06 16:00:28 +01:00
Olivier Goffart
1eb534dd53
Do not fetch folder id after propagation.
...
Delay that for the next sync.
2013-03-05 20:33:18 +01:00
Olivier Goffart
d6a6fb0d67
Keep the tmp file and resume from it
2013-03-02 15:02:27 +01:00
Olivier Goffart
53ad4a910f
Progress database:
...
Remember about errors, and don't retry if there is more than 3 errors
Conflicts:
src/csync_propagate.c
2013-03-02 15:01:40 +01:00
Olivier Goffart
259b6050bf
Progress database:
...
Remember about errors, and don't retry if there is more than 3 errors
2013-03-01 12:31:20 +01:00
Andreas Schneider
91d92bfa16
log: Add functions to set userdata for the logging callback.
2013-03-01 09:59:55 +01:00
Olivier Goffart
355a807775
Fix removing of folder when the folder is locked on windows.
...
When the folder is locked on windows, rmdir fails and the folmder is not
removed. But on the next sync, one should try to remove that folder again, and
not upload it to the server as we did before.
There was two problems:
1- The removed folder is still in the DB, so when csync_update read from
DB, for the remote, it still finds it. Fix that by storing an empty MD5
for directories that should have been deleted.
2- The folder is likely to be modified since its contents are gone.
Which means next sync will try to sync it back to the server.
Fix that by refreshing the mtime in the tree
2013-02-25 11:32:32 +01:00
Olivier Goffart
ca34c4fd5f
Fix removing of folder when the folder is locked on windows.
...
When the folder is locked on windows, rmdir fails and the folmder is not
removed. But on the next sync, one should try to remove that folder again, and
not upload it to the server as we did before.
There was two problems:
1- The removed folder is still in the DB, so when csync_update read from
DB, for the remote, it still finds it. Fix that by storing an empty MD5
for directories that should have been deleted.
2- The folder is likely to be modified since its contents are gone.
Which means next sync will try to sync it back to the server.
Fix that by refreshing the mtime in the tree
2013-02-13 19:20:26 +01:00
Olivier Goffart
b028c64325
In case of error dirring a rename, mark the source as updated
...
That way, the file will be saved in the DB again, and the next try, it
will retry to rename
2013-02-12 15:11:15 +01:00
Olivier Goffart
8646246e75
Also report the error for the other node in case of error
2013-02-08 21:51:03 +01:00
Olivier Goffart
2615205adc
Fix renaming folder when a file was modified by another client
2013-02-06 18:40:03 +01:00
Olivier Goffart
71caa3356c
Automatically creates the destination folder if it does not exist
2013-02-06 18:40:02 +01:00
Olivier Goffart
0cf770017d
Do not abort when move fail
2013-02-06 18:40:02 +01:00
Olivier Goffart
fe756799d2
Make it work when renaming a directory and a subdirectory at the same
...
time
2013-02-06 18:40:02 +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
0752aff55a
Handle 405 as EPERM rather than EEXIST
2013-01-16 11:42:13 +01:00
Olivier Goffart
de87ed2d31
Make it a error when the file cannot be created
...
Mark it a an error when the file cannot be created because the folder
cannot be created.
Should display errors on windows if the file is too long
2013-01-10 11:32:42 +01:00
Olivier Goffart
5b8917672c
Only do the correctId after both the remote and the local have been processed
...
It is important if there are operations such as delete, which operate on
the remote tree, and thet may also invalidate the id we got on the
localtree (for example, the parent directory of a removed file)
2013-01-10 11:32:27 +01:00
Olivier Goffart
9998c7cde1
Do not fetch the id in _csync_sync_dir
...
But rather at then end
2013-01-10 11:28:01 +01:00
Olivier Goffart
9261f66fd8
Do not fetch the id of new directory in _csync_new_dir
...
Delay the id update to after when we do all the directory. When we
create ne directory it is likely that there will be something inside.
2013-01-10 11:21:12 +01:00
Olivier Goffart
00ee9f4960
leak fix
2013-01-10 11:18:54 +01:00
Klaas Freitag
70e89720d5
Some code cleanups, removed not needed stuff.
2012-12-20 17:10:03 +01:00
Klaas Freitag
3343601179
Remove temp files if GET fails, fixes owncloud/mirall#194
2012-12-19 12:41:16 +01:00
Klaas Freitag
e5b95540e7
drop not longer needed case statement.
2012-12-19 12:31:56 +01:00
Olivier Goffart
c09461a9e4
After a move, we also need to refresh the id of the destination folders
...
Else, the id are not good, and if we move folders like this:
mv folderA folderB
csync
mv folderB folderC
csync
we want that the first sync refresh correctly the folderB id so that the
second sync do not re-create folderB
When working on the renamed path, we are on the remote tree, but the new
folder is only on the local tree. hence the 'tree' passed to the helper
function is not the same.
2012-12-14 00:14:44 +01:00
Klaas Freitag
654e87a9d5
Fix temp name creation: Place dot correctly for hidden files.
2012-12-12 14:18:30 +01:00
Markus Goetz
fded216fb6
Propagate: Fix file name pattern
...
Starting with dot on Windows is a bad idea
2012-12-11 17:26:46 +01:00
Klaas Freitag
8ed89bca86
Hide temp files for download to local.
2012-12-11 11:35:38 +01:00
Markus Goetz
42b090ec0d
Propagate: Change temp file name
...
.. to something already in the exclude list
2012-12-10 19:15:16 +01:00
Markus Goetz
885e073b8a
Win32: Hide file while downloading
2012-12-10 19:15:16 +01:00
Olivier Goffart
58aaf98369
Only request the id for REMOTE_REPLICA after mkdir
2012-12-08 11:06:29 +01:00
Olivier Goffart
5bdaf83c67
Don't remove trailing slash
...
There is no trailing slashes in the path
2012-12-06 16:42:22 +01:00
Olivier Goffart
0eb1855345
Revert "Only refresh the folder id for remote replica"
...
This reverts commit ce94beb068
.
This broke because the tree are not merged yet.
If a file was added on the remote, it is not yet in the remote tree, and
still we need to query the ETag
2012-12-06 16:36:13 +01:00
Olivier Goffart
b989518af3
Only request file id for remote replica
2012-12-06 16:28:37 +01:00
Olivier Goffart
7b4e4f349e
No need to query the id again after syncing the dir
...
If there was a change, then a file would be changed, and we would do that anyway,
If there was no change, it is a waste to do it
2012-12-06 14:59:26 +01:00
Klaas Freitag
6d9bd79ccb
Cleanup and fix == error.
2012-12-06 11:39:53 +01:00
Olivier Goffart
ce94beb068
Only refresh the folder id for remote replica
...
Also don't remove trailing slash, there is no trailing slashes in the
path
2012-12-05 18:18:45 +01:00
Klaas Freitag
41c4e05b93
Fix error reporting from sendfile method.
2012-12-05 14:19:22 +01:00
Klaas Freitag
0d4c824fbf
Add sendfile method including a module capability.
2012-12-04 15:03:49 +01:00
Olivier Goffart
95edd6a9de
Merge remote-tracking branch 'origin/master' into dav
...
Conflicts:
config/ocsync_log.conf
src/csync.c
src/csync.h
src/csync_config.c
src/csync_log.h
src/csync_private.h
src/csync_statedb.c
tests/csync_tests/check_csync_config.c
2012-12-03 17:32:08 +01:00
Klaas Freitag
9c1893fa6d
Fix for #123 : Move declaration to top of function to escape goto.
2012-11-29 13:38:28 +01:00
Klaas Freitag
24e137ca19
Detect loop in mkdir function to prevent looping in readonly Shared.
2012-11-21 14:53:54 +01:00
Klaas Freitag
3265e2c6a2
Handle PUT fail correctly.
2012-11-16 12:31:09 +01:00
Andreas Schneider
8a0b4319d3
csync: Add a new logging system.
2012-10-30 11:27:21 +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
06cb39e1e1
propagate: Fix a possible null pointer deference.
...
Found by Coverity.
2012-10-19 19:07:15 +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
Andreas Schneider
2ddccf6c16
propagate: Fix build on systems without atime support.
...
This fixes bug #6 .
2012-10-15 21:27:17 +02:00
Klaas Freitag
004f5ccce6
Fix state change for deleted or not longer existing directories.
2012-09-26 12:46:59 +02:00
Klaas Freitag
77e79ea767
For rename, retrieve the new id and set in local tree.
2012-09-24 15:55:18 +03:00
Klaas Freitag
128926cac7
Check path for len exactly 1 when comparing on '.'.
2012-09-24 15:54:17 +03:00
Klaas Freitag
d756c45c50
Free memory used by the id in csync_file_stat.
2012-08-30 13:01:21 +03:00
Klaas Freitag
97a7e46595
Set to INSTRUCTION_UPDATED only for NONE instructions.
2012-08-23 17:44:07 +03:00
Klaas Freitag
868a07c322
Update the md5 also if the instruction is not UPDATE.
2012-08-23 17:44:07 +03:00
Klaas Freitag
f4c9ced446
Handle ID change propagation to the top directory.
2012-08-23 17:43:51 +03:00
Klaas Freitag
c2e2f8de00
more md5 calculations
2012-08-23 17:41:53 +03:00
Klaas Freitag
ae1b8a5682
Query new id for local repository because of utimes changes.
2012-08-23 17:41:53 +03:00
Klaas Freitag
0618eb956d
Merge conflicts solved.
2012-08-23 17:40:36 +03:00
Klaas Freitag
ae5394ad75
UniqID based syncing, first WIP state.
2012-08-23 17:38:44 +03:00
Klaas Freitag
76b09b3c14
Fix rename: Exclude directories and set mtimes accordingly.
2012-08-09 16:59:08 +03:00
Klaas Freitag
253605758e
Use remote rename if local rename is detected.
2012-08-02 16:58:54 +03:00
Klaas Freitag
1104619a52
No atime on apple platform.
2012-07-19 21:11:35 +02:00
Klaas Freitag
b57f33353d
fixed copy and paste errors in error output.
2012-07-19 21:06:18 +02:00
Klaas Freitag
cad3da10db
Merge branch 'timedelta' into dav
2012-07-19 15:53:12 +02:00
Klaas Freitag
c0f1f36f59
Fix condition on when atomar push is allowed, never for local files.
2012-07-09 13:26:20 +02:00
Klaas Freitag
065529642e
Ability to push to remote without using a tempfile to copy to.
...
Modules such as ownCloud make sure anyway that the upload to a
remote resource happens atomar. This patch allows to switch off
the default behaviour of first copying to a temp file in the
same directory. Use csync_set_remote_push_atomar function to
switch off.
2012-07-09 13:26:20 +02:00
Klaas Freitag
dc2148aa15
Removed a stat call that is just for a file size check.
2012-07-09 13:23:48 +02:00
Klaas Freitag
6eb4e707d9
Add module capability about if a post copy size check is required.
2012-07-04 15:03:15 +02:00
Klaas Freitag
8ba2f483bf
Add a vio capabilites function to let a module define its capabilities.
2012-07-04 13:56:24 +02:00
Klaas Freitag
98bc5098c9
Merge branch 'dav' of ssh://milliways.cryptomilk.org/users/freitag/csync into dav
...
Conflicts:
src/csync_propagate.c
2012-07-01 15:27:41 +02:00
Klaas Freitag
f31c74743c
Fix condition on when atomar push is allowed, never for local files.
2012-06-26 18:30:50 +02:00
Klaas Freitag
8034da83cc
Ability to push to remote without using a tempfile to copy to.
...
Modules such as ownCloud make sure anyway that the upload to a
remote resource happens atomar. This patch allows to switch off
the default behaviour of first copying to a temp file in the
same directory. Use csync_set_remote_push_atomar function to
switch off.
2012-06-26 18:30:50 +02:00
Klaas Freitag
55c3b0862c
Zero'ed a stat call that is just for a file size check.
2012-06-26 18:20:16 +02:00
Klaas Freitag
357b5cd5f3
Ability to push to remote without using a tempfile to copy to.
...
Modules such as ownCloud make sure anyway that the upload to a
remote resource happens atomar. This patch allows to switch off
the default behaviour of first copying to a temp file in the
same directory. Use csync_set_remote_push_atomar function to
switch off.
2012-06-22 15:32:04 +02:00