Commit graph

2197 commits

Author SHA1 Message Date
hefee
2cbdb35aac Get rid of PATH_MAX, that is not available under FreeBSD. 2013-12-11 18:31:11 +01:00
hefee
b578558866 compile ocsync for FreeBSD. 2013-12-11 18:30:08 +01:00
Olivier Goffart
ba8fa9a403 Do not 'normalize' etag when we read from db
Normalize removes the quote and the -gzip.
We assume that the normalized etag is in the DB
This is how it worked in mirall 1.4

We added normalization in case there is a -gzip saved to the database.
But since this was broken in 1.4 anyway, it will just force a
re-download if -gzip was added. (1.4 anyway is broken with such
server and always do redownload all the time)
2013-12-11 12:50:45 +01:00
Olivier Goffart
1b4e2becb3 Use csync_normalize_etag everywhere.
Technically, we don't need to strip '-gzip' from the etag comming from
the propfind, but it is better to be consistant.
2013-12-11 11:35:55 +01:00
Klaas Freitag
bdf36f58a8 Set errno and error message if neon errors in fetch_resource_list.
This at least shows proper error messages to the user, as described
in mirall#451
2013-12-10 11:58:55 +01:00
Klaas Freitag
07889528c4 Added changelog for csnyc 0.91.0 .. 0.91.2 2013-12-10 10:47:41 +01:00
Klaas Freitag
ffd09757cb Remove ignoring pattern for progressdatabase. 2013-12-10 09:25:27 +01:00
Daniel Molkentin
9b2f9e3188 Push version to 0.91.2 for oCC 1.5.0 beta4 2013-12-09 21:44:28 +01:00
Klaas Freitag
22608f13ca Symlink detection for Win32.
This fixes https://github.com/owncloud/mirall/issues/1259
2013-12-09 15:19:50 +01:00
Klaas Freitag
f6f513cf45 Better check if the path variable is defined. 2013-12-09 14:08:28 +01:00
Olivier Goffart
7300f10f87 Do not recurse into ignored directory
Fix mirall issue 1260
2013-12-09 10:34:20 +01:00
Klaas Freitag
d99f5c5ddb Set the symlink error message only for links. 2013-12-06 14:06:38 +01:00
Olivier Goffart
000f7d320e Add test that directories are properly moved
Even when they just had been modified or added
2013-12-05 15:34:39 +01:00
Klaas Freitag
8fd921f796 Rather use unit64_t than ino_t which causes trouble on win32.
This fixes https://github.com/owncloud/mirall/issues/1239
2013-12-05 12:49:01 +01:00
Klaas Freitag
553c8d6658 Remove error string from file_status struct and replace by CSYNC_STATUS
That way we can translate the error states through miralls i18n
mechanisms.
2013-12-04 12:18:09 +01:00
Klaas Freitag
138fec678c Push version to 0.91.1 for oCC 1.5.0 beta2 2013-12-03 14:53:47 +01:00
Olivier Goffart
3590db47ac Reset the db to 0 after closing it.
This avoids closing it again and possibly crashing

Maybe the cause of the crash described in
https://github.com/owncloud/mirall/issues/1229
2013-12-03 14:08:18 +01:00
Olivier Goffart
60636cdbd5 inode 0 is invalid: don't try to match it from a DB
Otherwise, a new file with an invalid inode is considered like a rename
of another file with an invalid inode
2013-12-03 12:51:18 +01:00
Klaas Freitag
243279aa3f Use lstat rather than link following stat.
This fixes https://github.com/owncloud/core/issues/6146
2013-12-02 16:45:28 +01:00
Klaas Freitag
4c859d6513 Zero resource struct to avoid crash on win32 2013-11-28 14:48:47 +01:00
Klaas Freitag
a63e9c82a2 Push version to 0.91.0 - beta1 of oCC v. 1.5.0 2013-11-28 11:21:52 +01:00
Klaas Freitag
c22758201f Don't miss to read the fileid from database. 2013-11-27 13:21:48 +01:00
Klaas Freitag
75aad2b42c Removed unused variable to fix warning. 2013-11-27 09:32:18 +01:00
Klaas Freitag
b1df4b04fa Fix type confusion for file type member of stat struct 2013-11-27 09:31:20 +01:00
Olivier Goffart
87792b59e6 Fix -gzip removal from etag
Removes when the etag is both "foo-gzip" or "foo"-gzip

Add to patch for
https://github.com/owncloud/mirall/issues/1195
2013-11-26 11:55:47 +01:00
Olivier Goffart
8ed02302ca Don't check if the file has changed after the upload is complete.
After the upload is complete, the file has been changed in the server and the etag
need to be updated in the db if we don't want to have desatrous conflicts later.

Let mirall know the real status, and expose the function to check weather the file
has changed so mirall can do thing properly
2013-11-25 19:11:19 +01:00
Klaas Freitag
13d755fc4d Fixed compiler warning. 2013-11-25 18:27:37 +01:00
Klaas Freitag
ada30ae56b Set file name in error_string if ENOENT error 2013-11-25 18:24:37 +01:00
Olivier Goffart
e146de9ea2 Remove -gzip from the etag
Both from what comes from the server (https://github.com/owncloud/mirall/issues/1195)
Or what was in the db if upgrading from old database
2013-11-25 16:19:59 +01:00
Klaas Freitag
b6eae58a2c Only set the error code to a generic one if it is still ok. 2013-11-24 22:18:08 +01:00
Klaas Freitag
cc6c5e0db5 Let function csync_get_status return the CSYNC_STATUS
In original csync, csync_get_status() returned the status variable from
the context, which indicated in which state the sync run currently is,
which is never used.
What we expected in our mirall code however is the CSYNC_STATUS as
detailed result of a certain operation. Changed the function to reflect
that, even if that is an evil API change.
2013-11-24 22:17:36 +01:00
Klaas Freitag
0327461c25 Remove unneeded dlfcn header. 2013-11-21 14:13:35 +01:00
Klaas Freitag
61f08cdd97 Removed some unneeded code. 2013-11-15 16:22:41 +01:00
Klaas Freitag
a1286cc684 Add Content-Type header to http PUT request.
This hopefully fixes bug #1124 as it satisfies the mod_security
settings.
2013-11-15 16:15:26 +01:00
Olivier Goffart
79bf778a42 Forward the should_update_etag to the tree visitor 2013-11-15 13:52:41 +01:00
Olivier Goffart
0c689c4cca Make sure that if two items have the same inodes, they are on the same type.
We don't want to rename a file to a directory
2013-11-15 12:32:05 +01:00
Olivier Goffart
dd24950881 Allow t3.pl to pass with owncloud5
Which do not have fileid
2013-11-15 12:23:05 +01:00
Klaas Freitag
0993289180 Check the remote file Id of files in moved directories. 2013-11-15 09:36:33 +01:00
Klaas Freitag
32533a18af Added function to retrieve file ID from remote. 2013-11-15 09:36:33 +01:00
Olivier Goffart
8a3e617630 Don't put csync_owncloud in a plugin.
It is now statically linked
2013-11-14 18:58:28 +01:00
Olivier Goffart
7e7853f170 Fix t1.pl
Previous commit had the wrong regexp
2013-11-14 18:58:28 +01:00
Olivier Goffart
e0fdad93f4 t4.pl' 2013-11-14 18:20:57 +01:00
Olivier Goffart
415b51b2b5 Some more checks in t1.pl
Notably that the conflict file actually exists.  (There was not even a
conflict before because the filename of the touch was wrong)
2013-11-14 18:03:50 +01:00
Olivier Goffart
4eb19000a4 Differentiate the RENAME and EVAL_RENAME
EVAL_RENAME is set at the update phase and means that this is the destination of
a file that has been renamed.
RENAME is set for the file that need to be renamed.

Before, we knew the difference because of which remote the instruction was
but now we need to make the distinction explicit
2013-11-14 17:08:42 +01:00
Klaas Freitag
bef7c3c48e Fixes to t3.pl, added some assertions. 2013-11-14 17:06:53 +01:00
Klaas Freitag
e40370f67a Use printInfo method in t3.pl 2013-11-14 16:10:41 +01:00
Olivier Goffart
11a131fa90 csync_statedb_query: Allow null fields in the database
The fileid defaults to null for old database.
Since commit 4b8f2a287f,  we query
 the file id to get the etag.
c_strlist_add cannot append null entries, so it would just discard
the md5 instead
2013-11-14 14:41:36 +01:00
Olivier Goffart
4d146e87d1 Remove INVALID_FILE_ID and consider empty file id as invalid 2013-11-14 13:43:26 +01:00
Olivier Goffart
b518adc203 Don't read from the db if the file id has changed.
File id may change when upgrading to owncloud 6 or when upgrading to mirall 1.5

This also changes the location where we check if we need to read from
the DB.   Instead of doing it from csync_ftw,  we do it from
_csync_detect_update. In that function we know the etag and the file id.
Which mean we change the flag before the recursive call to csync_ftw instead
of in the begin of the function.  Therefore, we need to restore the flag
after calling the function to the previously saved state.
2013-11-14 13:43:26 +01:00
Klaas Freitag
6b0b7d1b90 make t1.pl work again. 2013-11-14 13:07:55 +01:00