From 546fdeed6c6ee45a4fdd3d317df21ba8627c57e5 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 3 May 2013 19:02:20 +0200 Subject: [PATCH 1/3] Add a way for mirall to access the dav session --- modules/csync_owncloud.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/csync_owncloud.c b/modules/csync_owncloud.c index 906b864607..dec65b0194 100644 --- a/modules/csync_owncloud.c +++ b/modules/csync_owncloud.c @@ -2144,6 +2144,11 @@ static int owncloud_set_property(const char *key, void *data) { dav_session.chunk_info = (csync_hbf_info_t *)(data); return 0; } + if( c_streq(key, "get_dav_session")) { + /* Give the ne_session to the caller */ + *(ne_session**)data = dav_session.ctx; + return 0; + } return -1; } From 10443fc1e340939215574c7272739c4fad1419e5 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 3 May 2013 19:03:55 +0200 Subject: [PATCH 2/3] in walk tree, we can now change the md5 Also also in commit always assume that the propagate is done. it might have been done by someone else --- src/csync.c | 8 ++++++++ src/csync.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/csync.c b/src/csync.c index 5db0ec9842..eb360a5abf 100644 --- a/src/csync.c +++ b/src/csync.c @@ -577,9 +577,14 @@ static int _csync_treewalk_visitor(void *obj, void *data) { trav.type = cur->type; trav.instruction = cur->instruction; trav.rename_path = cur->destpath; + trav.md5 = cur->md5; rc = (*visitor)(&trav, twctx->userdata); cur->instruction = trav.instruction; + if (trav.md5 != cur->md5) { + SAFE_FREE(cur->md5); + cur->md5 = c_strdup(trav.md5); + } return rc; } ctx->error_code = CSYNC_ERR_TREE; @@ -715,6 +720,9 @@ int csync_commit(CSYNC *ctx) { ctx->error_code = CSYNC_ERR_NONE; + /* maybe the propagate was done using another propagator, let the merger think it has been done */ + ctx->status = CSYNC_STATUS_DONE; + if (_merge_and_write_statedb(ctx) < 0) { CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Merge and Write database failed!"); if (ctx->error_code == CSYNC_ERR_NONE) { diff --git a/src/csync.h b/src/csync.h index 65127cb2e7..a10a478a54 100644 --- a/src/csync.h +++ b/src/csync.h @@ -145,6 +145,7 @@ struct csync_tree_walk_file_s { enum csync_instructions_e instruction; const char *rename_path; + const char *md5; }; typedef struct csync_tree_walk_file_s TREE_WALK_FILE; From 8c0dbb03e1f783723dc8bebe8b95fbcc73358cbf Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 3 May 2013 19:05:36 +0200 Subject: [PATCH 3/3] Install httpbf and make it possible to include the header in C++ code --- src/httpbf/CMakeLists.txt | 11 +++++++++++ src/httpbf/src/httpbf.h | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/httpbf/CMakeLists.txt b/src/httpbf/CMakeLists.txt index d7f6bce91f..faddcdc681 100644 --- a/src/httpbf/CMakeLists.txt +++ b/src/httpbf/CMakeLists.txt @@ -31,3 +31,14 @@ target_link_libraries(${HTTPBF_LIBRARY} ${NEON_LIBRARIES}) if(NOT WIN32) add_definitions( -fPIC ) endif() + +INSTALL( + TARGETS + ${HTTPBF_LIBRARY} + LIBRARY DESTINATION + ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION + ${LIB_INSTALL_DIR} + RUNTIME DESTINATION + ${BIN_INSTALL_DIR} +) diff --git a/src/httpbf/src/httpbf.h b/src/httpbf/src/httpbf.h index b61fb7779a..020bfe363d 100644 --- a/src/httpbf/src/httpbf.h +++ b/src/httpbf/src/httpbf.h @@ -25,6 +25,11 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + + enum hbf_state_e { HBF_SUCCESS, HBF_NOT_TRANSFERED, /* never tried to transfer */ @@ -99,4 +104,9 @@ const char *hbf_error_string( Hbf_State state ); */ int hbf_fail_http_code( hbf_transfer_t *transfer ); +#ifdef __cplusplus +} +#endif + + #endif