You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(56) |
Apr
(109) |
May
(15) |
Jun
(3) |
Jul
(37) |
Aug
(96) |
Sep
(40) |
Oct
(4) |
Nov
(54) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(47) |
Feb
(30) |
Mar
(102) |
Apr
(120) |
May
(68) |
Jun
(54) |
Jul
(53) |
Aug
(122) |
Sep
(190) |
Oct
(71) |
Nov
(85) |
Dec
(108) |
2007 |
Jan
(72) |
Feb
(190) |
Mar
(53) |
Apr
(101) |
May
(145) |
Jun
(148) |
Jul
(167) |
Aug
(143) |
Sep
(23) |
Oct
(198) |
Nov
(223) |
Dec
(195) |
2008 |
Jan
(100) |
Feb
(129) |
Mar
(79) |
Apr
(77) |
May
(34) |
Jun
(95) |
Jul
(112) |
Aug
(160) |
Sep
(82) |
Oct
(124) |
Nov
(199) |
Dec
(355) |
2009 |
Jan
(436) |
Feb
(89) |
Mar
(298) |
Apr
(189) |
May
(33) |
Jun
(88) |
Jul
(105) |
Aug
(44) |
Sep
(181) |
Oct
(87) |
Nov
(75) |
Dec
(1) |
2010 |
Jan
(63) |
Feb
(21) |
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(26) |
Aug
(37) |
Sep
(26) |
Oct
(15) |
Nov
(13) |
Dec
|
From: <svn...@op...> - 2009-03-26 00:10:27
|
Author: scriptor Date: Thu Mar 26 01:10:11 2009 New Revision: 5323 URL: http://www.opensync.org/changeset/5323 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/CMakeLists.txt (contents, props changed) Added: plugins/ldap-sync/CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/CMakeLists.txt Thu Mar 26 01:10:11 2009 (r5323) @@ -0,0 +1,144 @@ +# $Id$ +# +# ldap-sync - A plugin for the opensync framework +# +# Copyright (C) 2005 - 2007 Gergely Santa <ger...@te...> (version +# Copyright (C) 2009 Juergen Leising <jle...@us...> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + + +PROJECT( libopensync-plugin-ldap ) + +SET( VERSION "0.39" ) + +cmake_minimum_required(VERSION 2.4) +IF(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +ENDIF(COMMAND cmake_policy) +# SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + + +######################################################### +# Look for 3rd Party CMake modules +SET( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules" ) + +FIND_PACKAGE( OpenSync REQUIRED ) +FIND_PACKAGE( GLIB2 REQUIRED ) +FIND_PACKAGE( LibXml2 REQUIRED ) +FIND_PACKAGE( LibXslt REQUIRED ) +FIND_PACKAGE( LibLdap REQUIRED ) +FIND_PACKAGE( LibGCrypt REQUIRED ) +FIND_PACKAGE( LibGSSAPIV2 ) + + + +############### Doxygen ############################ +MESSAGE(STATUS "checking for doxygen...") +FIND_PROGRAM( DOXYGEN_EXECUTABLE doxygen ) +IF (DOXYGEN_EXECUTABLE) + MESSAGE( STATUS " Found ${DOXYGEN_EXECUTABLE}") +ELSE (DOXYGEN_EXECUTABLE) + MESSAGE( STATUS " Could NOT find doxygen. This is not important.") +ENDIF (DOXYGEN_EXECUTABLE) + + +MESSAGE(STATUS "checking for dot...") +FIND_PROGRAM( DOXYGEN_DOT_EXECUTABLE dot ) +IF (DOXYGEN_DOT_EXECUTABLE) + MESSAGE( STATUS " Found ${DOXYGEN_DOT_EXECUTABLE}") +ELSE (DOXYGEN_DOT_EXECUTABLE) + MESSAGE( STATUS " Could NOT find dot. So the Doxyfile needs to be changed.") +ENDIF (DOXYGEN_DOT_EXECUTABLE) + + +IF ( DOXYGEN_EXECUTABLE ) + IF ( DOXYGEN_DOT_EXECUTABLE ) + SET( HAVE_DOT "YES" ) + ENDIF ( DOXYGEN_DOT_EXECUTABLE ) + CONFIGURE_FILE( "Doxyfile.in" "Doxyfile" ) + ADD_CUSTOM_TARGET( doxygen ${DOXYGEN_EXECUTABLE} ) +ENDIF ( DOXYGEN_EXECUTABLE ) + + + +############# C Flags and linker flags ######################## +#SET ( CMAKE_C_FLAGS_DEBUG " -ggdb3 -O0 -fno-inline -std=c99 -Wall -pedantic " CACHE STRING "Flags used by the C compiler during debug builds." FORCE ) +SET( CMAKE_C_FLAGS_DEBUG " -O0 -fno-inline -ggdb3 -Wall -std=c99 -pedantic -Wundef -Wextra -Wshadow -Wpointer-arith -Wwrite-strings -Wsign-compare -Wbad-function-cast -Wcast-align -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wvolatile-register-var -Wnormalized=nfc -Wvariadic-macros -fstack-protector-all -Wstack-protector -std=gnu99" CACHE STRING "Flags used by the C compiler during maintainer builds." FORCE ) +# -Wpadded +# -Wcast-qual +SET( CMAKE_EXE_LINKER_FLAGS_DEBUG "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used for linking binaries during debug builds." FORCE ) +SET( CMAKE_SHARED_LINKER_FLAGS_DEBUG "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING "Flags used by the shared libraries linker during debug builds." FORCE ) + + +MARK_AS_ADVANCED(CMAKE_C_FLAGS_DEBUG CMAKE_EXE_LINKER_FLAGS_DEBUG CMAKE_SHARED_LINKER_FLAGS_DEBUG ) + + + + + +INCLUDE( Testing ) +INCLUDE( OpenSyncInternal ) + + +SET( LDAP_PLUGIN_OPENSYNC_CONFIGDIR "${SHARE_INSTALL_DIR}/libopensync1/defaults" CACHE PATH "OpenSync plugin configuration directory: Where the style sheets can be found." ) +SET( LDAP_PLUGIN_OPENSYNC_SCHEMASDIR "${SHARE_INSTALL_DIR}/libopensync1/schemas" CACHE PATH "OpenSync XML schemata directory." ) + + +ADD_SUBDIRECTORY( src ) +ADD_SUBDIRECTORY( tests ) + + +#################### make uninstall ###################################### +# uninstall target - cf. cmake FAQ: Can I do "make uninstall" with CMake? +CONFIGURE_FILE( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) +ADD_CUSTOM_TARGET(uninstall + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") + + +################### config.h ############################# +SET( SHARE_INSTALL_DIR "${SHARE_INSTALL_DIR}" CACHE PATH "Installation directory for configuration files and schemata") +CONFIGURE_FILE( "config.h.cmake" "config.h" ) + + + +######## The MacroEnsureOutOfSourceBuild.cmake fails sometimes... ######### +MESSAGE(STATUS "CMAKE_SOURCE_DIR = ${CMAKE_SOURCE_DIR}" ) +MESSAGE(STATUS "CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}" ) +MESSAGE(STATUS "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}" ) +MESSAGE(STATUS "CMAKE_BINARY_DIR = ${CMAKE_BINARY_DIR}" ) +MESSAGE(STATUS "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_SOURCE_DIR}" ) +MESSAGE(STATUS "CMAKE_BINARY_DIR = ${CMAKE_SOURCE_DIR}" ) +MESSAGE(STATUS "CWD = $ENV{PWD}" ) +MESSAGE(STATUS "LDAP_PLUGIN_OPENSYNC_CONFIGDIR = ${LDAP_PLUGIN_OPENSYNC_CONFIGDIR}") +MESSAGE(STATUS "LDAP_PLUGIN_OPENSYNC_SCHEMASDIR = ${LDAP_PLUGIN_OPENSYNC_SCHEMASDIR}") + + +##################### debugging cmake... ################################# +# "cmake ... -DCMAKE_BUILD_TYPE=Whatever" sometimes does not work. +MESSAGE(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}" ) + + + +########################################################################## +## Packaging + +OPENSYNC_PACKAGE( ${PROJECT_NAME} ${VERSION} ) + +# vim:tw=0:nowrap |
From: <svn...@op...> - 2009-03-26 00:09:57
|
Author: scriptor Date: Thu Mar 26 01:09:41 2009 New Revision: 5322 URL: http://www.opensync.org/changeset/5322 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/ChangeLog (contents, props changed) Added: plugins/ldap-sync/ChangeLog ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/ChangeLog Thu Mar 26 01:09:41 2009 (r5322) @@ -0,0 +1,58 @@ +$Id$ + +opensync-plugin-ldap: + +0.39: +- Upgraded to openldap-2.4.x +- Ported the whole plugin from libopensync-0.22 to libopensync-0.3x. + This involves: + -- cmake, + -- sinks, + -- new format of config file, + -- use of stylesheets for conversion, + -- sourcing out the conversion routines into a separate format plugin + -- and dozens of other API changes. +- Several issues with the TLS/SSL based encryption of the LDAP session + are fixed now. +- Authentication towards the LDAP server involves several possibilities: + -- Simple authentication + -- SASL/DIGEST-MD5 with the password being stored externally in the sasldb + works. + -- SASL/CRAM-MD5 with the password being stored externally in the sasldb + works, as well. + -- SASL/LOGIN with the password being stored externally in the sasldb, + works, as well, provided that the session is encrypted. + -- SASL/PLAIN with the password being stored externally in the sasldb, + works, as well, provided that the session is encrypted. + -- SASL/PLAIN using saslauthd which calls pam while the LDAP session + is encrypted, does NOT work. Pass-through methods would work only, + if the PLAIN mechanism was used, anyway. And the PLAIN mechanism + in turn is regarded as trust-worthy mechanism only, if the LDAP + session is encrypted... + -- SASL/GSSAPI carrying Kerberos V5 works, even though right now + there are no special/separate configuration options regarding the + "realm" and the "authzid" (TODO). Prerequisite is, as always with + Kerberos V5, that a ticket-granting ticket has been obtained + prior to running osynctool (e.g. "kinit -V ldap_user"). + -- SASL/EXTERNAL works, as well, provided that the LDAP session + is encrypted. This method does not use any password, at all. + The authentication is checked by taking the distinguished name from + the SSL/TLS certificate of the client and mapping this SSL/TLS DN + to an LDAP DN. This LDAP DN is treated as the authentication DN. + The mapping can be configured in slapd.conf (authz-regexp). +- Some smaller issues, like hangs, error messages etc. have + been resolved. +- For the time being the objtype "contact" can be mapped + either to the LDAP scheme "evolutionPerson" or to the + LDAP scheme "inetorgPerson". This can be configured. +- The other objtypes are mapped to general object classes, like + "ou:" and "document:", while some LDAP attribute names are abused + for storing "name" and "value" pairs. + + +0.22: +- The original version of the opensync-plugin-ldap was written by Gergely Santa + <ger...@te...> + + + |
From: <svn...@op...> - 2009-03-26 00:09:24
|
Author: scriptor Date: Thu Mar 26 01:09:12 2009 New Revision: 5321 URL: http://www.opensync.org/changeset/5321 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/AUTHORS (contents, props changed) Added: plugins/ldap-sync/AUTHORS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/AUTHORS Thu Mar 26 01:09:12 2009 (r5321) @@ -0,0 +1,5 @@ +$Id$ + +Initially written by Gergely Santa <ger...@te...> (version 0.22) +Ported to 0.3x by Juergen Leising <jle...@us...> + |
From: <svn...@op...> - 2009-03-25 23:27:32
|
Author: dgollub Date: Thu Mar 26 00:27:25 2009 New Revision: 5320 URL: http://www.opensync.org/changeset/5320 Log: Fix and renable engine_error_dual_connect_error testcase. Tolerate the "disconnect" event signal on a dual_connect_error. fixes #995 Modified: trunk/tests/CMakeLists.txt trunk/tests/engine-tests/check_engine_error.c Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Wed Mar 25 23:56:37 2009 (r5319) +++ trunk/tests/CMakeLists.txt Thu Mar 26 00:27:25 2009 (r5320) @@ -154,7 +154,7 @@ OSYNC_TESTCASE( engine-error engine_error_double_init_error) OSYNC_TESTCASE( engine-error engine_error_no_config_error) OSYNC_TESTCASE( engine-error engine_error_no_objtype_error) -OSYNC_TESTCASE_DISABLED( engine-error engine_error_dual_connect_error "995") +OSYNC_TESTCASE( engine-error engine_error_dual_connect_error) OSYNC_TESTCASE( engine-error engine_error_one_of_two_connect_error) OSYNC_TESTCASE( engine-error engine_error_two_of_three_connect_error) OSYNC_TESTCASE( engine-error engine_error_two_of_three_connect_error2) Modified: trunk/tests/engine-tests/check_engine_error.c ============================================================================== --- trunk/tests/engine-tests/check_engine_error.c Wed Mar 25 23:56:37 2009 (r5319) +++ trunk/tests/engine-tests/check_engine_error.c Thu Mar 26 00:27:25 2009 (r5320) @@ -509,7 +509,15 @@ fail_unless(num_engine_read == 0, NULL); fail_unless(num_engine_written == 0, NULL); fail_unless(num_engine_sync_done == 0, NULL); - fail_unless(num_engine_disconnected == 0, NULL); + + /* Engine always disconnects - even on an error. + * See _osync_engine_generate_disconnected_event() + * + * This is just the call of the event callback, + * in theory no disconnect function of proxies get called. + */ + fail_unless(num_engine_disconnected == 1, NULL); + fail_unless(num_engine_successful == 0, NULL); fail_unless(num_engine_end_conflicts == 0, NULL); fail_unless(num_engine_prev_unclean == 0, NULL); |
From: <svn...@op...> - 2009-03-25 22:56:43
|
Author: dgollub Date: Wed Mar 25 23:56:37 2009 New Revision: 5319 URL: http://www.opensync.org/changeset/5319 Log: Use osync-memory function to allocate buffer for format print function. Modified: plugins/file-sync/src/file.c Modified: plugins/file-sync/src/file.c ============================================================================== --- plugins/file-sync/src/file.c Wed Mar 25 23:49:27 2009 (r5318) +++ plugins/file-sync/src/file.c Wed Mar 25 23:56:37 2009 (r5319) @@ -22,6 +22,7 @@ #include <glib.h> #include <opensync/opensync.h> +#include <opensync/opensync-common.h> #include <opensync/opensync-format.h> #include "file.h" @@ -157,7 +158,7 @@ { OSyncFileFormat *file = (OSyncFileFormat *)data; - char *printable = g_strdup_printf ("File %s: size: %i", file->path, file->size); + char *printable = osync_strdup_printf ("File %s: size: %i", file->path, file->size); return printable; } |
From: <svn...@op...> - 2009-03-25 22:49:33
|
Author: dgollub Date: Wed Mar 25 23:49:27 2009 New Revision: 5318 URL: http://www.opensync.org/changeset/5318 Log: Free memory of the format plugin print function with osync_free() as defined by the API. refs #1028 Modified: osynctool/trunk/tools/osynctool.c Modified: osynctool/trunk/tools/osynctool.c ============================================================================== --- osynctool/trunk/tools/osynctool.c Wed Mar 25 23:48:38 2009 (r5317) +++ osynctool/trunk/tools/osynctool.c Wed Mar 25 23:49:27 2009 (r5318) @@ -484,7 +484,7 @@ osync_member_get_pluginname(member), osync_change_get_uid(change), printable); - g_free(printable); + osync_free(printable); } } |
From: <svn...@op...> - 2009-03-25 22:48:44
|
Author: dgollub Date: Wed Mar 25 23:48:38 2009 New Revision: 5317 URL: http://www.opensync.org/changeset/5317 Log: Define how the memory of the format plugin "print" function must get allocated and freed. fixes #1028 Modified: trunk/opensync/data/opensync_data.h trunk/opensync/format/opensync_objformat.h Modified: trunk/opensync/data/opensync_data.h ============================================================================== --- trunk/opensync/data/opensync_data.h Wed Mar 25 22:37:09 2009 (r5316) +++ trunk/opensync/data/opensync_data.h Wed Mar 25 23:48:38 2009 (r5317) @@ -119,7 +119,7 @@ * objects they should specify a print function. * * @param data The data to get printable - * @return A string describing the object + * @return A string describing the object which must be freed by the caller with osync_free() */ OSYNC_EXPORT char *osync_data_get_printable(OSyncData *data); Modified: trunk/opensync/format/opensync_objformat.h ============================================================================== --- trunk/opensync/format/opensync_objformat.h Wed Mar 25 22:37:09 2009 (r5316) +++ trunk/opensync/format/opensync_objformat.h Wed Mar 25 23:48:38 2009 (r5317) @@ -180,6 +180,9 @@ * describing the object as closely as possible. This information will be * used by the user to decide which object to pick when there is a conflict. * + * The print_func returns a humand readable string (with terminating \0) and + * memory must be allocated with osync_try_malloc0(), osync_strdup*(). + * * @param format Pointer to the object format * @param print_func The print function to use */ @@ -252,7 +255,7 @@ * @param format Pointer to the object format * @param data Pointer to the object to destroy * @param size Size in bytes of the object specified by the data parameter - * @returns Human readable string of the specified object. Caller is responsible for freeing the string. + * @returns Human readable string of the specified object. Caller is responsible for freeing the string with osync_free(). * Or NULL if size is 0 or data NULL. */ OSYNC_EXPORT char *osync_objformat_print(OSyncObjFormat *format, const char *data, unsigned int size); |
From: <svn...@op...> - 2009-03-25 21:37:28
|
Author: dgollub Date: Wed Mar 25 22:37:09 2009 New Revision: 5316 URL: http://www.opensync.org/changeset/5316 Log: Add testcase for error handling in discover phase. Fix error reporting of discover engine command. Modified: trunk/opensync/engine/opensync_engine.c trunk/tests/CMakeLists.txt trunk/tests/engine-tests/check_engine_error.c trunk/tests/mock-plugin/mock_sync.c trunk/tests/support.c Modified: trunk/opensync/engine/opensync_engine.c ============================================================================== --- trunk/opensync/engine/opensync_engine.c Wed Mar 25 19:52:52 2009 (r5315) +++ trunk/opensync/engine/opensync_engine.c Wed Mar 25 22:37:09 2009 (r5316) @@ -2244,15 +2244,16 @@ g_cond_wait(engine->syncing, engine->syncing_mutex); g_mutex_unlock(engine->syncing_mutex); - if (!osync_engine_finalize(engine, error)) - goto error; - + if (engine->error) { osync_error_set_from_error(error, &(engine->error)); osync_error_unref(&(engine->error)); engine->error = NULL; - goto error; + goto error_finalize; } + + if (!osync_engine_finalize(engine, error)) + goto error; osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Wed Mar 25 19:52:52 2009 (r5315) +++ trunk/tests/CMakeLists.txt Wed Mar 25 22:37:09 2009 (r5316) @@ -196,6 +196,7 @@ OSYNC_TESTCASE( engine-error engine_error_disconnect_timeout_and_error) OSYNC_TESTCASE( engine-error engine_error_get_changes_disconnect_error) OSYNC_TESTCASE( engine-error engine_error_missing_format_plugin) +OSYNC_TESTCASE( engine-error engine_error_discover_error) BUILD_CHECK_TEST( formatenv format-tests/check_format_env.c ${TEST_TARGET_LIBRARIES} ) OSYNC_TESTCASE(formatenv format_env_create) Modified: trunk/tests/engine-tests/check_engine_error.c ============================================================================== --- trunk/tests/engine-tests/check_engine_error.c Wed Mar 25 19:52:52 2009 (r5315) +++ trunk/tests/engine-tests/check_engine_error.c Wed Mar 25 22:37:09 2009 (r5316) @@ -3001,6 +3001,47 @@ } END_TEST +START_TEST (engine_error_discover_error) +{ + char *testbed = setup_testbed("sync"); + char *formatdir = g_strdup_printf("%s/formats", testbed); + char *plugindir = g_strdup_printf("%s/plugins", testbed); + + OSyncError *error = NULL; + OSyncGroup *group = osync_group_new(&error); + osync_group_set_schemadir(group, testbed); + osync_group_load(group, "configs/group", &error); + fail_unless(error == NULL, NULL); + + OSyncMember *member = osync_group_nth_member(group, 1); + + OSyncEngine *engine = osync_engine_new(group, &error); + fail_unless(engine != NULL, NULL); + fail_unless(error == NULL, NULL); + + osync_engine_set_schemadir(engine, testbed); + osync_engine_set_plugindir(engine, plugindir); + osync_engine_set_formatdir(engine, formatdir); + + /* This will trigger an error in the mock-sync plugin of member 1 */ + /* in the discover function */ + g_setenv("MOCK_DISCOVER_ERROR", "1", TRUE); + + fail_unless(!osync_engine_discover_and_block(engine, member, &error), NULL); + fail_unless(error != NULL, NULL); + fail_unless(strcmp("MOCK_DISCOVER_ERROR on purpose!", osync_error_print(&error)) == 0, NULL); + osync_error_unref(&error); + + osync_engine_unref(engine); + osync_group_unref(group); + g_free(formatdir); + g_free(plugindir); + + destroy_testbed(testbed); +} +END_TEST + + OSYNC_TESTCASE_START("engine_error") OSYNC_TESTCASE_ADD(engine_error_single_init_error) OSYNC_TESTCASE_ADD(engine_error_double_init_error) @@ -3065,5 +3106,7 @@ OSYNC_TESTCASE_ADD(engine_error_missing_format_plugin) +OSYNC_TESTCASE_ADD(engine_error_discover_error) + OSYNC_TESTCASE_END Modified: trunk/tests/mock-plugin/mock_sync.c ============================================================================== --- trunk/tests/mock-plugin/mock_sync.c Wed Mar 25 19:52:52 2009 (r5315) +++ trunk/tests/mock-plugin/mock_sync.c Wed Mar 25 22:37:09 2009 (r5316) @@ -796,6 +796,13 @@ /* we can set here the capabilities, but for the file-sync * plugin they are static and shipped with opensync */ + + if (mock_get_error(info->memberid, "MOCK_DISCOVER_ERROR")) { + osync_error_set(error, OSYNC_ERROR_EXPECTED, "MOCK_DISCOVER_ERROR on purpose!"); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + return FALSE; + } + osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; } Modified: trunk/tests/support.c ============================================================================== --- trunk/tests/support.c Wed Mar 25 19:52:52 2009 (r5315) +++ trunk/tests/support.c Wed Mar 25 22:37:09 2009 (r5316) @@ -78,6 +78,8 @@ g_unsetenv("MOCK_SYNC_ALWAYS_CHANGETYPE_MODIFIED"); g_unsetenv("MOCK_FORMAT_PATH_COMPARE_NO"); + + g_unsetenv("MOCK_DISCOVER_ERROR"); } |
From: <svn...@op...> - 2009-03-25 18:53:12
|
Author: dgollub Date: Wed Mar 25 19:52:52 2009 New Revision: 5315 URL: http://www.opensync.org/changeset/5315 Log: Final fix of mapping_engine for similiar&same conflicts. The change/entry_engine of the "similar" entry got overwritten by the "same" entry. So the similar&same was never fixed to 100% This fixes tescases: mapping_engine_same_similar_conflict mapping_engine_same_similar_conflict_multi (This was not a $ARCH problem as stated before) fixes #883 Modified: trunk/opensync/engine/opensync_obj_engine.c Modified: trunk/opensync/engine/opensync_obj_engine.c ============================================================================== --- trunk/opensync/engine/opensync_obj_engine.c Wed Mar 25 18:14:22 2009 (r5314) +++ trunk/opensync/engine/opensync_obj_engine.c Wed Mar 25 19:52:52 2009 (r5315) @@ -259,6 +259,7 @@ OSyncList *unmapped_mappings = NULL; OSyncConvCmpResult result = 0; OSyncMappingEntryEngine *entry_engine = NULL; + OSyncChange *old_change; osync_trace(TRACE_ENTRY, "%s(%p)", __func__, engine); //osync_trace_disable(); @@ -298,10 +299,33 @@ mapping_engine->conflict = TRUE; } else if (result == OSYNC_CONV_DATA_SAME) { unmapped_mappings = osync_list_remove(unmapped_mappings, mapping_engine); + mapping_engine->conflict = FALSE; } + /* Update the entry which belongs to our sinkengine with the the change */ entry_engine = osync_mapping_engine_get_entry(mapping_engine, sinkengine); osync_assert(entry_engine); + + /* Don't overwrite unprefered entry_engines (e.g. SIMILAR). + * + * Secenario: First a mapping with SIMILAR get created. Later a mapping + * with SAME compare result gets detected. The SAME mapping engine get prefered. + * + * The old change gets moved into a new mapping_engine. + */ + if ((old_change = osync_entry_engine_get_change(entry_engine))) { + OSyncMappingEngine *old_mapping_engine = NULL; + OSyncMappingEntryEngine *old_entry_engine = NULL; + old_mapping_engine = _osync_obj_engine_create_mapping_engine(engine, error); + if (!old_mapping_engine) + goto error; + + new_mappings = osync_list_append(new_mappings, old_mapping_engine); + unmapped_mappings = osync_list_append(unmapped_mappings, old_mapping_engine); + + old_entry_engine = osync_mapping_engine_get_entry(old_mapping_engine, sinkengine); + osync_entry_engine_update(old_entry_engine, old_change); + } osync_entry_engine_update(entry_engine, change); sinkengine->unmapped = osync_list_remove(sinkengine->unmapped, sinkengine->unmapped->data); |
From: <svn...@op...> - 2009-03-25 17:14:29
|
Author: bricks Date: Wed Mar 25 18:14:22 2009 New Revision: 5314 URL: http://www.opensync.org/changeset/5314 Log: Added CHECK_LIBRARY_DIRS to link directories BUGFIX: Build failed if check wasn't installed in a default location Modified: trunk/tests/CMakeLists.txt Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Wed Mar 25 17:22:32 2009 (r5313) +++ trunk/tests/CMakeLists.txt Wed Mar 25 18:14:22 2009 (r5314) @@ -1,4 +1,4 @@ -LINK_DIRECTORIES( ${GLIB2_LIBRARY_DIRS} ${LIBXML2_LIBRARY_DIRS} ) +LINK_DIRECTORIES( ${GLIB2_LIBRARY_DIRS} ${LIBXML2_LIBRARY_DIRS} ${CHECK_LIBRARY_DIRS} ) INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CHECK_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIRS} ) ADD_SUBDIRECTORY( mock-plugin ) |
From: <svn...@op...> - 2009-03-25 16:22:44
|
Author: dgollub Date: Wed Mar 25 17:22:32 2009 New Revision: 5313 URL: http://www.opensync.org/changeset/5313 Log: Fix sync_detect_obj2 and outstanding issue as described in #992 comment:16 and comment:17 fixes #992 Modified: trunk/opensync/engine/opensync_engine.c trunk/opensync/engine/opensync_engine_internals.h Modified: trunk/opensync/engine/opensync_engine.c ============================================================================== --- trunk/opensync/engine/opensync_engine.c Wed Mar 25 16:43:18 2009 (r5312) +++ trunk/opensync/engine/opensync_engine.c Wed Mar 25 17:22:32 2009 (r5313) @@ -1556,9 +1556,9 @@ return FALSE; } -unsigned int osync_engine_num_active_proxies_for_objtypes(OSyncEngine *engine, const char *objtype) +unsigned int osync_engine_num_proxies_for_objtypes(OSyncEngine *engine, const char *objtype) { - unsigned int num, i, active_proxies = 0; + unsigned int num, i, proxies = 0; osync_trace(TRACE_ENTRY, "%s(%p, %s)", __func__, engine, objtype); @@ -1567,17 +1567,44 @@ OSyncClientProxy *proxy = osync_engine_nth_proxy(engine, i); OSyncObjTypeSink *sink = osync_client_proxy_find_objtype_sink(proxy, objtype); - if (!sink) { - OSyncMember *member = osync_client_proxy_get_member(proxy); - if (!osync_member_get_alternative_objtype(member, objtype)) - continue; - } + if (!sink) + continue; - active_proxies++; + proxies++; } - osync_trace(TRACE_EXIT, "%s: %u", __func__, active_proxies); - return active_proxies; + osync_trace(TRACE_EXIT, "%s: %u", __func__, proxies); + return proxies; +} + +unsigned int osync_engine_num_proxies_for_alternative_objtypes(OSyncEngine *engine, const char *objtype) +{ + const char *alternative_objtype; + unsigned int num, i, proxies = 0; + + osync_trace(TRACE_ENTRY, "%s(%p, %s)", __func__, engine, objtype); + + num = osync_engine_num_proxies(engine); + for (i = 0; i < num; i++) { + OSyncClientProxy *proxy = osync_engine_nth_proxy(engine, i); + OSyncMember *member = osync_client_proxy_get_member(proxy); + OSyncObjTypeSink *sink = osync_client_proxy_find_objtype_sink(proxy, objtype); + + if (sink) + continue; + + /* Don't count alternative_objtype of the member if this alternative_objtype has + * is already in a (potential) sink pair/objengine. + */ + if (!(alternative_objtype = osync_member_get_alternative_objtype(member, objtype)) + || osync_engine_num_proxies_for_objtypes(engine, alternative_objtype) > 1) + continue; + + proxies++; + } + + osync_trace(TRACE_EXIT, "%s: %u", __func__, proxies); + return proxies; } osync_bool osync_engine_initialize(OSyncEngine *engine, OSyncError **error) @@ -1643,8 +1670,6 @@ const char *objtype = o->data; OSyncObjEngine *objengine = NULL; - osync_trace(TRACE_INTERNAL, "ObjType: %s", objtype); - /* Respect if the object type is disabled */ if (!osync_group_objtype_enabled(engine->group, objtype)) continue; @@ -1652,9 +1677,12 @@ /* Check if there are at least two proxies with native objtype * and alternative-objtypes to sync this objtype */ - if (osync_engine_num_active_proxies_for_objtypes(engine, objtype) < 2) + if (osync_engine_num_proxies_for_alternative_objtypes(engine, objtype) + + osync_engine_num_proxies_for_objtypes(engine, objtype) < 2) continue; + osync_trace(TRACE_INTERNAL, "Activating ObjType: %s", objtype); + objengine = osync_obj_engine_new(engine, objtype, engine->formatenv, error); if (!objengine) goto error_finalize; Modified: trunk/opensync/engine/opensync_engine_internals.h ============================================================================== --- trunk/opensync/engine/opensync_engine_internals.h Wed Mar 25 16:43:18 2009 (r5312) +++ trunk/opensync/engine/opensync_engine_internals.h Wed Mar 25 17:22:32 2009 (r5313) @@ -144,6 +144,28 @@ */ osync_bool osync_engine_slowsync_for_mixed_objengines(OSyncEngine *engine, OSyncError **error); +/** @brief Returns the number of proxies which support natively the specific ObjType + * + * @param engine Pointer to engine + * @param objtype The name of the ObjType + * @returns Number of proxies which support the supplied objtype natively. + * + */ +unsigned int osync_engine_num_proxies_for_objtypes(OSyncEngine *engine, const char *objtype); + + +/** @brief Returns the number of proxies which support an ObjType indirect via an alternative + * ObjType + * + * This function is useful to setup sinks for mixed-objtype synchronization + * + * @param engine Pointer to engine + * @param objtype The name of the ObjType + * @returns Number of proxies which support the supplied objtype via an alternative ObjType (mixed objtype syncing) + * + */ +unsigned int osync_engine_num_proxies_for_alternative_objtypes(OSyncEngine *engine, const char *objtype); + /*@}*/ #endif /*OPENSYNC_ENGINE_INTERNALS_H_*/ |
From: <svn...@op...> - 2009-03-25 15:53:02
|
Author: bellmich Date: Wed Mar 25 16:52:44 2009 New Revision: 1019 URL: http://libsyncml.opensync.org/changeset/1019 Log: updated traces to get more details from Solaris segfaults Modified: trunk/libsyncml/sml_support.c trunk/libsyncml/transports/http_server.c Modified: trunk/libsyncml/sml_support.c ============================================================================== --- trunk/libsyncml/sml_support.c Wed Mar 25 15:03:27 2009 (r1018) +++ trunk/libsyncml/sml_support.c Wed Mar 25 16:52:44 2009 (r1019) @@ -516,7 +516,7 @@ */ gboolean smlThreadCallFunctionCallback(gpointer data) { - smlTrace(TRACE_ENTRY, "%s", __func__); + smlTrace(TRACE_ENTRY, "%s(%p)", __func__, data); smlAssert(data); SmlThreadFunctionContext *ctx = data; @@ -547,11 +547,12 @@ gpointer data, SmlError **error) { - smlTrace(TRACE_ENTRY, "%s", __func__); + smlTrace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, thread, func, data, error); CHECK_ERROR_REF smlAssert(func); /* initialize function context */ + smlTrace(TRACE_INTERNAL, "%s: preparing context", __func__); SmlThreadFunctionContext *ctx; ctx = smlTryMalloc0(sizeof(SmlThreadFunctionContext), error); if (!ctx) @@ -571,16 +572,21 @@ ctx->error = error; /* prepare glib source */ + smlTrace(TRACE_INTERNAL, "%s: preparing source", __func__); GSource *source = g_idle_source_new(); g_source_set_callback(source, smlThreadCallFunctionCallback, ctx, NULL); /* call function "synchronously" */ g_mutex_lock(ctx->mutex); + smlTrace(TRACE_INTERNAL, "%s: attach source", __func__); g_source_attach(source, thread->context); + smlTrace(TRACE_INTERNAL, "%s: wait for condition", __func__); g_cond_wait(ctx->cond, ctx->mutex); + smlTrace(TRACE_INTERNAL, "%s: get condition", __func__); g_mutex_unlock(ctx->mutex); /* cleanup */ + smlTrace(TRACE_INTERNAL, "%s: cleanup", __func__); SmlBool result = ctx->result; g_source_unref(source); g_mutex_free(ctx->mutex); Modified: trunk/libsyncml/transports/http_server.c ============================================================================== --- trunk/libsyncml/transports/http_server.c Wed Mar 25 15:03:27 2009 (r1018) +++ trunk/libsyncml/transports/http_server.c Wed Mar 25 16:52:44 2009 (r1019) @@ -460,8 +460,12 @@ /* signal disconnect to socket and potential client */ if (linkenv->msg) { + smlTrace(TRACE_INTERNAL, "%s: close open message/connection", __func__); soup_message_set_status (linkenv->msg, SOUP_STATUS_SERVICE_UNAVAILABLE); #ifdef HAVE_LIBSOUP22 + //soup_server_message_set_encoding ( + // SOUP_SERVER_MESSAGE (linkenv->msg), + // SOUP_TRANSFER_CONTENT_LENGTH); soup_message_io_unpause(linkenv->msg); #else soup_server_unpause_message(linkenv->env->server, linkenv->msg); |
From: <svn...@op...> - 2009-03-25 15:43:38
|
Author: dgollub Date: Wed Mar 25 16:43:18 2009 New Revision: 5312 URL: http://www.opensync.org/changeset/5312 Log: Add additional test description for sync_detect_obj2, also why it is currently failing. refs #992 Modified: trunk/tests/sync-tests/check_sync.c Modified: trunk/tests/sync-tests/check_sync.c ============================================================================== --- trunk/tests/sync-tests/check_sync.c Wed Mar 25 15:53:29 2009 (r5311) +++ trunk/tests/sync-tests/check_sync.c Wed Mar 25 16:43:18 2009 (r5312) @@ -2562,6 +2562,24 @@ } END_TEST + +/* Problem: Groups with several ObjTypeSink configured. + * With additional sink combiniation due to mixed-objtype syncing. + * + * Example: + * + * Member1: mockformat1, mockformat2, mockformat3 + * Member2: mockformat1 + * + * mockformat2 and mockformat1 are candidates for mixed-objtype type syncing. + * + * (mockformat1/mockobjtype1 and mockformat2/mockobjtype2) + * + * Expected behavior should be that only one Sink Pair of Proxies gets created, + * NOT 2 Sink Pairs with an additional dummy Sink. + * + * Expected result: ObjTypeSink mockobjtype1 with mockformat1 for member 1 and 2 + */ START_TEST (sync_detect_obj2) { char *testbed = setup_testbed("sync_multi"); |
From: <svn...@op...> - 2009-03-25 14:53:42
|
Author: dgollub Date: Wed Mar 25 15:53:29 2009 New Revision: 5311 URL: http://www.opensync.org/changeset/5311 Log: Fixes sync_detect_obj testcase Modified: trunk/opensync/group/opensync_member.c Modified: trunk/opensync/group/opensync_member.c ============================================================================== --- trunk/opensync/group/opensync_member.c Wed Mar 25 12:35:51 2009 (r5310) +++ trunk/opensync/group/opensync_member.c Wed Mar 25 15:53:29 2009 (r5311) @@ -683,7 +683,13 @@ for (o = member->objtypes; o; o = o->next) { OSyncObjTypeSink *sink = o->data; OSyncList *format_sinks = osync_objtype_sink_get_objformat_sinks(sink); - list = osync_list_concat(list, format_sinks); + + /* Use a copy of the list to allow full processing without impact + * on the orignal ObjFormatSink list of OSyncObjTypeSink + */ + OSyncList *copy_format_sinks = osync_list_copy(format_sinks); + + list = osync_list_concat(list, copy_format_sinks); } return list; |
From: <svn...@op...> - 2009-03-25 14:03:42
|
Author: bellmich Date: Wed Mar 25 15:03:27 2009 New Revision: 1018 URL: http://libsyncml.opensync.org/changeset/1018 Log: libsoup HTTP servers must be shut down by the correct thread too. So the finalize function of HTTP transport implementations will use the transport thread for all connection related stuff. Modified: trunk/libsyncml/sml_transport.c trunk/libsyncml/transports/http_server.c Modified: trunk/libsyncml/sml_transport.c ============================================================================== --- trunk/libsyncml/sml_transport.c Wed Mar 25 11:57:13 2009 (r1017) +++ trunk/libsyncml/sml_transport.c Wed Mar 25 15:03:27 2009 (r1018) @@ -1088,7 +1088,10 @@ } /* FIXME: Is there a situation where no thread is present? */ - if (tsp->type != SML_TRANSPORT_HTTP_CLIENT && tsp->thread) + + /* OBEX */ + if (tsp->type != SML_TRANSPORT_HTTP_CLIENT && + tsp->type != SML_TRANSPORT_HTTP_SERVER && tsp->thread) _smlTransportStop(tsp); /* give all jobs a chance to finish cleanly */ @@ -1097,7 +1100,7 @@ unsigned int queueLength = smlQueueLength(tsp->command_queue); for (; i < queueLength; i++) { if (tsp->thread) { - /* HTTP client only */ + /* HTTP */ if (!smlThreadCallFunction( tsp->thread, smlTransportDispatchQueueCallback, @@ -1105,6 +1108,7 @@ error)) goto error; } else { + /* OBEX */ smlQueueDispatch(tsp->command_queue); } } @@ -1112,7 +1116,7 @@ if (!tsp->functions.finalize(tsp->transport_data, error)) goto error; - /* HTTP client only */ + /* HTTP */ if (tsp->thread) _smlTransportStop(tsp); Modified: trunk/libsyncml/transports/http_server.c ============================================================================== --- trunk/libsyncml/transports/http_server.c Wed Mar 25 11:57:13 2009 (r1017) +++ trunk/libsyncml/transports/http_server.c Wed Mar 25 15:03:27 2009 (r1018) @@ -457,9 +457,20 @@ /* save link for disconnect event */ link = linkenv->link; + /* signal disconnect to socket and potential client */ + if (linkenv->msg) + { + soup_message_set_status (linkenv->msg, SOUP_STATUS_SERVICE_UNAVAILABLE); +#ifdef HAVE_LIBSOUP22 + soup_message_io_unpause(linkenv->msg); +#else + soup_server_unpause_message(linkenv->env->server, linkenv->msg); +#endif + linkenv->msg = NULL; + } + /* cleanup */ smlTrace(TRACE_INTERNAL, "%s: free memory", __func__); - linkenv->msg = NULL; /* FIXME: ignored */ linkenv->env = NULL; link->link_data = NULL; smlSafeFree((gpointer *)&linkenv); @@ -511,6 +522,23 @@ return TRUE; } +static SmlBool smlTransportHttpServerCleanupSocket( + gpointer data, + SmlError **error) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + CHECK_ERROR_REF + smlAssert(data); + + SoupServer *server = data; + + soup_server_quit(server); + g_object_unref(server); + + smlTrace(TRACE_EXIT, "%s", __func__); + return TRUE; +} + static SmlBool smlTransportHttpServerFinalize(void *data, SmlError **error) { smlTrace(TRACE_ENTRY, "%s(%p, %p)", __func__, data, error); @@ -525,8 +553,13 @@ * then there is no server. * (e.g. failure after smlTransportHttpServerNew) */ - soup_server_quit(env->server); - g_object_unref(env->server); + if (!smlThreadCallFunction( + env->tsp->thread, + smlTransportHttpServerCleanupSocket, + env->server, + error)) + goto error; + env->server = NULL; } if (env->url) |
From: <svn...@op...> - 2009-03-25 11:35:55
|
Author: dgollub Date: Wed Mar 25 12:35:51 2009 New Revision: 5310 URL: http://www.opensync.org/changeset/5310 Log: Add cmake svn:externals Modified: plugins/ldap-sync/ (props changed) |
From: <svn...@op...> - 2009-03-25 11:30:21
|
Author: bricks Date: Wed Mar 25 12:30:18 2009 New Revision: 5309 URL: http://www.opensync.org/changeset/5309 Log: First drafts for a new db interface Added: branches/osyncdb2/opensync/db2/ branches/osyncdb2/opensync/db2/opensync_db.h branches/osyncdb2/opensync/db2/opensync_db_connection.h branches/osyncdb2/opensync/db2/opensync_db_connection_private.h branches/osyncdb2/opensync/db2/opensync_db_env.h branches/osyncdb2/opensync/db2/opensync_db_env_private.h branches/osyncdb2/opensync/db2/opensync_db_private.h Added: branches/osyncdb2/opensync/db2/opensync_db.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/osyncdb2/opensync/db2/opensync_db.h Wed Mar 25 12:30:18 2009 (r5309) @@ -0,0 +1,42 @@ +/* + * libopensync - A synchronization framework + * Copyright (C) 2009 Bjoern Ricks <bjo...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, wri te to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _OPENSYNC_DB_H_ +#define _OPENSYNC_DB_H_ + +typedef void * (* OSyncDBInitializeFn) (OSyncDB *db, OSyncError **error); + +typedef OSyncDBConnection* (* OSyncDBConnectFn) (OSyncDB *db, const char *dbname, const char *username, const *password, void *userdata, OSyncError **error); + +typedef void (* OSyncDBFinalizeFn) (OSyncDB *db, void *dbdata); + +OSYNC_EXPORT OSyncDB *osync_db_new(OSyncError **error); + +OSYNC_EXPORT OSyncDB *osync_db_ref(OSyncDB *db); + +OSYNC_EXPORT void osync_db_unref(OSyncDB *db); + +OSYNC_EXPORT void osync_db_set_initialize(OSyncDB *db, OSyncDBInitializeFn); + +OSYNC_EXPORT void osync_db_set_finalize(OSyncDB *db, OSyncDBFinalizeFn); + +OSYNC_EXPORT void osync_db_set_connect(OSyncDB *db, OSyncDBConnectFn); + +#endif /* _OPENSYNC_DB_H_ */ Added: branches/osyncdb2/opensync/db2/opensync_db_connection.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/osyncdb2/opensync/db2/opensync_db_connection.h Wed Mar 25 12:30:18 2009 (r5309) @@ -0,0 +1,42 @@ +/* + * libopensync - A synchronization framework + * Copyright (C) 2009 Bjoern Ricks <bjo...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, wri te to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _OPENSYNC_DB_CONNECTION_H_ +#define _OPENSYNC_DB_CONNECTION_H_ + +typedef void (* OSyncDBConnectionDisconnectFn) (OSyncDBConnection *dbcon, void *data, OSyncError **error); + +typedef void * (* OSyncDBConnectionQueryFn) (OSyncDBConnection *dbcon, const char *query, void *data, OSyncError **error); /*TODO return value type ???*/ + +typedef struct OSyncDBConnectionFunctions { + OSyncDBConnectionQueryFn query; + OSyncDBConnectionDisconnectFn disconnect; + /*TODO to be continued */ +} OSyncDBConnectionFunctions; + +OSYNC_EXPORT OSyncDBConnection *osync_db_connection_new(OSyncDB *db, OSyncError *error); + +OSYNC_EXPORT OSyncDBConnection *osync_db_connection_ref(OSyncDBConnection *dbcon); + +OSYNC_EXPORT void osync_db_connection_unref(OSyncDBConnection *dbcon); + +OSYNC_EXPORT void osync_db_connection_set_functions(OSyncDBConnection *dbcon, OSyncDBConnectionFunctions functions. void *data); + +#endif /* _OPENSYNC_DB_CONNECTION_H_ */ Added: branches/osyncdb2/opensync/db2/opensync_db_connection_private.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/osyncdb2/opensync/db2/opensync_db_connection_private.h Wed Mar 25 12:30:18 2009 (r5309) @@ -0,0 +1,30 @@ +/* + * libopensync - A synchronization framework + * Copyright (C) 2009 Bjoern Ricks <bjo...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, wri te to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _OPENSYNC_DB_CONNECTION_PRIVATE_H_ +#define _OPENSYNC_DB_CONNECTION_PRIVATE_H_ + +typedef struct OSyncDBConnection { + OSyncDB *db; + OSyncDBConnectionFunctions functions; + void *data; +} OSyncDBConnection; + +#endif /* _OPENSYNC_DB_CONNECTION_PRIVATE_H_ */ Added: branches/osyncdb2/opensync/db2/opensync_db_env.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/osyncdb2/opensync/db2/opensync_db_env.h Wed Mar 25 12:30:18 2009 (r5309) @@ -0,0 +1,36 @@ +/* + * libopensync - A synchronization framework + * Copyright (C) 2009 Bjoern Ricks <bjo...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, wri te to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _OPENSYNC_DB_ENV_H_ +#define _OPENSYNC_DB_ENV_H_ + +OSYNC_EXPORT OSyncDBEnv *osync_db_env_new(OSyncError **error); + +OSYNC_EXPORT OSyncDBEnv *osync_db_env_ref(OSyncDBEnv *env); + +OSYNC_EXPORT void osync_db_env_unref(OSyncDBEnv *env); + +OSYNC_EXPORT osync_bool osync_db_env_load(OSyncDBEnv *env, const char *path, OSyncError **error); + +OSYNC_EXPORT OSyncDB *osync_db_env_find_db(OSyncDBEnv *env, const char *name); + +OSYNC_EXPORT OSyncList *osync_db_env_get_dbs(OSyncDBEnv *env); + +#endif /* _OPENSYNC_DB_ENV_H_ */ Added: branches/osyncdb2/opensync/db2/opensync_db_env_private.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/osyncdb2/opensync/db2/opensync_db_env_private.h Wed Mar 25 12:30:18 2009 (r5309) @@ -0,0 +1,28 @@ +/* + * libopensync - A synchronization framework + * Copyright (C) 2009 Bjoern Ricks <bjo...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, wri te to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _OSYNC_DB_ENV_PRIVATE_H_ +#define _OSYNC_DB_ENV_PRIVATE_H_ + +typedef struct OSyncDBEnv { + +} OSyncDBEnv; + +#endif /* _OSYNC_DB_ENV_PRIVATE_H_ */ Added: branches/osyncdb2/opensync/db2/opensync_db_private.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/osyncdb2/opensync/db2/opensync_db_private.h Wed Mar 25 12:30:18 2009 (r5309) @@ -0,0 +1,32 @@ +/* + * libopensync - A synchronization framework + * Copyright (C) 2009 Bjoern Ricks <bjo...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, wri te to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _OPENSYNC_DB_PRIVATE_H_ +#define _OPENSYNC_DB_PRIVATE_H_ + +typedef struct OSyncDB { + char *name; + GList connections; + OSyncDBInitializeFn initialize; + OSyncDBConnectFn connect; + OSyncDBFinalizeFn finalize; +} OSyncDB; + +#endif /* _OPENSYNC_DB_PRIVATE_H_ */ |
From: <svn...@op...> - 2009-03-25 11:29:48
|
Author: dgollub Date: Wed Mar 25 12:29:43 2009 New Revision: 5308 URL: http://www.opensync.org/changeset/5308 Log: Add directory for ldap-sync Added: plugins/ldap-sync/ |
From: <svn...@op...> - 2009-03-25 10:57:17
|
Author: bellmich Date: Wed Mar 25 11:57:13 2009 New Revision: 1017 URL: http://libsyncml.opensync.org/changeset/1017 Log: added missing include Modified: trunk/libsyncml/data_sync_api/data_sync_common.c Modified: trunk/libsyncml/data_sync_api/data_sync_common.c ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync_common.c Wed Mar 25 11:56:56 2009 (r1016) +++ trunk/libsyncml/data_sync_api/data_sync_common.c Wed Mar 25 11:57:13 2009 (r1017) @@ -22,6 +22,8 @@ #include "libsyncml/syncml_internals.h" #include "libsyncml/sml_error_internals.h" +#include "data_sync_devinf.h" + SmlBool smlDataSyncIsTimestamp(const char *anchor, SmlBool timestampDefault) { smlTrace(TRACE_ENTRY, "%s(%s, %d)", __func__, VA_STRING(anchor), timestampDefault); |
From: <svn...@op...> - 2009-03-25 10:57:00
|
Author: bellmich Date: Wed Mar 25 11:56:56 2009 New Revision: 1016 URL: http://libsyncml.opensync.org/changeset/1016 Log: only HTTP client transport needs a running thread during finalize Modified: trunk/libsyncml/sml_transport.c Modified: trunk/libsyncml/sml_transport.c ============================================================================== --- trunk/libsyncml/sml_transport.c Wed Mar 25 09:55:10 2009 (r1015) +++ trunk/libsyncml/sml_transport.c Wed Mar 25 11:56:56 2009 (r1016) @@ -1087,18 +1087,32 @@ goto error; } + /* FIXME: Is there a situation where no thread is present? */ + if (tsp->type != SML_TRANSPORT_HTTP_CLIENT && tsp->thread) + _smlTransportStop(tsp); + /* give all jobs a chance to finish cleanly */ smlQueueDetach(tsp->command_queue); int i = 0; unsigned int queueLength = smlQueueLength(tsp->command_queue); for (; i < queueLength; i++) { - if (!smlThreadCallFunction(tsp->thread, smlTransportDispatchQueueCallback, tsp->command_queue, error)) - goto error; + if (tsp->thread) { + /* HTTP client only */ + if (!smlThreadCallFunction( + tsp->thread, + smlTransportDispatchQueueCallback, + tsp->command_queue, + error)) + goto error; + } else { + smlQueueDispatch(tsp->command_queue); + } } if (!tsp->functions.finalize(tsp->transport_data, error)) goto error; + /* HTTP client only */ if (tsp->thread) _smlTransportStop(tsp); |
From: <svn...@op...> - 2009-03-25 08:55:20
|
Author: bellmich Date: Wed Mar 25 09:55:10 2009 New Revision: 1015 URL: http://libsyncml.opensync.org/changeset/1015 Log: SoupSession is designed for single-threaded applications. So the session cleanup must be done in the worker thread. Modified: trunk/libsyncml/transports/http_client.c Modified: trunk/libsyncml/transports/http_client.c ============================================================================== --- trunk/libsyncml/transports/http_client.c Wed Mar 25 09:54:02 2009 (r1014) +++ trunk/libsyncml/transports/http_client.c Wed Mar 25 09:55:10 2009 (r1015) @@ -375,6 +375,22 @@ return TRUE; } +static SmlBool smlTransportHttpClientCleanupSession( + gpointer data, + SmlError **error) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + CHECK_ERROR_REF + smlAssert(data); + + SoupSession *session = data; + + soup_session_abort(session); + g_object_unref(session); + + smlTrace(TRACE_EXIT, "%s", __func__); + return TRUE; +} static SmlBool smlTransportHttpClientFinalize(void *data, SmlError **error) { @@ -387,8 +403,8 @@ if (env->session) { - soup_session_abort(env->session); - g_object_unref(env->session); + if (!smlThreadCallFunction(env->tsp->thread, smlTransportHttpClientCleanupSession, env->session, error)) + goto error; env->session = NULL; } @@ -405,6 +421,9 @@ smlTrace(TRACE_EXIT, "%s", __func__); return TRUE; +error: + smlTrace(TRACE_EXIT_ERROR, "%s - %s", __func__, smlErrorPrint(error)); + return FALSE; } static void smlTransportHttpClientSend(void *userdata, void *link, SmlTransportData *data, SmlError *error) |
From: <svn...@op...> - 2009-03-25 08:54:08
|
Author: bellmich Date: Wed Mar 25 09:54:02 2009 New Revision: 1014 URL: http://libsyncml.opensync.org/changeset/1014 Log: smlTransportFinalize calls the finalize function of the transport implementations directly. The http implementations depend on the correct thread because libsoup is single-threaded (at minimum in case of the http client). This means that the worker thread must be available until all connections are closed (disconnected or finalized). Therefore the finalize function of a transport implementation must be called within the worker thread and the thread must be shut down after the finalize function was called. Modified: trunk/libsyncml/sml_transport.c Modified: trunk/libsyncml/sml_transport.c ============================================================================== --- trunk/libsyncml/sml_transport.c Tue Mar 24 18:58:49 2009 (r1013) +++ trunk/libsyncml/sml_transport.c Wed Mar 25 09:54:02 2009 (r1014) @@ -1044,6 +1044,18 @@ } } +static SmlBool smlTransportDispatchQueueCallback( + gpointer data, + SmlError **error) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + CHECK_ERROR_REF + smlAssert(data); + SmlQueue *queue = data; + smlQueueDispatch(queue); + smlTrace(TRACE_EXIT, "%s", __func__); + return TRUE; +} /** @brief Finalizes the transport * @@ -1075,20 +1087,21 @@ goto error; } - if (tsp->thread) { - _smlTransportStop(tsp); - } - - smlQueueDetach(tsp->command_queue); - /* give all jobs a chance to finish cleanly */ + smlQueueDetach(tsp->command_queue); int i = 0; unsigned int queueLength = smlQueueLength(tsp->command_queue); - for (; i < queueLength; i++) - smlQueueDispatch(tsp->command_queue); + for (; i < queueLength; i++) { + if (!smlThreadCallFunction(tsp->thread, smlTransportDispatchQueueCallback, tsp->command_queue, error)) + goto error; + } if (!tsp->functions.finalize(tsp->transport_data, error)) goto error; + + if (tsp->thread) + _smlTransportStop(tsp); + tsp->transport_data = NULL; tsp->state = SML_TRANSPORT_UNINITIALIZED; |
From: <svn...@op...> - 2009-03-25 07:59:49
|
Author: bricks Date: Wed Mar 25 08:59:45 2009 New Revision: 5307 URL: http://www.opensync.org/changeset/5307 Log: removed unnecessary trunk folder Deleted: branches/osyncdb2/trunk/ |
Author: bricks Date: Wed Mar 25 08:58:37 2009 New Revision: 5306 URL: http://www.opensync.org/changeset/5306 Log: removed unnecessary trunk folder Added: branches/osyncdb2/AUTHORS (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/AUTHORS branches/osyncdb2/CMakeLists.txt (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/CMakeLists.txt branches/osyncdb2/CODING (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/CODING branches/osyncdb2/COPYING (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/COPYING branches/osyncdb2/CTestConfig.cmake (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/CTestConfig.cmake branches/osyncdb2/ChangeLog (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/ChangeLog branches/osyncdb2/Doxyfile.in (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/Doxyfile.in branches/osyncdb2/INSTALL (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/INSTALL branches/osyncdb2/README (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/README branches/osyncdb2/cmake/ (props changed) - copied from r5305, branches/osyncdb2/trunk/cmake/ branches/osyncdb2/config.h.cmake (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/config.h.cmake branches/osyncdb2/docs/ (props changed) - copied from r5305, branches/osyncdb2/trunk/docs/ branches/osyncdb2/libopensync.pc.in (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/libopensync.pc.in branches/osyncdb2/misc/ (props changed) - copied from r5305, branches/osyncdb2/trunk/misc/ branches/osyncdb2/opensync/ (props changed) - copied from r5305, branches/osyncdb2/trunk/opensync/ branches/osyncdb2/opensync.sym (props changed) - copied unchanged from r5305, branches/osyncdb2/trunk/opensync.sym branches/osyncdb2/tests/ (props changed) - copied from r5305, branches/osyncdb2/trunk/tests/ branches/osyncdb2/tools/ (props changed) - copied from r5305, branches/osyncdb2/trunk/tools/ branches/osyncdb2/wrapper/ (props changed) - copied from r5305, branches/osyncdb2/trunk/wrapper/ Deleted: branches/osyncdb2/trunk/AUTHORS branches/osyncdb2/trunk/CMakeLists.txt branches/osyncdb2/trunk/CODING branches/osyncdb2/trunk/COPYING branches/osyncdb2/trunk/CTestConfig.cmake branches/osyncdb2/trunk/ChangeLog branches/osyncdb2/trunk/Doxyfile.in branches/osyncdb2/trunk/INSTALL branches/osyncdb2/trunk/README branches/osyncdb2/trunk/cmake/ branches/osyncdb2/trunk/config.h.cmake branches/osyncdb2/trunk/docs/ branches/osyncdb2/trunk/libopensync.pc.in branches/osyncdb2/trunk/misc/ branches/osyncdb2/trunk/opensync/ branches/osyncdb2/trunk/opensync.sym branches/osyncdb2/trunk/tests/ branches/osyncdb2/trunk/tools/ branches/osyncdb2/trunk/wrapper/ |
From: <svn...@op...> - 2009-03-25 07:56:12
|
Author: bricks Date: Wed Mar 25 08:56:07 2009 New Revision: 5305 URL: http://www.opensync.org/changeset/5305 Log: copy of current trunk for db rewrite refs #1050 Added: branches/osyncdb2/trunk/ (props changed) - copied from r5304, trunk/ |