Commit graph

787 commits

Author SHA1 Message Date
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
96eb138410 Make big file support working for win32. 2013-01-09 15:06:03 +01:00
Klaas Freitag
5e4c0acc6b Use wide char variable to remove directory. 2013-01-09 15:02:07 +01:00
Klaas Freitag
c2844b0545 Added csync_get_error_string function to provide backend errors. 2012-12-20 20:47:10 +01:00
Klaas Freitag
70e89720d5 Some code cleanups, removed not needed stuff. 2012-12-20 17:10:03 +01:00
Klaas Freitag
d6287fb5e3 fix win32 build, ifdefed non existing errnos. 2012-12-19 20:20:26 +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
Klaas Freitag
fe048f69cd Set version to upcoming version 0.70.0 2012-12-18 13:50:56 +01:00
Klaas Freitag
bbf4e07579 Proper errno to csync error conversion, more errno fixes in oC module. 2012-12-17 17:22:24 +01:00
Klaas Freitag
ecf09c4077 Added error_string handling with modules 2012-12-14 16:49:03 +01:00
Klaas Freitag
e3ef10765b Avoid a compile warning. 2012-12-14 16:49:03 +01:00
Olivier Goffart
5bc95e1667 Fix memory leak 2012-12-14 11:19:14 +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
Olivier Goffart
10965eaa98 Fix renaming if the other file already exist on the server.
In that case, we have a conflict.  Handle it the same ways as for new
files.
2012-12-12 14:20:48 +01:00
Olivier Goffart
4e8ff9ae05 Fix end of file.
csync_util.c:347:1: error: no newline at end of file [-Werror,-pedantic,-Wnewline-eof]
2012-12-12 14:20:48 +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
316fd7b036 Exclude: Tell which file we load 2012-12-11 17:28:37 +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
Daniel Molkentin
1507ca2eaf Split download state 2012-12-11 12:09:33 +01:00
Klaas Freitag
8ed89bca86 Hide temp files for download to local. 2012-12-11 11:35:38 +01:00
Klaas Freitag
1705a309b2 Merge remote-tracking branch 'ogoffart/dav' into dav 2012-12-10 21:16:05 +01:00
Klaas Freitag
faa1b83e9e Fixed rename function to use TCHAR. 2012-12-10 21:15:31 +01:00
Klaas Freitag
64683332c7 Remove wrong comment. 2012-12-10 20:49:08 +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
bac1311486 Don't include "config.h" in the public header.
That file is not installed.  So it makes compiler error when trying to
include csync.h from an external project
2012-12-10 17:03:36 +01:00
Olivier Goffart
01d2586f1e Owncloud: Report the error in the progress callback 2012-12-10 16:51:13 +01:00
Olivier Goffart
8e3331ad1d Suppress a warning
The csync_set_module_property shows a warning if init is not finished
2012-12-10 16:15:26 +01:00
Olivier Goffart
7759eb4b6d Say which function it is in the error messages 2012-12-10 16:15:26 +01:00
Daniel Molkentin
131e52b370 Unbreak win32 2012-12-09 02:44:34 +03:00
Klaas Freitag
9b1dcb23f8 Avoid crash in iconv destroy. 2012-12-08 11:06:29 +01:00
Olivier Goffart
58aaf98369 Only request the id for REMOTE_REPLICA after mkdir 2012-12-08 11:06:29 +01:00
Olivier Goffart
410eadf2f5 print a warning when calling set_module_property at the wrong time 2012-12-08 11:06:28 +01:00
Daniel Molkentin
49d2fd685b iconv support
This allows for files on mac to automatically be converted to UNC
2012-12-07 13:03:01 +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
Daniel Molkentin
f461903a1a Reduce compiler warnings 2012-12-06 11:49:25 +01:00
Klaas Freitag
6d9bd79ccb Cleanup and fix == error. 2012-12-06 11:39:53 +01:00
Klaas Freitag
e997af227c Merge remote-tracking branch 'ogoffart/dav' into dav 2012-12-06 11:35:10 +01:00
Klaas Freitag
588df3124c Shorten log line a bit by removing the year part of the date. 2012-12-06 11:34:26 +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
Olivier Goffart
c4dc285ff0 Move the errno codes to another header
We can't include csync_private.h from the modules
2012-12-05 14:43:37 +01:00
Klaas Freitag
41c4e05b93 Fix error reporting from sendfile method. 2012-12-05 14:19:22 +01:00
Klaas Freitag
79d5e19a65 Remove left over WIP code. 2012-12-05 12:38:57 +01:00
Klaas Freitag
aaa8fe6e34 Commented loggings as currently logging is broken. 2012-12-04 18:41:20 +01:00
Olivier Goffart
f18f58ace0 Add progress callback 2012-12-04 17:26:23 +01:00
Olivier Goffart
0f35b92d75 Add an API to be able to pass information to the vio module 2012-12-04 17:22:11 +01:00
Klaas Freitag
ca30b99cea More accurate setting of errno with custom values. 2012-12-04 17:03:00 +01:00
Klaas Freitag
0d4c824fbf Add sendfile method including a module capability. 2012-12-04 15:03:49 +01:00
Klaas Freitag
13f51c85ab Make definition of fhandle_t more visible. 2012-12-04 15:02:13 +01:00
Klaas Freitag
13354b6e8b Removed old log callback code. 2012-12-03 19:41:44 +01:00
Olivier Goffart
cab1324d18 Remove references to ocsync_log.conf 2012-12-03 17:56:47 +01:00
Olivier Goffart
04ebe966d2 Fix compilation after merge.
Log in owncloud module is temporarly disabled because it does not
compile as upstream added the context in the log.
2012-12-03 17:45:40 +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
01ba8d4a9b Wide char fixes for exclude, lock and statedb. 2012-11-27 15:39:06 +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
7bce6696d4 Discover DST time error and correct. 2012-11-20 17:33:25 +01:00
Klaas Freitag
3265e2c6a2 Handle PUT fail correctly. 2012-11-16 12:31:09 +01:00
Klaas Freitag
a577bf8faa Add a version table to csyncs database with the current version no. 2012-11-14 17:24:13 +01:00
Klaas Freitag
094554366b Fix casting to signed data types. 2012-11-14 15:10:44 +01:00
Klaas Freitag
385b48da5c Commented database copy. Rather let it recreate. 2012-11-14 15:09:16 +01:00
Klaas Freitag
905e97f2ab Use _tclosedir rather than closedir. 2012-11-13 11:45:12 +01:00
Klaas Freitag
a0fcd35183 win32: Ported two other occurences of win32 api to wide char support. 2012-11-12 10:44:24 +01:00
Klaas Freitag
161d7c18ff Push version to next release 0.60.2 2012-11-09 17:15:46 +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
bede1acbce Win32: Fix CreateFile call for directories. 2012-11-08 14:49:15 +01:00
Olivier Goffart
6e6e18c030 Exclude lists: Works with \r\n line terminator 2012-11-07 17:46:13 +01:00
Olivier Goffart
62897e6d37 Win: Load the exclude lists in the config 2012-11-07 17:46:13 +01:00
Olivier Goffart
f55f687a63 Win: Don't rely on the name of the program to be owncloud.exe
Loosely based on the logic in csync_vio_init
2012-11-07 17:46:13 +01:00
Olivier Goffart
a4db29c277 c_copy: return error code on windows if there is an error
This fixes a compiler warning about not returning a value
2012-11-07 17:46:13 +01:00
Markus Goetz
80d53ff4bd Enable compilation with static iniparser and sqlite 2012-11-07 17:46:13 +01:00
Olivier Goffart
be13ef120d Fix another crash if the md5 are not computed 2012-11-07 16:50:20 +01:00
Klaas Freitag
67373dcb0d commented work in progress treewalk stuff. 2012-11-07 12:33:39 +01:00
Olivier Goffart
1a093b0ae3 Fix crash if md5 is null
Also make sure to copy destpath, to avoid double free.
2012-11-06 14:05:52 +01:00
Olivier Goffart
7071a455c5 Use signed hash in SQL request
sqlite only handle signed integer,  in case of overflow, we numbers are
transformed to floating point, resulting in wierd errors.
2012-11-06 14:05:52 +01:00
Klaas Freitag
898d51f92d WIP: Try to catch a cleared remote path 2012-10-31 21:38:57 +01:00
Klaas Freitag
e183854b58 Added experimental function to check if a file is known locally. 2012-10-31 21:33:17 +01:00
Klaas Freitag
af11613fba Some cleanup of platform specific code. 2012-10-31 21:09:33 +01:00
Klaas Freitag
2fa07b1dd9 set pointer void to avoid warning on linux compile. 2012-10-31 21:08:40 +01:00
Klaas Freitag
abb3829197 Use win32 function GetFileTime to fix DTS problems on windows. 2012-10-31 20:56:24 +01:00
Klaas Freitag
4104737533 Hide the journal database under windows using win32 API. 2012-10-31 20:56:06 +01:00
Andreas Schneider
0a6d7435b5 cmake: Get rid of log4c. 2012-10-30 11:27:21 +01:00
Andreas Schneider
0179c2249d statedb: Log an error if we can't open the database. 2012-10-30 11:27:21 +01:00
Andreas Schneider
8a0b4319d3 csync: Add a new logging system. 2012-10-30 11:27:21 +01:00
Andreas Schneider
95b367dd23 csync: Add option to set and get log verbosity. 2012-10-30 11:27:20 +01:00
Andreas Schneider
890df87d00 csync: Add support for a log callback. 2012-10-30 11:27:20 +01:00
Klaas Freitag
8afe182e0c Fix merge: Initialise data before accessing them. 2012-10-28 11:31:25 +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
805621540a csync: Move auth callback to a common struct. 2012-10-27 15:29:00 +02:00
Klaas Freitag
557b4bbe25 Use LIKE instead of GLOB to find files in dirs in database.
This fixes Github issue mirall#25
2012-10-27 12:03:39 +02:00
Klaas Freitag
0db9427377 Add name of rename target to treewalk data structure. 2012-10-26 20:01:25 +02:00
Klaas Freitag
8bdf0694ca Another rename issue to ocsync instead of csync. 2012-10-26 19:59:45 +02:00
Klaas Freitag
d82850f145 Fix more csync->ocsync renaming issues. 2012-10-26 16:11:34 +02:00
Andreas Schneider
14f03e0ebb exclude: Simplify the csync_excluded() loop.
Thanks to Klaas Freitag.
2012-10-22 15:32:28 +02:00
Andreas Schneider
51ce3bea37 exclude: Reduce memory allocations of csync_excluded(). 2012-10-22 15:13:02 +02:00