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: <dg...@su...> - 2009-01-08 08:16:15
|
Author: bricks Date: Thu Jan 8 09:15:39 2009 New Revision: 5052 URL: http://www.opensync.org/changeset/5052 Log: implemented finalize function and changed the order of the parameters in discovery function (tomboy-sync doesn't compile due to anchor changes) Modified: plugins/tomboy-sync/src/tomboy_sync.c Modified: plugins/tomboy-sync/src/tomboy_sync.c ============================================================================== --- plugins/tomboy-sync/src/tomboy_sync.c Thu Jan 8 09:09:09 2009 (r5051) +++ plugins/tomboy-sync/src/tomboy_sync.c Thu Jan 8 09:15:39 2009 (r5052) @@ -259,12 +259,21 @@ static void osync_tomboysync_finalize(void *data) { - + if (!data) { + return; + } + OSyncTomboyEnv *tomboyenv; + tomboyenv = (OSyncTomboyEnv*)data; +#ifdef ENABLE_DBUS + osync_free(tomboyenv->connection); + osync_free(tomboyenv->proxy); +#endif + osync_free(tomboyenv->dir); } /* Here we actually tell opensync which sinks are available. For this plugin, we * just report all objtype as available. Since the resource are configured like this. */ -static osync_bool osync_tomboysync_discover(void *data, OSyncPluginInfo *info, OSyncError **error) +static osync_bool osync_tomboysync_discover(OSyncPluginInfo *info, void *data, OSyncError **error) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, error); |
From: <dg...@su...> - 2009-01-08 08:09:44
|
Author: bricks Date: Thu Jan 8 09:09:09 2009 New Revision: 5051 URL: http://www.opensync.org/changeset/5051 Log: Changed order of the discovery function parameters (syncml plugin doesn't compile currently due to anchor api changes) Modified: plugins/syncml/src/syncml_http_client.c plugins/syncml/src/syncml_http_client.h plugins/syncml/src/syncml_http_server.c plugins/syncml/src/syncml_http_server.h plugins/syncml/src/syncml_obex_client.c plugins/syncml/src/syncml_obex_client.h plugins/syncml/src/syncml_plugin.c Modified: plugins/syncml/src/syncml_http_client.c ============================================================================== --- plugins/syncml/src/syncml_http_client.c Wed Jan 7 22:16:33 2009 (r5050) +++ plugins/syncml/src/syncml_http_client.c Thu Jan 8 09:09:09 2009 (r5051) @@ -62,7 +62,7 @@ return NULL; } -osync_bool syncml_http_client_discover(void *data, OSyncPluginInfo *info, OSyncError **error) +osync_bool syncml_http_client_discover(OSyncPluginInfo *info, void *data, OSyncError **error) { return discover("syncml-http-client", data, info, error); } Modified: plugins/syncml/src/syncml_http_client.h ============================================================================== --- plugins/syncml/src/syncml_http_client.h Wed Jan 7 22:16:33 2009 (r5050) +++ plugins/syncml/src/syncml_http_client.h Thu Jan 8 09:09:09 2009 (r5051) @@ -8,7 +8,8 @@ OSyncError **error); osync_bool syncml_http_client_discover( - void *data, OSyncPluginInfo *info, + OSyncPluginInfo *info, + void *data, OSyncError **error); #endif //_SYNCML_PLUGIN_HTTP_CLIENT_H Modified: plugins/syncml/src/syncml_http_server.c ============================================================================== --- plugins/syncml/src/syncml_http_server.c Wed Jan 7 22:16:33 2009 (r5050) +++ plugins/syncml/src/syncml_http_server.c Thu Jan 8 09:09:09 2009 (r5051) @@ -38,7 +38,7 @@ return NULL; } -osync_bool syncml_http_server_discover(void *data, OSyncPluginInfo *info, OSyncError **error) +osync_bool syncml_http_server_discover(OSyncPluginInfo *info, void *data, OSyncError **error) { return discover("syncml-http-server", data, info, error); } Modified: plugins/syncml/src/syncml_http_server.h ============================================================================== --- plugins/syncml/src/syncml_http_server.h Wed Jan 7 22:16:33 2009 (r5050) +++ plugins/syncml/src/syncml_http_server.h Thu Jan 8 09:09:09 2009 (r5051) @@ -8,7 +8,8 @@ OSyncError **error); osync_bool syncml_http_server_discover( - void *data, OSyncPluginInfo *info, + OSyncPluginInfo *info, + void *data, OSyncError **error); #endif //_SYNCML_PLUGIN_HTTP_SERVER_H Modified: plugins/syncml/src/syncml_obex_client.c ============================================================================== --- plugins/syncml/src/syncml_obex_client.c Wed Jan 7 22:16:33 2009 (r5050) +++ plugins/syncml/src/syncml_obex_client.c Thu Jan 8 09:09:09 2009 (r5051) @@ -59,7 +59,7 @@ return NULL; } -osync_bool syncml_obex_client_discover(void *data, OSyncPluginInfo *info, OSyncError **error) +osync_bool syncml_obex_client_discover(OSyncPluginInfo *info, void *data, OSyncError **error) { return discover("syncml-obex-client", data, info, error); } Modified: plugins/syncml/src/syncml_obex_client.h ============================================================================== --- plugins/syncml/src/syncml_obex_client.h Wed Jan 7 22:16:33 2009 (r5050) +++ plugins/syncml/src/syncml_obex_client.h Thu Jan 8 09:09:09 2009 (r5051) @@ -8,7 +8,8 @@ OSyncError **error); osync_bool syncml_obex_client_discover( - void *data, OSyncPluginInfo *info, + OSyncPluginInfo *info, + void *data, OSyncError **error); #endif //_SYNCML_PLUGIN_OBEX_CLIENT_H Modified: plugins/syncml/src/syncml_plugin.c ============================================================================== --- plugins/syncml/src/syncml_plugin.c Wed Jan 7 22:16:33 2009 (r5050) +++ plugins/syncml/src/syncml_plugin.c Thu Jan 8 09:09:09 2009 (r5051) @@ -33,67 +33,67 @@ osync_bool get_sync_info(OSyncPluginEnv *env, OSyncError **error) { - OSyncPlugin *plugin; + OSyncPlugin *plugin; #ifdef ENABLE_HTTP - plugin = osync_plugin_new(error); + plugin = osync_plugin_new(error); - if (!plugin) - goto error; + if (!plugin) + goto error; - osync_plugin_set_name(plugin, "syncml-http-server"); - osync_plugin_set_longname(plugin, "SyncML over HTTP Server"); - osync_plugin_set_description(plugin, "Plugin to synchronize with SyncML over HTTP"); + osync_plugin_set_name(plugin, "syncml-http-server"); + osync_plugin_set_longname(plugin, "SyncML over HTTP Server"); + osync_plugin_set_description(plugin, "Plugin to synchronize with SyncML over HTTP"); - osync_plugin_set_initialize(plugin, syncml_http_server_init); - osync_plugin_set_finalize(plugin, finalize); - osync_plugin_set_discover(plugin, syncml_http_server_discover); + osync_plugin_set_initialize(plugin, syncml_http_server_init); + osync_plugin_set_finalize(plugin, finalize); + osync_plugin_set_discover(plugin, syncml_http_server_discover); - osync_plugin_env_register_plugin(env, plugin); - osync_plugin_unref(plugin); + osync_plugin_env_register_plugin(env, plugin); + osync_plugin_unref(plugin); - plugin = osync_plugin_new(error); + plugin = osync_plugin_new(error); - if (!plugin) - goto error; + if (!plugin) + goto error; - osync_plugin_set_name(plugin, "syncml-http-client"); - osync_plugin_set_longname(plugin, "SyncML over HTTP Client"); - osync_plugin_set_description(plugin, "Plugin to synchronize with SyncML over HTTP"); + osync_plugin_set_name(plugin, "syncml-http-client"); + osync_plugin_set_longname(plugin, "SyncML over HTTP Client"); + osync_plugin_set_description(plugin, "Plugin to synchronize with SyncML over HTTP"); - osync_plugin_set_initialize(plugin, syncml_http_client_init); - osync_plugin_set_finalize(plugin, finalize); - osync_plugin_set_discover(plugin, syncml_http_client_discover); + osync_plugin_set_initialize(plugin, syncml_http_client_init); + osync_plugin_set_finalize(plugin, finalize); + osync_plugin_set_discover(plugin, syncml_http_client_discover); - osync_plugin_env_register_plugin(env, plugin); - osync_plugin_unref(plugin); + osync_plugin_env_register_plugin(env, plugin); + osync_plugin_unref(plugin); #endif #ifdef ENABLE_OBEX - plugin = osync_plugin_new(error); - if (!plugin) - goto error; - - osync_plugin_set_name(plugin, "syncml-obex-client"); - osync_plugin_set_longname(plugin, "SyncML over OBEX Client"); - osync_plugin_set_description(plugin, "Plugin to synchronize with SyncML over OBEX"); - - osync_plugin_set_initialize(plugin, syncml_obex_client_init); - osync_plugin_set_finalize(plugin, finalize); - osync_plugin_set_discover(plugin, syncml_obex_client_discover); + plugin = osync_plugin_new(error); + if (!plugin) + goto error; + + osync_plugin_set_name(plugin, "syncml-obex-client"); + osync_plugin_set_longname(plugin, "SyncML over OBEX Client"); + osync_plugin_set_description(plugin, "Plugin to synchronize with SyncML over OBEX"); + + osync_plugin_set_initialize(plugin, syncml_obex_client_init); + osync_plugin_set_finalize(plugin, finalize); + osync_plugin_set_discover(plugin, syncml_obex_client_discover); - osync_plugin_env_register_plugin(env, plugin); - osync_plugin_unref(plugin); + osync_plugin_env_register_plugin(env, plugin); + osync_plugin_unref(plugin); - return TRUE; + return TRUE; #endif error: - osync_trace(TRACE_ERROR, "Unable to register: %s", osync_error_print(error)); - return FALSE; + osync_trace(TRACE_ERROR, "Unable to register: %s", osync_error_print(error)); + return FALSE; } int get_version(void) { - return 1; + return 1; } |
From: <dg...@su...> - 2009-01-07 21:17:00
|
Author: mkoller Date: Wed Jan 7 22:16:33 2009 New Revision: 5050 URL: http://www.opensync.org/changeset/5050 Log: change to new anchor API Modified: plugins/kdepim/src/datasource.cpp plugins/kdepim/src/kdepim_sync.cpp Modified: plugins/kdepim/src/datasource.cpp ============================================================================== --- plugins/kdepim/src/datasource.cpp Wed Jan 7 14:54:09 2009 (r5049) +++ plugins/kdepim/src/datasource.cpp Wed Jan 7 22:16:33 2009 (r5050) @@ -19,50 +19,50 @@ static void connect_wrapper(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); - OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); - obj->connect(info, ctx); - osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); + OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + obj->connect(info, ctx); + osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } //-------------------------------------------------------------------------------- static void disconnect_wrapper(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); - OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); - obj->disconnect(info, ctx); - osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); + OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + obj->disconnect(info, ctx); + osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } //-------------------------------------------------------------------------------- static void get_changes_wrapper(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); - OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); - obj->get_changes(info, ctx); - osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); + OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + obj->get_changes(info, ctx); + osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } //-------------------------------------------------------------------------------- static void commit_wrapper(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx, chg); - OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); - obj->commit(info, ctx, chg); - osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx, chg); + OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + obj->commit(info, ctx, chg); + osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } //-------------------------------------------------------------------------------- static void sync_done_wrapper(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); - OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); - obj->sync_done(info, ctx); - osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, userdata, info, ctx); + OSyncDataSource *obj = (OSyncDataSource *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + obj->sync_done(info, ctx); + osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } } // extern "C" @@ -72,97 +72,123 @@ bool OSyncDataSource::initialize(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error) { - osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, plugin, info); + osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, plugin, info); - OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); + OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); - if (sink == NULL) { - // this objtype is not enabled, but this is not an error - osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); - return true; - } - - OSyncObjTypeSinkFunctions functions; - memset(&functions, 0, sizeof(functions)); - functions.connect = connect_wrapper; - functions.disconnect = disconnect_wrapper; - functions.get_changes = get_changes_wrapper; - functions.commit = commit_wrapper; - functions.sync_done = sync_done_wrapper; - - osync_objtype_sink_set_functions(sink, functions, this); - - const char *configdir = osync_plugin_info_get_configdir(info); - QString tablepath = QString("%1/hashtable.db").arg(configdir); - hashtable = osync_hashtable_new(QFile::encodeName(tablepath), objtype, error); - if ( !hashtable ) { - osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(error)); - return false; - } - if ( !osync_hashtable_load(hashtable, error) ) - { - osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(error)); - return false; - } - - // NOTE: advanced options are per plugin; currently we read the FilterCategory - // for each Resource (later this could be separated by Resource via a different name, etc.) - // read advanced options - OSyncPluginConfig *config = osync_plugin_info_get_config(info); - if ( config ) - { - OSyncList *entry = osync_plugin_config_get_advancedoptions(config); - for (; entry; entry = entry->next) - { - OSyncPluginAdvancedOption *option = static_cast<OSyncPluginAdvancedOption*>(entry->data); - - if ( strcmp(osync_plugin_advancedoption_get_name(option), "FilterCategory") == 0 ) - categories.append(QString::fromUtf8(osync_plugin_advancedoption_get_value(option))); - } - } + if ( !sink ) + { + // this objtype is not enabled, but this is not an error + osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); + return true; + } + + OSyncObjTypeSinkFunctions functions; + memset(&functions, 0, sizeof(functions)); + functions.connect = connect_wrapper; + functions.disconnect = disconnect_wrapper; + functions.get_changes = get_changes_wrapper; + functions.commit = commit_wrapper; + functions.sync_done = sync_done_wrapper; + + osync_objtype_sink_set_functions(sink, functions, this); + + // Request an anchor from the framework. + osync_objtype_sink_enable_anchor(sink, TRUE); + + const char *configdir = osync_plugin_info_get_configdir(info); + QString tablepath = QString("%1/hashtable.db").arg(configdir); + hashtable = osync_hashtable_new(QFile::encodeName(tablepath), objtype, error); + if ( !hashtable ) { + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(error)); + return false; + } + if ( !osync_hashtable_load(hashtable, error) ) + { + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(error)); + return false; + } + + // NOTE: advanced options are per plugin; currently we read the FilterCategory + // for each Resource (later this could be separated by Resource via a different name, etc.) + // read advanced options + OSyncPluginConfig *config = osync_plugin_info_get_config(info); + if ( config ) + { + OSyncList *entry = osync_plugin_config_get_advancedoptions(config); + for (; entry; entry = entry->next) + { + OSyncPluginAdvancedOption *option = static_cast<OSyncPluginAdvancedOption*>(entry->data); + + if ( strcmp(osync_plugin_advancedoption_get_name(option), "FilterCategory") == 0 ) + categories.append(QString::fromUtf8(osync_plugin_advancedoption_get_value(option))); + } + } - osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); - return true; + osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); + return true; } //-------------------------------------------------------------------------------- void OSyncDataSource::connect(OSyncPluginInfo *info, OSyncContext *ctx) { - osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); - //Detection mechanismn if this is the first sync - QString anchorpath = QString("%1/anchor.db").arg(osync_plugin_info_get_configdir(info)); - if (!osync_anchor_compare(anchorpath, objtype, "true")) { - osync_trace(TRACE_INTERNAL, "Setting slow-sync for %s", objtype); - OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); - osync_objtype_sink_set_slowsync(sink, TRUE); - } - osync_context_report_success(ctx); + // Detection mechanismn if this is the first sync + OSyncError *error = NULL; + osync_bool anchormatch = FALSE; + + OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); + OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + + if ( !osync_anchor_compare(anchor, "true", &anchormatch, &error) ) + { + osync_context_report_osyncerror(ctx, error); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); + osync_error_unref(&error); + return; + } + + if ( !anchormatch ) + { + osync_trace(TRACE_INTERNAL, "Setting slow-sync for %s", objtype); + osync_objtype_sink_set_slowsync(sink, TRUE); + } + osync_context_report_success(ctx); - osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); + osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } //-------------------------------------------------------------------------------- void OSyncDataSource::sync_done(OSyncPluginInfo *info, OSyncContext *ctx) { - osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); - //Detection mechanismn if this is the first sync - QString anchorpath = QString("%1/anchor.db").arg(osync_plugin_info_get_configdir(info)); - osync_anchor_update(anchorpath, objtype, "true"); - osync_context_report_success(ctx); - - OSyncError *error = NULL; - if ( hashtable && !osync_hashtable_save(hashtable, &error) ) - { - osync_context_report_osyncerror(ctx, error); - osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); - osync_error_unref(&error); - } + // Detection mechanismn if this is the first sync + OSyncError *error = NULL; - osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); + OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); + OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + + if ( !osync_anchor_update(anchor, "true", &error) ) + { + osync_context_report_osyncerror(ctx, error); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); + osync_error_unref(&error); + return; + } + osync_context_report_success(ctx); + + if ( hashtable && !osync_hashtable_save(hashtable, &error) ) + { + osync_context_report_osyncerror(ctx, error); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); + osync_error_unref(&error); + } + + osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } //-------------------------------------------------------------------------------- @@ -170,125 +196,125 @@ bool OSyncDataSource::report_change(OSyncPluginInfo *info, OSyncContext *ctx, QString uid, QString data, QString hash, OSyncObjFormat *objformat) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %s, (data), (hash), %p)", __PRETTY_FUNCTION__, + osync_trace(TRACE_ENTRY, "%s(%p, %p, %s, (data), (hash), %p)", __PRETTY_FUNCTION__, info, ctx, static_cast<const char*>(uid.utf8()), objformat); - OSyncError *error = NULL; + OSyncError *error = NULL; - OSyncChange *change = osync_change_new(&error); - if (!change) - { - osync_context_report_osyncerror(ctx, error); - osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); - osync_error_unref(&error); - return false; - } - - // Use the hash table to check if the object needs to be reported - osync_change_set_uid(change, uid.utf8()); - osync_change_set_hash(change, hash.utf8()); - - OSyncChangeType changetype = osync_hashtable_get_changetype(hashtable, change); - osync_change_set_changetype(change, changetype); - - // Update change in hashtable ... otherwise it gets deleted! - osync_hashtable_update_change(hashtable, change); - - if ( changetype != OSYNC_CHANGE_TYPE_UNMODIFIED ) - { - char *data_str = strdup((const char *)data.utf8()); - - osync_trace(TRACE_SENSITIVE,"Data:\n%s", data_str); - - OSyncData *odata = osync_data_new(data_str, strlen(data_str), objformat, &error); - if (!odata) - { - osync_context_report_osyncerror(ctx, error); - osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); - osync_error_unref(&error); - osync_change_unref(change); - return false; - } - - osync_data_set_objtype(odata, objtype); - - osync_change_set_data(change, odata); - osync_data_unref(odata); - - osync_context_report_change(ctx, change); - osync_change_unref(change); - } + OSyncChange *change = osync_change_new(&error); + if (!change) + { + osync_context_report_osyncerror(ctx, error); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); + osync_error_unref(&error); + return false; + } + + // Use the hash table to check if the object needs to be reported + osync_change_set_uid(change, uid.utf8()); + osync_change_set_hash(change, hash.utf8()); + + OSyncChangeType changetype = osync_hashtable_get_changetype(hashtable, change); + osync_change_set_changetype(change, changetype); + + // Update change in hashtable ... otherwise it gets deleted! + osync_hashtable_update_change(hashtable, change); + + if ( changetype != OSYNC_CHANGE_TYPE_UNMODIFIED ) + { + char *data_str = strdup((const char *)data.utf8()); + + osync_trace(TRACE_SENSITIVE,"Data:\n%s", data_str); + + OSyncData *odata = osync_data_new(data_str, strlen(data_str), objformat, &error); + if (!odata) + { + osync_context_report_osyncerror(ctx, error); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); + osync_error_unref(&error); + osync_change_unref(change); + return false; + } + + osync_data_set_objtype(odata, objtype); + + osync_change_set_data(change, odata); + osync_data_unref(odata); + + osync_context_report_change(ctx, change); + osync_change_unref(change); + } - osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); - return true; + osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); + return true; } //-------------------------------------------------------------------------------- bool OSyncDataSource::report_deleted(OSyncPluginInfo *info, OSyncContext *ctx, OSyncObjFormat *objformat) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, info, ctx, objformat); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, info, ctx, objformat); - OSyncError *error = NULL; - OSyncList *u, *uids = osync_hashtable_get_deleted(hashtable); - OSyncChange *change = NULL; - - for (u=uids; u; u = u->next) { - char *uid = (char *) u->data; - osync_trace(TRACE_INTERNAL, "going to delete entry with uid: %s", uid); - - change = osync_change_new(&error); - if (!change) - goto error; - - osync_change_set_changetype(change, OSYNC_CHANGE_TYPE_DELETED); - osync_change_set_uid(change, uid); - - OSyncData *data = osync_data_new(NULL, 0, objformat, &error); - if (!data) - goto error_free_change; - - osync_data_set_objtype(data, objtype); - osync_change_set_data(change, data); - osync_data_unref(data); - - osync_context_report_change(ctx, change); - osync_hashtable_update_change(hashtable, change); - - osync_change_unref(change); - } - osync_list_free(uids); - osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); - return true; + OSyncError *error = NULL; + OSyncList *u, *uids = osync_hashtable_get_deleted(hashtable); + OSyncChange *change = NULL; + + for (u=uids; u; u = u->next) { + char *uid = (char *) u->data; + osync_trace(TRACE_INTERNAL, "going to delete entry with uid: %s", uid); + + change = osync_change_new(&error); + if (!change) + goto error; + + osync_change_set_changetype(change, OSYNC_CHANGE_TYPE_DELETED); + osync_change_set_uid(change, uid); + + OSyncData *data = osync_data_new(NULL, 0, objformat, &error); + if (!data) + goto error_free_change; + + osync_data_set_objtype(data, objtype); + osync_change_set_data(change, data); + osync_data_unref(data); + + osync_context_report_change(ctx, change); + osync_hashtable_update_change(hashtable, change); + + osync_change_unref(change); + } + osync_list_free(uids); + osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); + return true; error_free_change: - osync_change_unref(change); + osync_change_unref(change); error: - osync_context_report_osyncerror(ctx, error); - osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); - osync_error_unref(&error); - return false; + osync_context_report_osyncerror(ctx, error); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); + osync_error_unref(&error); + return false; } //-------------------------------------------------------------------------------- OSyncDataSource::~OSyncDataSource() { - if (hashtable) - osync_hashtable_unref(hashtable); + if (hashtable) + osync_hashtable_unref(hashtable); } //-------------------------------------------------------------------------------- bool OSyncDataSource::has_category(const QStringList &list) const { - if ( categories.isEmpty() ) return true; // no filter defined -> match all + if ( categories.isEmpty() ) return true; // no filter defined -> match all - for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it ) { - if ( categories.contains(*it) ) return true; - } - return false; // not found + for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it ) { + if ( categories.contains(*it) ) return true; + } + return false; // not found } //-------------------------------------------------------------------------------- Modified: plugins/kdepim/src/kdepim_sync.cpp ============================================================================== --- plugins/kdepim/src/kdepim_sync.cpp Wed Jan 7 14:54:09 2009 (r5049) +++ plugins/kdepim/src/kdepim_sync.cpp Wed Jan 7 22:16:33 2009 (r5050) @@ -144,7 +144,7 @@ /* Here we actually tell opensync which sinks are available. For this plugin, we * go through and enable all the sinks */ -osync_bool kde_discover(void *userdata, OSyncPluginInfo *info, OSyncError **error) +osync_bool kde_discover(OSyncPluginInfo *info, void *userdata, OSyncError **error) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, error); |
From: <dg...@su...> - 2009-01-07 13:54:40
|
Author: bricks Date: Wed Jan 7 14:54:09 2009 New Revision: 5049 URL: http://www.opensync.org/changeset/5049 Log: removed data pointer from osync_plugin_discover function Modified: trunk/opensync/client/opensync_client.c trunk/opensync/plugin/opensync_plugin.c trunk/opensync/plugin/opensync_plugin.h trunk/wrapper/opensync-plugin.i Modified: trunk/opensync/client/opensync_client.c ============================================================================== --- trunk/opensync/client/opensync_client.c Wed Jan 7 13:53:17 2009 (r5048) +++ trunk/opensync/client/opensync_client.c Wed Jan 7 14:54:09 2009 (r5049) @@ -837,7 +837,7 @@ osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, client, message, error); - if (!osync_plugin_discover(client->plugin, client->plugin_data, client->plugin_info, error)) + if (!osync_plugin_discover(client->plugin, client->plugin_info, error)) goto error; reply = osync_message_new_reply(message, error); Modified: trunk/opensync/plugin/opensync_plugin.c ============================================================================== --- trunk/opensync/plugin/opensync_plugin.c Wed Jan 7 13:53:17 2009 (r5048) +++ trunk/opensync/plugin/opensync_plugin.c Wed Jan 7 14:54:09 2009 (r5049) @@ -179,13 +179,13 @@ plugin->finalize(data); } -osync_bool osync_plugin_discover(OSyncPlugin *plugin, void *data, OSyncPluginInfo *info, OSyncError **error) +osync_bool osync_plugin_discover(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error) { osync_assert(plugin); if (!plugin->discover) return TRUE; - return plugin->discover(info, data, error); + return plugin->discover(info, plugin->plugin_data, error); } osync_bool osync_plugin_is_usable(OSyncPlugin *plugin, OSyncError **error) Modified: trunk/opensync/plugin/opensync_plugin.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin.h Wed Jan 7 13:53:17 2009 (r5048) +++ trunk/opensync/plugin/opensync_plugin.h Wed Jan 7 14:54:09 2009 (r5049) @@ -252,15 +252,15 @@ */ OSYNC_EXPORT void osync_plugin_finalize(OSyncPlugin *plugin, void *data); -/** @brief Call plugin discovery +/** @brief Call plugin discovery. + * osync_plugin_discover passes the plugin_data to the discovery function of the plugin. * * @param plugin Pointer to the plugin - * @param data Pointer to userdata which got returned by plugin initialize function * @param info Pointer to OSyncPluginInfo which describes the plugin * @param error Pointer to error-struct * @return TRUE on success, FALSE otherwise */ -OSYNC_EXPORT osync_bool osync_plugin_discover(OSyncPlugin *plugin, void *data, OSyncPluginInfo *info, OSyncError **error); +OSYNC_EXPORT osync_bool osync_plugin_discover(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error); /*@}*/ Modified: trunk/wrapper/opensync-plugin.i ============================================================================== --- trunk/wrapper/opensync-plugin.i Wed Jan 7 13:53:17 2009 (r5048) +++ trunk/wrapper/opensync-plugin.i Wed Jan 7 14:54:09 2009 (r5049) @@ -70,9 +70,9 @@ osync_plugin_finalize(self, data); } - void discover(void *data, PluginInfo *info) { + void discover(PluginInfo *info, void *data) { Error *err = NULL; - bool ret = osync_plugin_discover(self, data, info, &err); + bool ret = osync_plugin_discover(self, info, &err); if (!raise_exception_on_error(err) && !ret) wrapper_exception("osync_plugin_discover failed but did not set error code"); } |
From: <dg...@su...> - 2009-01-07 13:31:28
|
Author: bellmich Date: Wed Jan 7 14:31:00 2009 New Revision: 890 URL: http://libsyncml.opensync.org/changeset/890 Log: prepare libsyncml 0.5.1 release Modified: trunk/CMakeLists.txt Modified: trunk/CMakeLists.txt ============================================================================== --- trunk/CMakeLists.txt Wed Jan 7 13:50:23 2009 (r889) +++ trunk/CMakeLists.txt Wed Jan 7 14:31:00 2009 (r890) @@ -2,13 +2,13 @@ SET( LIBSYNCML_VERSION_MAJOR "0" ) SET( LIBSYNCML_VERSION_MINOR "5" ) -SET( LIBSYNCML_VERSION_PATCH "0" ) +SET( LIBSYNCML_VERSION_PATCH "1" ) SET( LIBSYNCML_VERSION "${LIBSYNCML_VERSION_MAJOR}.${LIBSYNCML_VERSION_MINOR}.${LIBSYNCML_VERSION_PATCH}" ) # The most recent interface number that this library implements. #UPDATE: If any interface have been added, removed or changed since #UPDATE: the last update increment CURRENT. -SET( LIBSYNCML_LIBVERSION_CURRENT 3 ) +SET( LIBSYNCML_LIBVERSION_CURRENT 4 ) # The implementation number of the CURRENT interface. # UPDATE: Increment only if the library code has changed at all, since @@ -22,7 +22,7 @@ # UPDATE: release, then increment. # UPDATE: If any interface have been removed since the last release # UPDATE: reset to 0. -SET( LIBSYNCML_LIBVERSION_AGE 1 ) +SET( LIBSYNCML_LIBVERSION_AGE 2 ) # The range of implemention CURRENT - AGE is the SOVERSION MATH( EXPR LIBSYNCML_LIBVERSION_SOVERSION "${LIBSYNCML_LIBVERSION_CURRENT} - ${LIBSYNCML_LIBVERSION_AGE}" ) |
From: <dg...@su...> - 2009-01-07 12:53:47
|
Author: henrik Date: Wed Jan 7 13:53:17 2009 New Revision: 5048 URL: http://www.opensync.org/changeset/5048 Log: Added a few testcases for Mozilla Calendar Added: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_add.sh (contents, props changed) plugins/mozilla-sync/trunk/tests/blackbox_test_cal_delete.sh (contents, props changed) plugins/mozilla-sync/trunk/tests/blackbox_test_cal_fmod.sh (contents, props changed) plugins/mozilla-sync/trunk/tests/blackbox_test_cal_vevent_additional/ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_vevent_additional/add1 Modified: plugins/mozilla-sync/trunk/tests/CMakeLists.txt plugins/mozilla-sync/trunk/tests/blackbox_test_cal_slow3.sh Modified: plugins/mozilla-sync/trunk/tests/CMakeLists.txt ============================================================================== --- plugins/mozilla-sync/trunk/tests/CMakeLists.txt Wed Jan 7 10:20:16 2009 (r5047) +++ plugins/mozilla-sync/trunk/tests/CMakeLists.txt Wed Jan 7 13:53:17 2009 (r5048) @@ -35,6 +35,9 @@ CONFIGURE_FILE( "blackbox_test_cal_slow_slow.sh" "tests/blackbox_test_cal_slow_slow.sh" COPYONLY) CONFIGURE_FILE( "blackbox_test_cal_slow3.sh" "tests/blackbox_test_cal_slow3.sh" COPYONLY) CONFIGURE_FILE( "blackbox_test_cal_slow_fast.sh" "tests/blackbox_test_cal_slow_fast.sh" COPYONLY) +CONFIGURE_FILE( "blackbox_test_cal_add.sh" "tests/blackbox_test_cal_add.sh" COPYONLY) +CONFIGURE_FILE( "blackbox_test_cal_delete.sh" "tests/blackbox_test_cal_delete.sh" COPYONLY) +CONFIGURE_FILE( "blackbox_test_cal_fmod.sh" "tests/blackbox_test_cal_fmod.sh" COPYONLY) CONFIGURE_FILE( "abook.mab" "tests/abook.mab" COPYONLY) CONFIGURE_FILE( "blackbox_test_abook_vcard_additional/add1" "tests/blackbox_test_abook_vcard_additional/add1" COPYONLY) @@ -45,6 +48,7 @@ CONFIGURE_FILE( "storage.sdb_${CALENDAR_VERSION}" "tests/storage.sdb" COPYONLY) CONFIGURE_FILE( "blackbox_test_cal_vcard_base/1" "tests/blackbox_test_cal_vcard_base/1" COPYONLY) CONFIGURE_FILE( "blackbox_test_cal_vcard_base/2" "tests/blackbox_test_cal_vcard_base/2" COPYONLY) +CONFIGURE_FILE( "blackbox_test_cal_vevent_additional/add1" "tests/blackbox_test_cal_vevent_additional/add1" COPYONLY) ADD_TEST( blackbox_test_init_thunderbird "blackbox_test_init_thunderbird.sh" ) ADD_TEST( blackbox_test_init_osynctool "blackbox_test_init_osynctool.sh" ) @@ -59,3 +63,6 @@ ADD_TEST( blackbox_test_cal_slow_slow "blackbox_test_cal_slow_slow.sh" ) ADD_TEST( blackbox_test_cal_slow3 "blackbox_test_cal_slow3.sh" ) ADD_TEST( blackbox_test_cal_slow_fast "blackbox_test_cal_slow_fast.sh" ) +ADD_TEST( blackbox_test_cal_add "blackbox_test_cal_add.sh" ) +ADD_TEST( blackbox_test_cal_delete "blackbox_test_cal_delete.sh" ) +ADD_TEST( blackbox_test_cal_fmod "blackbox_test_cal_fmod.sh" ) Added: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_add.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_add.sh Wed Jan 7 13:53:17 2009 (r5048) @@ -0,0 +1,47 @@ +#!/bin/bash + +# ====================================================== +# This file is part of the mozilla-sync plugin for OpenSync +# See http://www.KaarPoSoft.dk/bluezync +# $Id$ +# ====================================================== + +# Test addtion of VEVENT + +SCRIPT_NAME=`basename $0`; SCRIPT_NAME=${SCRIPT_NAME%.sh} +SRC_DIR=`(cd \`dirname $0\`; pwd)` +source "${SRC_DIR}/blackbox_test_common.shinc" + +initialize_test "Add event" +initialize_sunbird +initialize_osynctool + +VEVENT_DIR_BASE="${SRC_DIR}/blackbox_test_cal_vcard_base" +VEVENT_DIR_ADDITIONAL="${SRC_DIR}/blackbox_test_cal_vevent_additional" + +# Create a directory with VEVENTs +# Slow sync it into Sunbird +banner_step "First slow sync" +GROUP_NAME_1="${SCRIPT_NAME}_slow1" +copy_dir VEVENT_DIR_1 vcard_orig "${VEVENT_DIR_BASE}" +create_msync_group_cal_file "${GROUP_NAME_1}" 1 "${VEVENT_DIR_1}" +msync_sync "${GROUP_NAME_1}" + +# Add a VEVENT +# Fast sync it into Sunbird +banner_step "Fast sync after add" +cp "${VEVENT_DIR_ADDITIONAL}"/* "${VEVENT_DIR_1}" +copy_dir VEVENT_DIR_A vcard_orig_added "${VEVENT_DIR_BASE}" +cp "${VEVENT_DIR_ADDITIONAL}"/* "${VEVENT_DIR_A}" +msync_sync "${GROUP_NAME_1}" + +# Slow sync Sunbird to a new VEVENT directory in a new group +# And verify that the contents have the new VEVENT added +banner_step "Compare calendar after add" +GROUP_NAME_1C="${SCRIPT_NAME}_compare1" +make_temp_dir VEVENT_DIR_1C compare1 +create_msync_group_cal_file "${GROUP_NAME_1C}" 1 "${VEVENT_DIR_1C}" +msync_sync "${GROUP_NAME_1C}" +compare_vcard_dirs "${VEVENT_DIR_A}" "${VEVENT_DIR_1C}" + +success_exit Added: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_delete.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_delete.sh Wed Jan 7 13:53:17 2009 (r5048) @@ -0,0 +1,47 @@ +#!/bin/bash + +# ====================================================== +# This file is part of the mozilla-sync plugin for OpenSync +# See http://www.KaarPoSoft.dk/bluezync +# $Id$ +# ====================================================== + +# Test deletion of VCard + +SCRIPT_NAME=`basename $0`; SCRIPT_NAME=${SCRIPT_NAME%.sh} +SRC_DIR=`(cd \`dirname $0\`; pwd)` +source "${SRC_DIR}/blackbox_test_common.shinc" + +initialize_test "Delete event" +initialize_sunbird +initialize_osynctool + +VEVENT_DIR_BASE="${SRC_DIR}/blackbox_test_cal_vcard_base" + +# Create a directory with events +# Slow sync it into Sunbird +banner_step "First slow sync" +GROUP_NAME_1="${SCRIPT_NAME}_slow1" +copy_dir VEVENT_DIR_1 vevent_orig "${VEVENT_DIR_BASE}" +create_msync_group_cal_file "${GROUP_NAME_1}" 1 "${VEVENT_DIR_1}" +msync_sync "${GROUP_NAME_1}" + +# Delete a VEVENT +# Fast sync it into Thunderbird +banner_step "Fast sync after delete" +rm "${VEVENT_DIR_1}/1" +copy_dir VEVENT_DIR_D vevent_orig_deleted "${VEVENT_DIR_BASE}" +rm "${VEVENT_DIR_D}/1" +msync_sync "${GROUP_NAME_1}" + +# Slow sync Sunbird to a new VEVENT directory in a new group +# And verify that the contents have the VEVENT deleted +banner_step "Compare calendar after delete" +GROUP_NAME_1C="${SCRIPT_NAME}_compare1" +make_temp_dir VEVENT_DIR_1C compare1 +create_msync_group_cal_file "${GROUP_NAME_1C}" 1 "${VEVENT_DIR_1C}" +msync_sync "${GROUP_NAME_1C}" +compare_vcard_dirs "${VEVENT_DIR_D}" "${VEVENT_DIR_1C}" + +success_exit + Added: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_fmod.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_fmod.sh Wed Jan 7 13:53:17 2009 (r5048) @@ -0,0 +1,46 @@ +#!/bin/bash + +# ====================================================== +# This file is part of the mozilla-sync plugin for OpenSync +# See http://www.KaarPoSoft.dk/bluezync +# $Id$ +# ====================================================== + +# Test modification of VEVENT + +SCRIPT_NAME=`basename $0`; SCRIPT_NAME=${SCRIPT_NAME%.sh} +SRC_DIR=`(cd \`dirname $0\`; pwd)` +source "${SRC_DIR}/blackbox_test_common.shinc" + +initialize_test "Modify VEVENT" +initialize_sunbird +initialize_osynctool + +VEVENT_DIR_BASE="${SRC_DIR}/blackbox_test_cal_vcard_base" + +# Create a directory with VEVENTS +# Slow sync it into Sunbird +banner_step "First slow sync" +GROUP_NAME_1="${SCRIPT_NAME}_slow1" +copy_dir VEVENT_DIR_1 vcard_orig "${VEVENT_DIR_BASE}" +create_msync_group_cal_file "${GROUP_NAME_1}" 1 "${VEVENT_DIR_1}" +msync_sync "${GROUP_NAME_1}" + +# Modify a VEVENT +# Fast sync it into Sunbird +banner_step "Fast sync after add" +sed -i s/Location/New\ location/ "${VEVENT_DIR_1}/1" +msync_sync "${GROUP_NAME_1}" + +# Slow sync Sunbird to a new VEVENT directory in a new group +# And verify that the contents have the new VEVENT modified +banner_step "Compare VEVENT add" +GROUP_NAME_1C="${SCRIPT_NAME}_compare1" +make_temp_dir VEVENT_DIR_1C compare1 +create_msync_group_cal_file "${GROUP_NAME_1C}" 1 "${VEVENT_DIR_1C}" +msync_sync "${GROUP_NAME_1C}" +copy_dir VEVENT_DIR_A vevent_orig_for_compare "${VEVENT_DIR_BASE}" +sed -i s/Location/New\ location/ "${VEVENT_DIR_A}/1" +compare_vcard_dirs "${VEVENT_DIR_A}" "${VEVENT_DIR_1C}" + +success_exit Modified: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_slow3.sh ============================================================================== --- plugins/mozilla-sync/trunk/tests/blackbox_test_cal_slow3.sh Wed Jan 7 10:20:16 2009 (r5047) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_slow3.sh Wed Jan 7 13:53:17 2009 (r5048) @@ -22,7 +22,7 @@ # Slow sync it into Thunderbird banner_step "First Calendar slow sync" GROUP_NAME_1="${SCRIPT_NAME}_slow1" -copy_dir VCARD_DIR_1 vcard_orig "${VCARD_DIR_BASE}" +copy_dir VCARD_DIR_1 vevent_orig "${VCARD_DIR_BASE}" create_msync_group_cal_file "${GROUP_NAME_1}" 1 "${VCARD_DIR_1}" msync_sync "${GROUP_NAME_1}" @@ -42,7 +42,7 @@ # Now do a second slow sync to see that this works banner_step "Second slow sync" GROUP_NAME_2="${SCRIPT_NAME}_slow2" -copy_dir VCARD_DIR_2 vcard_orig "${VCARD_DIR_BASE}" +copy_dir VCARD_DIR_2 vevent_orig "${VCARD_DIR_BASE}" create_msync_group_cal_file "${GROUP_NAME_2}" 1 "${VCARD_DIR_2}" msync_sync "${GROUP_NAME_2}" Added: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_vevent_additional/add1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_vevent_additional/add1 Wed Jan 7 13:53:17 2009 (r5048) @@ -0,0 +1,13 @@ +BEGIN:VCALENDAR +PRODID:-//OpenSync//NONSGML OpenSync vformat 0.3//EN +VERSION:1.0 +BEGIN:VEVENT +DCREATED:20081030T105604Z +DTEND:20081030T170000 +DTSTART:20081030T180000 +DESCRIPTION:Description of Additional Event. +LAST-MODIFIED:20081031T105611Z +LOCATION:Location of Additional Event 1 +SUMMARY:Title of Additional Event 1 +END:VEVENT +END:VCALENDAR |
From: <dg...@su...> - 2009-01-07 12:51:03
|
Author: bellmich Date: Wed Jan 7 13:50:23 2009 New Revision: 889 URL: http://libsyncml.opensync.org/changeset/889 Log: prepare new and much easier Valgrind 3.4.x suppressions Modified: trunk/tests/valgrind.supp Modified: trunk/tests/valgrind.supp ============================================================================== --- trunk/tests/valgrind.supp Wed Jan 7 13:49:49 2009 (r888) +++ trunk/tests/valgrind.supp Wed Jan 7 13:50:23 2009 (r889) @@ -107,6 +107,15 @@ # g_thread_init +# Valgrind 3.4.0 or higher +#{ +# g_thread_init +# Memcheck:Leak +# fun:malloc +# ... +# fun:g_thread_init +#} + { g_thread_init - 1 Memcheck:Leak @@ -141,6 +150,15 @@ # g_type_init +# Valgrind 3.4.0 or higher +#{ +# g_type_init +# Memcheck:Leak +# fun:malloc +# ... +# fun:g_type_init +#} + { g_type_init - 1 Memcheck:Leak |
From: <dg...@su...> - 2009-01-07 12:50:14
|
Author: bellmich Date: Wed Jan 7 13:49:49 2009 New Revision: 888 URL: http://libsyncml.opensync.org/changeset/888 Log: added G_DEBUG=gc-friendly according to the recommendation in the glib documentation Modified: trunk/tests/support.c Modified: trunk/tests/support.c ============================================================================== --- trunk/tests/support.c Wed Jan 7 13:45:28 2009 (r887) +++ trunk/tests/support.c Wed Jan 7 13:49:49 2009 (r888) @@ -39,6 +39,8 @@ */ if (!g_setenv("G_SLICE", "always-malloc", FALSE)) g_warning("G_SLICE is already set."); + if (!g_setenv("G_DEBUG", "gc-friendly", FALSE)) + g_warning("G_DEBUG is already set."); /* The check library usually forks test suites to safely survive * things like segmentation faults and to have a clean separated |
From: <dg...@su...> - 2009-01-07 12:46:04
|
Author: bellmich Date: Wed Jan 7 13:45:28 2009 New Revision: 887 URL: http://libsyncml.opensync.org/changeset/887 Log: update release instructions Modified: trunk/RELEASE Modified: trunk/RELEASE ============================================================================== --- trunk/RELEASE Tue Jan 6 10:32:11 2009 (r886) +++ trunk/RELEASE Wed Jan 7 13:45:28 2009 (r887) @@ -32,13 +32,28 @@ - if someone else made changes and the commit fails, you have to "svn up" and run the tests again - - once the commit succeeds, "svn cp trunk tags/libsyncml-$MAJOR.$MINJOR.$PATCH" + - once the commit succeeds, you have to create a new tag with + "mkdir tags/libwbxml-$MAJOR.$MINJOR.$PATCH", + "tar -C trunk --exclude=\"\\.svn\" -cf - . | tar -C tags/libwbxml-$MAJOR.$MINJOR.$PATCH -xf -" + "svn add tags/libwbxml-$MAJOR.$MINJOR.$PATCH" and + "svn commit tags/libwbxml-$MAJOR.$MINJOR.$PATCH" + (NEVER use "svn cp" because you must replace the external entities + of the trunk directory with hard copies of the actual state.) - create tarballs with "cmake $SOURCES; make package_source" (out of source build!) - - upload the tarball to releases. make sure the version numbers are the same! + - write checksums with md5sum from the tarballs to a file with the + same name like the tarballs without the tar and compression suffixes + and plus a new suffix md5sum + Example: + md5sum libsyncml-0.5.0.tar.* > libsyncml-0.5.0.md5sum + md5sum -c libsyncml-0.5.0.md5sum + + - upload the tarballs and the checksum file to releases. + make sure the version numbers are the same! - Annouce the release on the mailing list Tips: * make diff of the exported symbols "nm -g -P libsyncml.so" * read svn log + * check trac tickets which are attached to the according milestone |
From: <dg...@su...> - 2009-01-07 09:20:46
|
Author: henrik Date: Wed Jan 7 10:20:16 2009 New Revision: 5047 URL: http://www.opensync.org/changeset/5047 Log: If two VCard directories do not compare as equal, make sure to return failure code from test script Modified: plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in Modified: plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in ============================================================================== --- plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in Tue Jan 6 19:10:40 2009 (r5046) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in Wed Jan 7 10:20:16 2009 (r5047) @@ -515,7 +515,7 @@ cat "$D" done echo "------------------------------------------------------------" - error_exit "Result of [${STEP}] did not compare as equal" $? "${ERROR_MESSAGE}" + error_exit "Result of [${STEP}] did not compare as equal" -1 "${ERROR_MESSAGE}" fi } |
From: <dg...@su...> - 2009-01-06 18:11:02
|
Author: henrik Date: Tue Jan 6 19:10:40 2009 New Revision: 5046 URL: http://www.opensync.org/changeset/5046 Log: Corrected case: NickName -> Nickname Modified: plugins/mozilla-sync/trunk/src/thunderbird-card.cpp Modified: plugins/mozilla-sync/trunk/src/thunderbird-card.cpp ============================================================================== --- plugins/mozilla-sync/trunk/src/thunderbird-card.cpp Tue Jan 6 19:04:29 2009 (r5045) +++ plugins/mozilla-sync/trunk/src/thunderbird-card.cpp Tue Jan 6 19:10:40 2009 (r5046) @@ -135,7 +135,7 @@ { "FirstName", "FirstName"}, { NULL } } }, - {"NickName", { + {"Nickname", { {"Content", "NickName" }, { NULL } } }, |
From: <dg...@su...> - 2009-01-06 18:04:53
|
Author: henrik Date: Tue Jan 6 19:04:29 2009 New Revision: 5045 URL: http://www.opensync.org/changeset/5045 Log: Added test cases for three slow syncs Added: plugins/mozilla-sync/trunk/tests/blackbox_test_abook_slow3.sh (contents, props changed) plugins/mozilla-sync/trunk/tests/blackbox_test_cal_slow3.sh (contents, props changed) Modified: plugins/mozilla-sync/trunk/tests/CMakeLists.txt Modified: plugins/mozilla-sync/trunk/tests/CMakeLists.txt ============================================================================== --- plugins/mozilla-sync/trunk/tests/CMakeLists.txt Tue Jan 6 17:08:42 2009 (r5044) +++ plugins/mozilla-sync/trunk/tests/CMakeLists.txt Tue Jan 6 19:04:29 2009 (r5045) @@ -25,6 +25,7 @@ CONFIGURE_FILE( "blackbox_test_init_osynctool.sh" "tests/blackbox_test_init_osynctool.sh" COPYONLY) CONFIGURE_FILE( "blackbox_test_abook_vcard_compare.sh" "tests/blackbox_test_abook_vcard_compare.sh" COPYONLY) CONFIGURE_FILE( "blackbox_test_abook_slow_slow.sh" "tests/blackbox_test_abook_slow_slow.sh" COPYONLY) +CONFIGURE_FILE( "blackbox_test_abook_slow3.sh" "tests/blackbox_test_abook_slow3.sh" COPYONLY) CONFIGURE_FILE( "blackbox_test_abook_slow_fast.sh" "tests/blackbox_test_abook_slow_fast.sh" COPYONLY) CONFIGURE_FILE( "blackbox_test_abook_add.sh" "tests/blackbox_test_abook_add.sh" COPYONLY) CONFIGURE_FILE( "blackbox_test_abook_delete.sh" "tests/blackbox_test_abook_delete.sh" COPYONLY) @@ -32,6 +33,7 @@ CONFIGURE_FILE( "blackbox_test_init_sunbird.sh" "tests/blackbox_test_init_sunbird.sh" COPYONLY) CONFIGURE_FILE( "blackbox_test_cal_slow_slow.sh" "tests/blackbox_test_cal_slow_slow.sh" COPYONLY) +CONFIGURE_FILE( "blackbox_test_cal_slow3.sh" "tests/blackbox_test_cal_slow3.sh" COPYONLY) CONFIGURE_FILE( "blackbox_test_cal_slow_fast.sh" "tests/blackbox_test_cal_slow_fast.sh" COPYONLY) CONFIGURE_FILE( "abook.mab" "tests/abook.mab" COPYONLY) @@ -48,10 +50,12 @@ ADD_TEST( blackbox_test_init_osynctool "blackbox_test_init_osynctool.sh" ) ADD_TEST( blackbox_test_abook_vcard_compare "blackbox_test_abook_vcard_compare.sh" ) ADD_TEST( blackbox_test_abook_slow_slow "blackbox_test_abook_slow_slow.sh" ) +ADD_TEST( blackbox_test_abook_slow3 "blackbox_test_abook_slow3.sh" ) ADD_TEST( blackbox_test_abook_slow_fast "blackbox_test_abook_slow_fast.sh" ) ADD_TEST( blackbox_test_abook_add "blackbox_test_abook_add.sh" ) ADD_TEST( blackbox_test_abook_delete "blackbox_test_abook_delete.sh" ) ADD_TEST( blackbox_test_abook_fmod "blackbox_test_abook_fmod.sh" ) ADD_TEST( blackbox_test_init_sunbird "blackbox_test_init_sunbird.sh" ) ADD_TEST( blackbox_test_cal_slow_slow "blackbox_test_cal_slow_slow.sh" ) +ADD_TEST( blackbox_test_cal_slow3 "blackbox_test_cal_slow3.sh" ) ADD_TEST( blackbox_test_cal_slow_fast "blackbox_test_cal_slow_fast.sh" ) Added: plugins/mozilla-sync/trunk/tests/blackbox_test_abook_slow3.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_abook_slow3.sh Tue Jan 6 19:04:29 2009 (r5045) @@ -0,0 +1,69 @@ +#!/bin/bash + +# ====================================================== +# This file is part of the mozilla-sync plugin for OpenSync +# See http://www.KaarPoSoft.dk/bluezync +# $Id$ +# ====================================================== + +# Test slow sync followed by TWO slow syncs + +SCRIPT_NAME=`basename $0`; SCRIPT_NAME=${SCRIPT_NAME%.sh} +SRC_DIR=`(cd \`dirname $0\`; pwd)` +source "${SRC_DIR}/blackbox_test_common.shinc" + +initialize_test "Three slow syncs" +initialize_thunderbird +initialize_osynctool + +VCARD_DIR_BASE="${SRC_DIR}/blackbox_test_abook_vcard_base" + +# Create a directory with VCard addresses +# Slow sync it into Thunderbird +banner_step "First slow sync" +GROUP_NAME_1="${SCRIPT_NAME}_slow1" +copy_dir VCARD_DIR_1 vcard_orig "${VCARD_DIR_BASE}" +create_msync_group_abook_file "${GROUP_NAME_1}" abook.mab "${VCARD_DIR_1}" +msync_sync "${GROUP_NAME_1}" + +# Verify that the sync did not change the VCard directory +banner_step "Compare vcards for first slow sync" +compare_vcard_dirs "${VCARD_DIR_BASE}" "${VCARD_DIR_1}" + +# Slow sync Thunderbird to a new VCard directory in a new group +# And verify that the contents are the same as in the initial VCard directory +banner_step "Compare addressbook for first slow sync" +GROUP_NAME_1C="${SCRIPT_NAME}_compare1" +make_temp_dir VCARD_DIR_1C compare1 +create_msync_group_abook_file "${GROUP_NAME_1C}" abook.mab "${VCARD_DIR_1C}" +msync_sync "${GROUP_NAME_1C}" +compare_vcard_dirs "${VCARD_DIR_1}" "${VCARD_DIR_1C}" + +# Now do a second slow sync to see that this works +banner_step "Second slow sync" +GROUP_NAME_2="${SCRIPT_NAME}_slow2" +copy_dir VCARD_DIR_2 vcard_orig "${VCARD_DIR_BASE}" +create_msync_group_abook_file "${GROUP_NAME_2}" abook.mab "${VCARD_DIR_2}" +msync_sync "${GROUP_NAME_2}" + +# Verify that the second slow sync did not change the VCard directory +banner_step "Compare vcards for second slow sync" +compare_vcard_dirs "${VCARD_DIR_BASE}" "${VCARD_DIR_2}" + +# Slow sync Thunderbird to a new VCard directory in a new group +# And verify that the contents are the same as in the initial VCard directory +banner_step "Compare addressbook for second slow sync" +GROUP_NAME_2C="${SCRIPT_NAME}_compare2" +make_temp_dir VCARD_DIR_2C compare2 +create_msync_group_abook_file "${GROUP_NAME_2C}" abook.mab "${VCARD_DIR_2C}" +msync_sync "${GROUP_NAME_2C}" +compare_vcard_dirs "${VCARD_DIR_2}" "${VCARD_DIR_2C}" + +# Slow sync again to same dir, and make sure that the contents are not changed +banner_step "Compare third slow sync" +GROUP_NAME_3="${SCRIPT_NAME}_compare3" +create_msync_group_abook_file "${GROUP_NAME_3}" abook.mab "${VCARD_DIR_2C}" +msync_sync "${GROUP_NAME_3}" +compare_vcard_dirs "${VCARD_DIR_2}" "${VCARD_DIR_2C}" + +success_exit Added: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_slow3.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_slow3.sh Tue Jan 6 19:04:29 2009 (r5045) @@ -0,0 +1,69 @@ +#!/bin/bash + +# ====================================================== +# This file is part of the mozilla-sync plugin for OpenSync +# See http://www.KaarPoSoft.dk/bluezync +# $Id$ +# ====================================================== + +# Test slow sync followed by TWO slow syncs + +SCRIPT_NAME=`basename $0`; SCRIPT_NAME=${SCRIPT_NAME%.sh} +SRC_DIR=`(cd \`dirname $0\`; pwd)` +source "${SRC_DIR}/blackbox_test_common.shinc" + +initialize_test "Three Calendar slow syncs" +initialize_sunbird +initialize_osynctool + +VCARD_DIR_BASE="${SRC_DIR}/blackbox_test_cal_vcard_base" + +# Create a directory with VCard events +# Slow sync it into Thunderbird +banner_step "First Calendar slow sync" +GROUP_NAME_1="${SCRIPT_NAME}_slow1" +copy_dir VCARD_DIR_1 vcard_orig "${VCARD_DIR_BASE}" +create_msync_group_cal_file "${GROUP_NAME_1}" 1 "${VCARD_DIR_1}" +msync_sync "${GROUP_NAME_1}" + +# Verify that the sync did not change the VCard directory +banner_step "Compare vcards for first slow sync" +compare_vcard_dirs "${VCARD_DIR_BASE}" "${VCARD_DIR_1}" + +# Slow sync Thunderbird to a new VCard directory in a new group +# And verify that the contents are the same as in the initial VCard directory +banner_step "Compare calendar for first slow sync" +GROUP_NAME_1C="${SCRIPT_NAME}_compare1" +make_temp_dir VCARD_DIR_1C compare1 +create_msync_group_cal_file "${GROUP_NAME_1C}" 1 "${VCARD_DIR_1C}" +msync_sync "${GROUP_NAME_1C}" +compare_vcard_dirs "${VCARD_DIR_1}" "${VCARD_DIR_1C}" + +# Now do a second slow sync to see that this works +banner_step "Second slow sync" +GROUP_NAME_2="${SCRIPT_NAME}_slow2" +copy_dir VCARD_DIR_2 vcard_orig "${VCARD_DIR_BASE}" +create_msync_group_cal_file "${GROUP_NAME_2}" 1 "${VCARD_DIR_2}" +msync_sync "${GROUP_NAME_2}" + +# Verify that the second slow sync did not change the VCard directory +banner_step "Compare vcards for second slow sync" +compare_vcard_dirs "${VCARD_DIR_BASE}" "${VCARD_DIR_2}" + +# Slow sync Thunderbird to a new VCard directory in a new group +# And verify that the contents are the same as in the initial VCard directory +banner_step "Compare calendar for second slow sync" +GROUP_NAME_2C="${SCRIPT_NAME}_compare2" +make_temp_dir VCARD_DIR_2C compare2 +create_msync_group_cal_file "${GROUP_NAME_2C}" 1 "${VCARD_DIR_2C}" +msync_sync "${GROUP_NAME_2C}" +compare_vcard_dirs "${VCARD_DIR_2}" "${VCARD_DIR_2C}" + +# Slow sync again to same dir, and make sure that the contents are not changed +banner_step "Compare third slow sync" +GROUP_NAME_3="${SCRIPT_NAME}_compare3" +create_msync_group_cal_file "${GROUP_NAME_3}" 1 "${VCARD_DIR_2C}" +msync_sync "${GROUP_NAME_3}" +compare_vcard_dirs "${VCARD_DIR_2}" "${VCARD_DIR_2C}" + +success_exit |
From: <dg...@su...> - 2009-01-06 16:09:04
|
Author: henrik Date: Tue Jan 6 17:08:42 2009 New Revision: 5044 URL: http://www.opensync.org/changeset/5044 Log: Update to match latest OpenSync API changes (now compatible with -r5043): new anchor API, osync_plugin_set_useable_timeout not supported anymore; changed parameter list for discover function Modified: plugins/mozilla-sync/trunk/src/mozilla-sync.cpp Modified: plugins/mozilla-sync/trunk/src/mozilla-sync.cpp ============================================================================== --- plugins/mozilla-sync/trunk/src/mozilla-sync.cpp Tue Jan 6 15:05:53 2009 (r5043) +++ plugins/mozilla-sync/trunk/src/mozilla-sync.cpp Tue Jan 6 17:08:42 2009 (r5044) @@ -756,14 +756,15 @@ OSyncObjTypeSink *sink = osync_plugin_info_get_sink(pOSyncPluginInfo); OSyncMozillaDatabase *db = (OSyncMozillaDatabase*) osync_objtype_sink_get_userdata(sink); + OSyncError *error = NULL; - // TODO: / as directory separator is not portable - char *anchorpath = g_strdup_printf("%s" G_DIR_SEPARATOR_S "anchor.db", osync_plugin_info_get_configdir(pOSyncPluginInfo)); - LOG(10, "Updating anchor database [%s] key [%s] to value [%s]", anchorpath, db->szAnchorKey, db->szAnchorValue); - osync_anchor_update(anchorpath, db->szAnchorKey, db->szAnchorValue); - g_free(anchorpath); + LOG(10, "Updating anchor to value [%s]", db->szAnchorValue); + OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + if (!osync_anchor_update(anchor, db->szAnchorValue, &error)) { + osync_context_report_osyncerror(pOSyncContext, error); + LOG_EXIT_ERROR_OSYNC_SZ(10, &error, "Could not do osync_anchor_update"); + return; } - OSyncError *error = NULL; LOG(10, "Updating hash table"); if (!osync_hashtable_save(db->pOSyncHashTable, &error)) { osync_context_report_osyncerror(pOSyncContext, error); @@ -818,15 +819,20 @@ LOG_EXIT_ERROR_OSYNC_SZ(10, &error, "Could not load osync_hashtable_load"); return; } - char *anchorpath = g_strdup_printf("%s" G_DIR_SEPARATOR_S "anchor.db", osync_plugin_info_get_configdir(pOSyncPluginInfo)); - LOG(10, "Anchor database [%s] key [%s] value [%s]", anchorpath, db->szAnchorKey, db->szAnchorValue); - if (osync_anchor_compare(anchorpath, db->szAnchorKey, db->szAnchorValue)) { - LOG(10, "Found key with value; so do not force slow sync"); + + OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + osync_bool same; + if (!osync_anchor_compare(anchor, db->szAnchorValue, &same, &error)) { + osync_context_report_osyncerror(pOSyncContext, error); + LOG_EXIT_ERROR_OSYNC_SZ(10, &error, "Could not do osync_anchor_compare"); + return; } + + if (same) { + LOG(10, "Anchor matches; so do not force slow sync"); } else { - LOG(10, "Did not find key with value; so force slow sync"); + LOG(10, "Anchor does not match; so force slow sync"); osync_objtype_sink_set_slowsync(db->pOSyncObjTypeSink, TRUE); } - g_free(anchorpath); LOG(10, "Initializing Mozilla"); gboolean f; @@ -923,7 +929,7 @@ @param pOSyncPluginInfo On entry we have what we gave in get_sync_info. @param ppOSyncError Fill out in case of error **/ -static osync_bool mozilla_sync_discover(void *data, OSyncPluginInfo *pOSyncPluginInfo, OSyncError **ppOSyncError) +static osync_bool mozilla_sync_discover(OSyncPluginInfo *pOSyncPluginInfo, void *data, OSyncError **ppOSyncError) { LOG_ENTRY(10, "(%p, %p, %p)", data, pOSyncPluginInfo, ppOSyncError); @@ -995,7 +1001,7 @@ f=mozilla_config_check( &(pOSyncMozillaEnv->mozillaConfig), &szError, &logFunction); if (!f) { LOG_EXIT_ERROR_SZ(10, szError); return NULL; } - osync_plugin_set_useable_timeout(pOSyncPlugin, 5*60); // 5 minutes + osync_plugin_set_initialize_timeout(pOSyncPlugin, 3*60); // 3 minutes osync_plugin_set_finalize_timeout(pOSyncPlugin, 3*60); // 3 minutes @@ -1059,6 +1065,9 @@ continue; } + // Request anchor functionality from OpenSync + osync_objtype_sink_enable_anchor(sink, TRUE); + // TODO: Check the exact meaning of each timeout, and ajust accordingly osync_objtype_sink_set_connect_timeout(sink, 5*60); // 4 minutes osync_objtype_sink_set_disconnect_timeout(sink, 5*60); // 4 minutes @@ -1112,7 +1121,6 @@ if (capDef.fError) { LOG_EXIT_ERROR_OSYNC_SZ(10, capDef.ppOSyncError, "Could not add capability"); return NULL; } - LOG_EXIT(10, "(%p)", pOSyncMozillaEnv); return (void*) pOSyncMozillaEnv; } @@ -1174,7 +1182,6 @@ osync_plugin_set_finalize(pOSyncPlugin, mozilla_sync_finalize); osync_plugin_set_discover(pOSyncPlugin, mozilla_sync_discover); - osync_plugin_set_useable_timeout(pOSyncPlugin, 10*60); // 5 minutes osync_plugin_set_initialize_timeout(pOSyncPlugin, 5*60); // 3 minutes osync_plugin_set_finalize_timeout(pOSyncPlugin, 5*60); // 3 minutes osync_plugin_env_register_plugin(pOSyncPluginEnv, pOSyncPlugin); |
From: <dg...@su...> - 2009-01-06 15:52:31
|
Author: bellmich Date: Tue Jan 6 16:52:10 2009 New Revision: 147 URL: http://libwbxml.opensync.org/changeset/147 Log: added better description for copying the files Modified: wbxml2/trunk/RELEASE Modified: wbxml2/trunk/RELEASE ============================================================================== --- wbxml2/trunk/RELEASE Tue Jan 6 16:45:09 2009 (r146) +++ wbxml2/trunk/RELEASE Tue Jan 6 16:52:10 2009 (r147) @@ -33,7 +33,8 @@ you have to "svn up" and run the tests again - once the commit succeeds, you have to create a new tag with - "cp -R trunk tags/libwbxml-$MAJOR.$MINJOR.$PATCH", + "mkdir tags/libwbxml-$MAJOR.$MINJOR.$PATCH", + "tar -C trunk --exclude=\"\\.svn\" -cf - . | tar -C tags/libwbxml-$MAJOR.$MINJOR.$PATCH -xf -" "svn add tags/libwbxml-$MAJOR.$MINJOR.$PATCH" and "svn commit tags/libwbxml-$MAJOR.$MINJOR.$PATCH" (NEVER use "svn cp" because you must replace the external entities |
From: <dg...@su...> - 2009-01-06 15:45:34
|
Author: bellmich Date: Tue Jan 6 16:45:09 2009 New Revision: 146 URL: http://libwbxml.opensync.org/changeset/146 Log: prepare release of libwbxml version 0.10.1 Modified: wbxml2/trunk/CMakeLists.txt wbxml2/trunk/ChangeLog Modified: wbxml2/trunk/CMakeLists.txt ============================================================================== --- wbxml2/trunk/CMakeLists.txt Mon Jan 5 11:30:14 2009 (r145) +++ wbxml2/trunk/CMakeLists.txt Tue Jan 6 16:45:09 2009 (r146) @@ -2,7 +2,7 @@ SET( LIBWBXML_VERSION_MAJOR "0" ) SET( LIBWBXML_VERSION_MINOR "10" ) -SET( LIBWBXML_VERSION_PATCH "0" ) +SET( LIBWBXML_VERSION_PATCH "1" ) SET( LIBWBXML_VERSION "${LIBWBXML_VERSION_MAJOR}.${LIBWBXML_VERSION_MINOR}.${LIBWBXML_VERSION_PATCH}" ) # The most recent interface number that this library implements. @@ -15,7 +15,7 @@ # UPDATE: last release. # UPDATE: Set REVISION to 0 if any interface have been added, removed or # UPDATE: changed since the last update. -SET( LIBWBXML_LIBVERSION_REVISION 10 ) +SET( LIBWBXML_LIBVERSION_REVISION 11 ) # The difference between the newest and the oldest interfaces. # UPDATE: If any interface have been added since the last public Modified: wbxml2/trunk/ChangeLog ============================================================================== --- wbxml2/trunk/ChangeLog Mon Jan 5 11:30:14 2009 (r145) +++ wbxml2/trunk/ChangeLog Tue Jan 6 16:45:09 2009 (r146) @@ -1,9 +1,11 @@ +2009-01-06 Michael Bell <mic...@we...> * Removed a useless buffer which only creates a memory leak. * The installation of the documentation can be disabled. * LIBDATA_INSTALL_DIR was introduced (used by pkgconfig). * All tests are executed as standalone tests to get more detailed informations if a test fails. * The timezone of the nightly build-time was fixed. + 2008-12-05 Michael Bell <mic...@we...> * Fixed ticket #14 with patch from ticket (hexadecimal integer support for Wireless-Village) |
From: <dg...@su...> - 2009-01-06 14:06:15
|
Author: dgollub Date: Tue Jan 6 15:05:53 2009 New Revision: 5043 URL: http://www.opensync.org/changeset/5043 Log: More refacotring of ObjEngine WRITE command. This time: conversion to peer format. Modified: trunk/opensync/engine/opensync_mapping_entry_engine.c trunk/opensync/engine/opensync_mapping_entry_engine_internals.h trunk/opensync/engine/opensync_obj_engine.c Modified: trunk/opensync/engine/opensync_mapping_entry_engine.c ============================================================================== --- trunk/opensync/engine/opensync_mapping_entry_engine.c Tue Jan 6 14:31:14 2009 (r5042) +++ trunk/opensync/engine/opensync_mapping_entry_engine.c Tue Jan 6 15:05:53 2009 (r5043) @@ -27,6 +27,7 @@ #include "opensync-data.h" #include "opensync-mapping.h" #include "opensync-format.h" +#include "opensync-plugin.h" #include "archive/opensync_archive_internals.h" #include "format/opensync_objformat_internals.h" @@ -205,3 +206,65 @@ return FALSE; } +osync_bool osync_entry_engine_convert(OSyncMappingEntryEngine *entry_engine, OSyncFormatEnv *formatenv, OSyncObjTypeSink *objtype_sink, OSyncFormatConverterPath **cachedpath, OSyncError **error) +{ + char *objtype = NULL; + OSyncList *format_sinks = NULL; + unsigned int length = 0; + OSyncFormatConverter *converter = NULL; + OSyncChange *change = entry_engine->change; + OSyncFormatConverterPath *path; + + osync_trace(TRACE_INTERNAL, "Starting to convert from objtype %s and format %s", osync_change_get_objtype(entry_engine->change), osync_objformat_get_name(osync_change_get_objformat(entry_engine->change))); + /* We have to save the objtype of the change so that it does not get + * overwritten by the conversion */ + objtype = g_strdup(osync_change_get_objtype(change)); + + /* Now we have to convert to one of the formats + * that the client can understand */ + format_sinks = osync_objtype_sink_get_objformat_sinks(objtype_sink); + if (!format_sinks) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "There are no available format sinks."); + goto error_free_objtype; + } + + /* We cache the converter path for each sink/member couple */ + if (!*cachedpath) + path = osync_format_env_find_path_formats_with_detectors(formatenv, osync_change_get_data(entry_engine->change), format_sinks, osync_objtype_sink_get_preferred_format(objtype_sink), error); + else + path = osync_converter_path_ref(*cachedpath); + + if (!path) + goto error_free_objtype; + + length = osync_converter_path_num_edges(path); + converter = osync_converter_path_nth_edge(path, length - 1); + if (converter) { + OSyncObjFormat *format = osync_converter_get_targetformat(converter); + OSyncObjFormatSink *formatsink = osync_objtype_sink_find_objformat_sink(objtype_sink, format); + osync_converter_path_set_config(path, osync_objformat_sink_get_config(formatsink)); + } + + if (!osync_format_env_convert(formatenv, path, osync_change_get_data(entry_engine->change), error)) { + goto error_free_path; + } + osync_trace(TRACE_INTERNAL, "converted to format %s", osync_objformat_get_name(osync_change_get_objformat(entry_engine->change))); + + if (*cachedpath) + osync_converter_path_unref(*cachedpath); + + *cachedpath = path; + + osync_change_set_objtype(change, objtype); + g_free(objtype); + + return TRUE; + +error_free_path: + osync_converter_path_unref(path); +error_free_objtype: + g_free(objtype); +/*error:*/ + return FALSE; +} + Modified: trunk/opensync/engine/opensync_mapping_entry_engine_internals.h ============================================================================== --- trunk/opensync/engine/opensync_mapping_entry_engine_internals.h Tue Jan 6 14:31:14 2009 (r5042) +++ trunk/opensync/engine/opensync_mapping_entry_engine_internals.h Tue Jan 6 15:05:53 2009 (r5043) @@ -107,7 +107,6 @@ */ void osync_entry_engine_set_dirty(OSyncMappingEntryEngine *engine, osync_bool dirty); - /*! @brief Demerge the entry in the OSyncMappingEntryEngine * * The demerge includes storing the "entire" entry in the Archive. The demerging is done @@ -121,6 +120,25 @@ */ osync_bool osync_entry_engine_demerge(OSyncMappingEntryEngine *engine, OSyncArchive *archive, OSyncCapabilities *caps, OSyncError **error); +/*! @brief convert the entry in the OSyncMappingEntryEngine + * + * The conversion of the entry of OSyncMappingEntryEngine, uses the format + * configurations of OSyncObjTypeSink (i.e. which supported formats, preferred + * formats and format-configuration). + * + * The OSyncFormatConverterPath can be "cached" by supplied a refernce to the parameter. + * Which should be reused, since this avoids conversion-path building and detection. + * + * @param engine Pointer to an OSyncMappingEntryEngine + * @param formatenv Pointer to format environment + * @param objtype_sink Pointer to Object Type Sink which stores format configurations + * @param path Reference to OSyncFormatConverterPath to supplied or store the cache conversion path + * @param error Pointer to error struct, which get set on any error + * @returns TRUE on successful demerge, FALSE otherwise + */ + +osync_bool osync_entry_engine_convert(OSyncMappingEntryEngine *engine, OSyncFormatEnv *formatenv, OSyncObjTypeSink *objtype_sink, OSyncFormatConverterPath **path, OSyncError **error); + /*@}*/ #endif /* OPENSYNC_MAPPING_ENTRY_ENGINE_INTERNALS_H_ */ Modified: trunk/opensync/engine/opensync_obj_engine.c ============================================================================== --- trunk/opensync/engine/opensync_obj_engine.c Tue Jan 6 14:31:14 2009 (r5042) +++ trunk/opensync/engine/opensync_obj_engine.c Tue Jan 6 15:05:53 2009 (r5043) @@ -1102,6 +1102,7 @@ objtype_sink = osync_member_find_objtype_sink(member, engine->objtype); /* If sink could not be found use "data" sink if available */ + /* TODO: Get rid of hardcoded-"data". Make this indepdendent of "data" */ if (!objtype_sink) objtype_sink = osync_member_find_objtype_sink(member, "data"); /* TODO: Review if objtype_sink = NULL is valid at all. */ @@ -1137,49 +1138,9 @@ /* Convert to requested target format if the changetype is not DELETED */ if (osync_group_get_converter_enabled(osync_engine_get_group(engine->parent)) && (osync_change_get_changetype(change) != OSYNC_CHANGE_TYPE_DELETED)) { - - char *objtype = NULL; - OSyncList *format_sinks = NULL; - unsigned int length = 0; - OSyncFormatConverter *converter = NULL; - - osync_trace(TRACE_INTERNAL, "Starting to convert from objtype %s and format %s", osync_change_get_objtype(entry_engine->change), osync_objformat_get_name(osync_change_get_objformat(entry_engine->change))); - /* We have to save the objtype of the change so that it does not get - * overwritten by the conversion */ - objtype = g_strdup(osync_change_get_objtype(change)); - - /* Now we have to convert to one of the formats - * that the client can understand */ - format_sinks = osync_objtype_sink_get_objformat_sinks(objtype_sink); - if (!format_sinks) { - osync_error_set(error, OSYNC_ERROR_GENERIC, "There are no available format sinks."); - goto error; - } - - /* We cache the converter path for each sink/member couple */ - if (!path) { - path = osync_format_env_find_path_formats_with_detectors(engine->formatenv, osync_change_get_data(entry_engine->change), format_sinks, osync_objtype_sink_get_preferred_format(objtype_sink), error); - } - if (!path) + if (!osync_entry_engine_convert(entry_engine, engine->formatenv, objtype_sink, &path, error)) goto error; - length = osync_converter_path_num_edges(path); - converter = osync_converter_path_nth_edge(path, length - 1); - if (converter) { - OSyncObjFormat *format = osync_converter_get_targetformat(converter); - OSyncObjFormatSink *formatsink = osync_objtype_sink_find_objformat_sink(objtype_sink, format); - osync_converter_path_set_config(path, osync_objformat_sink_get_config(formatsink)); - } - - if (!osync_format_env_convert(engine->formatenv, path, osync_change_get_data(entry_engine->change), error)) { - osync_converter_path_unref(path); - goto error; - } - osync_trace(TRACE_INTERNAL, "converted to format %s", osync_objformat_get_name(osync_change_get_objformat(entry_engine->change))); - - - osync_change_set_objtype(change, objtype); - g_free(objtype); } osync_trace(TRACE_INTERNAL, "Writing change %s, changetype %i, format %s , objtype %s from member %lli", |
From: <dg...@su...> - 2009-01-06 13:31:35
|
Author: dgollub Date: Tue Jan 6 14:31:14 2009 New Revision: 5042 URL: http://www.opensync.org/changeset/5042 Log: Started refactoring ObjEngine WRITE command. This is required for later to move all non-WRITE related tasks into a "PREPARE_WRITE" command. This is required for sepearting conversion and demerging from WRITE, to exchange entry-engines between ObjEngine on a mixed-objtype sync. Started with refactoring the demerging code in the engine. No fundamental (code)/logic changes. Modified: trunk/opensync/engine/opensync_mapping_entry_engine.c trunk/opensync/engine/opensync_mapping_entry_engine_internals.h trunk/opensync/engine/opensync_obj_engine.c Modified: trunk/opensync/engine/opensync_mapping_entry_engine.c ============================================================================== --- trunk/opensync/engine/opensync_mapping_entry_engine.c Tue Jan 6 10:06:25 2009 (r5041) +++ trunk/opensync/engine/opensync_mapping_entry_engine.c Tue Jan 6 14:31:14 2009 (r5042) @@ -26,7 +26,12 @@ #include "opensync-engine.h" #include "opensync-data.h" #include "opensync-mapping.h" +#include "opensync-format.h" +#include "archive/opensync_archive_internals.h" +#include "format/opensync_objformat_internals.h" + +#include "opensync_obj_engine.h" #include "opensync_obj_engine.h" #include "opensync_mapping_engine.h" @@ -35,7 +40,6 @@ #include "opensync_mapping_entry_engine_internals.h" #include "opensync_mapping_engine_internals.h" - OSyncMappingEntryEngine *osync_entry_engine_new(OSyncMappingEntry *entry, OSyncMappingEngine *mapping_engine, OSyncSinkEngine *sink_engine, OSyncObjEngine *objengine, OSyncError **error) { OSyncMappingEntryEngine *engine = NULL; @@ -153,3 +157,51 @@ engine->dirty = dirty; } +osync_bool osync_entry_engine_demerge(OSyncMappingEntryEngine *entry_engine, OSyncArchive *archive, OSyncCapabilities *caps, OSyncError **error) +{ + + char *buffer = NULL, *marshalbuf; + unsigned int size = 0, marshalsize; + const char *objtype = NULL; + OSyncMapping *mapping = NULL; + OSyncMarshal *marshal = NULL; + OSyncObjFormat *objformat = osync_change_get_objformat(entry_engine->change); + + osync_trace(TRACE_INTERNAL, "Entry %s Dirty: %i", osync_change_get_uid(entry_engine->change), osync_entry_engine_is_dirty(entry_engine)); + + osync_trace(TRACE_INTERNAL, "Save the entire data and demerge."); + objtype = osync_change_get_objtype(entry_engine->change); + mapping = entry_engine->mapping_engine->mapping; + + osync_data_get_data(osync_change_get_data(entry_engine->change), &buffer, &size); + + marshal = osync_marshal_new(error); + if (!marshal) + goto error; + + if (!osync_objformat_marshal(objformat, buffer, size, marshal, error)) + goto error_free_marshal; + + osync_marshal_get_buffer(marshal, &marshalbuf, &marshalsize); + + if (!osync_archive_save_data(archive, osync_mapping_get_id(mapping), objtype, marshalbuf, marshalsize, error)) { + osync_free(buffer); /* TODO: Is this a valid free? */ + goto error_free_marshal; + } + + if (!osync_objformat_demerge(objformat, &buffer, &size, caps, error)) + goto error_free_marshal; + + osync_trace(TRACE_SENSITIVE, "Post Demerge:\n%s\n", + osync_objformat_print(objformat, buffer, size)); + + osync_marshal_unref(marshal); + + return TRUE; + +error_free_marshal: + osync_marshal_unref(marshal); +error: + return FALSE; +} + Modified: trunk/opensync/engine/opensync_mapping_entry_engine_internals.h ============================================================================== --- trunk/opensync/engine/opensync_mapping_entry_engine_internals.h Tue Jan 6 10:06:25 2009 (r5041) +++ trunk/opensync/engine/opensync_mapping_entry_engine_internals.h Tue Jan 6 14:31:14 2009 (r5042) @@ -107,6 +107,20 @@ */ void osync_entry_engine_set_dirty(OSyncMappingEntryEngine *engine, osync_bool dirty); + +/*! @brief Demerge the entry in the OSyncMappingEntryEngine + * + * The demerge includes storing the "entire" entry in the Archive. The demerging is done + * based on the supplied OSyncCapabilities. + * + * @param engine Pointer to an OSyncMappingEntryEngine + * @param archive Pointer to the Archive to store the "entire" entry before demerging + * @param caps Pointer to Capabilities to use for demerging + * @param error Pointer to error struct, which get set on any error + * @returns TRUE on successful demerge, FALSE otherwise + */ +osync_bool osync_entry_engine_demerge(OSyncMappingEntryEngine *engine, OSyncArchive *archive, OSyncCapabilities *caps, OSyncError **error); + /*@}*/ #endif /* OPENSYNC_MAPPING_ENTRY_ENGINE_INTERNALS_H_ */ Modified: trunk/opensync/engine/opensync_obj_engine.c ============================================================================== --- trunk/opensync/engine/opensync_obj_engine.c Tue Jan 6 10:06:25 2009 (r5041) +++ trunk/opensync/engine/opensync_obj_engine.c Tue Jan 6 14:31:14 2009 (r5042) @@ -1083,6 +1083,7 @@ long long int memberid = 0; OSyncObjTypeSink *objtype_sink = NULL; OSyncFormatConverterPath *path = NULL; + OSyncCapabilities *caps; sinkengine = p->data; @@ -1097,6 +1098,7 @@ member = osync_client_proxy_get_member(sinkengine->proxy); memberid = osync_member_get_id(member); + caps = osync_member_get_capabilities(member); objtype_sink = osync_member_find_objtype_sink(member, engine->objtype); /* If sink could not be found use "data" sink if available */ @@ -1108,54 +1110,23 @@ OSyncMappingEntryEngine *entry_engine = o->data; osync_assert(entry_engine); + + /* Merger - Save the entire data and demerge */ + /* TODO: Review those conditionals! + * Candidates to drop are: + */ if (osync_group_get_merger_enabled(osync_engine_get_group(engine->parent)) && - osync_member_get_capabilities(member) && - osync_group_get_converter_enabled(osync_engine_get_group(engine->parent)) && + osync_member_get_capabilities(member) && /* Candidate to drop */ + osync_group_get_converter_enabled(osync_engine_get_group(engine->parent)) && /* Candidate to drop */ entry_engine->change && (osync_change_get_changetype(entry_engine->change) != OSYNC_CHANGE_TYPE_DELETED) && osync_objformat_has_merger(osync_change_get_objformat(entry_engine->change)) ) { - char *buffer = NULL, *marshalbuf; - unsigned int size = 0, marshalsize; - const char *objtype = NULL; - OSyncMapping *mapping = NULL; - OSyncMarshal *marshal = NULL; - OSyncCapabilities *caps = osync_member_get_capabilities(member); - OSyncObjFormat *objformat = osync_change_get_objformat(entry_engine->change); - - osync_trace(TRACE_INTERNAL, "Entry %s for member %lli: Dirty: %i", osync_change_get_uid(entry_engine->change), memberid, osync_entry_engine_is_dirty(entry_engine)); - - osync_trace(TRACE_INTERNAL, "Save the entire data and demerge."); - objtype = osync_change_get_objtype(entry_engine->change); - mapping = entry_engine->mapping_engine->mapping; - - osync_data_get_data(osync_change_get_data(entry_engine->change), &buffer, &size); - - marshal = osync_marshal_new(error); - if (!marshal) - goto error; - - if (!osync_objformat_marshal(objformat, buffer, size, marshal, error)) + if (!osync_entry_engine_demerge(entry_engine, engine->archive, caps, error)) goto error; - - osync_marshal_get_buffer(marshal, &marshalbuf, &marshalsize); - - if (!osync_archive_save_data(engine->archive, osync_mapping_get_id(mapping), objtype, marshalbuf, marshalsize, error)) { - osync_marshal_unref(marshal); - osync_free(buffer); - goto error; - } - - osync_marshal_unref(marshal); - - if (!osync_objformat_demerge(objformat, &buffer, &size, caps, error)) - goto error; - - osync_trace(TRACE_SENSITIVE, "Post Demerge:\n%s\n", - osync_objformat_print(objformat, buffer, size)); } |
From: <dg...@su...> - 2009-01-06 09:32:32
|
Author: bellmich Date: Tue Jan 6 10:32:11 2009 New Revision: 886 URL: http://libsyncml.opensync.org/changeset/886 Log: new suppressions for glib on build host aachen Modified: trunk/tests/valgrind.supp Modified: trunk/tests/valgrind.supp ============================================================================== --- trunk/tests/valgrind.supp Mon Jan 5 16:11:25 2009 (r885) +++ trunk/tests/valgrind.supp Tue Jan 6 10:32:11 2009 (r886) @@ -65,6 +65,18 @@ fun:xmlReaderForMemory } +{ + xmlReaderForMemory - source: smlXmlParserStart - 5 + Memcheck:Leak + fun:malloc + fun:xmlNewRMutex + fun:xmlDictCreate + fun:xmlInitParserCtxt + fun:xmlNewParserCtxt + fun:xmlCreatePushParserCtxt + fun:xmlNewTextReader + fun:xmlReaderForMemory +} ## xmlBufferCreateSize @@ -213,3 +225,18 @@ fun:g_type_init_with_debug_flags fun:g_type_init } + +{ + g_type_init - 8 + Memcheck:Leak + fun:malloc + fun:realloc + fun:g_realloc + obj:* + fun:g_type_register_static + fun:g_param_type_register_static + obj:* + fun:g_type_init_with_debug_flags + fun:g_type_init +} + |
From: <dg...@su...> - 2009-01-06 09:06:45
|
Author: bricks Date: Tue Jan 6 10:06:25 2009 New Revision: 5041 URL: http://www.opensync.org/changeset/5041 Log: changed file-sync discovery function parameter list for Ticket #1019 Modified: plugins/file-sync/src/file_sync.c Modified: plugins/file-sync/src/file_sync.c ============================================================================== --- plugins/file-sync/src/file_sync.c Tue Jan 6 09:48:34 2009 (r5040) +++ plugins/file-sync/src/file_sync.c Tue Jan 6 10:06:25 2009 (r5041) @@ -352,7 +352,7 @@ file->size = size; file->path = g_strdup(relative_filename); - OSyncObjFormat *fileformat = osync_format_env_find_objformat(formatenv, "file"); + OSyncObjFormat *fileformat = osync_format_env_find_objformat(formatenv, "file"); odata = osync_data_new((char *)file, sizeof(OSyncFileFormat), fileformat, &error); if (!odata) { @@ -422,7 +422,7 @@ osync_change_set_uid(change, uid); osync_change_set_changetype(change, OSYNC_CHANGE_TYPE_DELETED); - OSyncObjFormat *fileformat = osync_format_env_find_objformat(formatenv, "file"); + OSyncObjFormat *fileformat = osync_format_env_find_objformat(formatenv, "file"); OSyncData *odata = osync_data_new(NULL, 0, fileformat, &error); if (!odata) { @@ -619,7 +619,7 @@ /* Here we actually tell opensync which sinks are available. For this plugin, we * just report all objtype as available. Since the resource are configured like this. */ -static osync_bool osync_filesync_discover(void *data, OSyncPluginInfo *info, OSyncError **error) +static osync_bool osync_filesync_discover(OSyncPluginInfo *info, void *data, OSyncError **error) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, error); |
From: <dg...@su...> - 2009-01-06 08:48:59
|
Author: bricks Date: Tue Jan 6 09:48:34 2009 New Revision: 5040 URL: http://www.opensync.org/changeset/5040 Log: Changed Plugin Function parameter list (user-data pointer) for ticket #1019 Modified: trunk/opensync/plugin/opensync_plugin.c trunk/opensync/plugin/opensync_plugin.h trunk/tests/mock-plugin/mock_sync.c Modified: trunk/opensync/plugin/opensync_plugin.c ============================================================================== --- trunk/opensync/plugin/opensync_plugin.c Tue Jan 6 04:15:09 2009 (r5039) +++ trunk/opensync/plugin/opensync_plugin.c Tue Jan 6 09:48:34 2009 (r5040) @@ -185,7 +185,7 @@ if (!plugin->discover) return TRUE; - return plugin->discover(data, info, error); + return plugin->discover(info, data, error); } osync_bool osync_plugin_is_usable(OSyncPlugin *plugin, OSyncError **error) Modified: trunk/opensync/plugin/opensync_plugin.h ============================================================================== --- trunk/opensync/plugin/opensync_plugin.h Tue Jan 6 04:15:09 2009 (r5039) +++ trunk/opensync/plugin/opensync_plugin.h Tue Jan 6 09:48:34 2009 (r5040) @@ -21,11 +21,11 @@ #ifndef _OPENSYNC_PLUGIN_H_ #define _OPENSYNC_PLUGIN_H_ -typedef void * (* initialize_fn) (OSyncPlugin *, OSyncPluginInfo *, OSyncError **); -typedef void (* finalize_fn) (void *); -typedef osync_bool (* discover_fn) (void *, OSyncPluginInfo *, OSyncError **); +typedef void * (* initialize_fn) (OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error); +typedef void (* finalize_fn) (void * plugin_data); +typedef osync_bool (* discover_fn) (OSyncPluginInfo *info, void * plugin_data, OSyncError **error); -/*! @brief Gives information about wether the plugin +/** @brief Gives information about wether the plugin * has to be configured or not * * @ingroup OSyncPluginAPI @@ -48,7 +48,7 @@ /*@{*/ -/*! @brief Registers a new plugin +/** @brief Registers a new plugin * * This function creates a new OSyncPlugin object, that * can be used to register a new plugin dynamically. This @@ -61,14 +61,14 @@ */ OSYNC_EXPORT OSyncPlugin *osync_plugin_new(OSyncError **error); -/*! @brief Decrease the reference count on a plugin +/** @brief Decrease the reference count on a plugin * * @param plugin Pointer to the plugin * */ OSYNC_EXPORT void osync_plugin_unref(OSyncPlugin *plugin); -/*! @brief Increase the reference count on a plugin +/** @brief Increase the reference count on a plugin * * @param plugin Pointer to the plugin * @@ -76,7 +76,7 @@ OSYNC_EXPORT OSyncPlugin *osync_plugin_ref(OSyncPlugin *plugin); -/*! @brief Returns the name of a plugin +/** @brief Returns the name of a plugin * * @param plugin Pointer to the plugin * @returns Name of the plugin @@ -84,7 +84,7 @@ */ OSYNC_EXPORT const char *osync_plugin_get_name(OSyncPlugin *plugin); -/*! @brief Sets the name of a plugin +/** @brief Sets the name of a plugin * * Sets the name of a plugin. This is a short name (maybe < 15 chars). * @@ -95,7 +95,7 @@ OSYNC_EXPORT void osync_plugin_set_name(OSyncPlugin *plugin, const char *name); -/*! @brief Returns the long name of a plugin +/** @brief Returns the long name of a plugin * * @param plugin Pointer to the plugin * @returns Long name of the plugin @@ -103,7 +103,7 @@ */ OSYNC_EXPORT const char *osync_plugin_get_longname(OSyncPlugin *plugin); -/*! @brief Sets the long name of a plugin +/** @brief Sets the long name of a plugin * * Sets the long name of a plugin (maybe < 50 chars). * @@ -114,14 +114,14 @@ OSYNC_EXPORT void osync_plugin_set_longname(OSyncPlugin *plugin, const char *longname); -/*! @brief Returns whether or not the plugin requires configuration +/** @brief Returns whether or not the plugin requires configuration * * @param plugin Pointer to the plugin * @returns The configuration requirement type of the plugin */ OSYNC_EXPORT OSyncConfigurationType osync_plugin_get_config_type(OSyncPlugin *plugin); -/*! @brief Sets whether or not the plugin requires configuration +/** @brief Sets whether or not the plugin requires configuration * * @param plugin Pointer to the plugin * @param type The configuration requirement type of the plugin @@ -129,14 +129,14 @@ OSYNC_EXPORT void osync_plugin_set_config_type(OSyncPlugin *plugin, OSyncConfigurationType type); -/*! @brief Returns start type of plugin +/** @brief Returns start type of plugin * * @param plugin Pointer to the plugin * @returns The start type of the plugin */ OSYNC_EXPORT OSyncStartType osync_plugin_get_start_type(OSyncPlugin *plugin); -/*! @brief Sets the start type of the plugin +/** @brief Sets the start type of the plugin * * @param plugin Pointer to the plugin * @param type The start type of the plugin @@ -144,7 +144,7 @@ OSYNC_EXPORT void osync_plugin_set_start_type(OSyncPlugin *plugin, OSyncStartType type); -/*! @brief Returns the description of a plugin +/** @brief Returns the description of a plugin * * @param plugin Pointer to the plugin * @returns Description of the plugin @@ -152,7 +152,7 @@ */ OSYNC_EXPORT const char *osync_plugin_get_description(OSyncPlugin *plugin); -/*! @brief Sets the description of a plugin +/** @brief Sets the description of a plugin * * Sets a longer description for the plugin (maybe < 200 chars). * @@ -163,7 +163,7 @@ OSYNC_EXPORT void osync_plugin_set_description(OSyncPlugin *plugin, const char *description); -/*! @brief Sets the initialize function for a plugin +/** @brief Sets the initialize function for a plugin * * The initialize function of a plugin sets up sinks for the plugin as well * as other plugin-wide structures. @@ -173,7 +173,7 @@ */ OSYNC_EXPORT void osync_plugin_set_initialize(OSyncPlugin *plugin, initialize_fn init); -/*! @brief Sets the finalize function for a plugin +/** @brief Sets the finalize function for a plugin * * The finalize function of a plugin frees any plugin-wide structures * that were created in the initialize function. @@ -183,7 +183,7 @@ */ OSYNC_EXPORT void osync_plugin_set_finalize(OSyncPlugin *plugin, finalize_fn fin); -/*! @brief Sets the optional discover function for a plugin +/** @brief Sets the optional discover function for a plugin * * The discover function of a plugin can be used to specify which * of the sinks in the plugin are currently available, and to declare @@ -198,21 +198,21 @@ OSYNC_EXPORT void osync_plugin_set_discover(OSyncPlugin *plugin, discover_fn discover); -/*! @brief Returns the plugin_info data, set by the plugin +/** @brief Returns the plugin_info data, set by the plugin * * @param plugin Pointer to the plugin * @returns The void pointer set on plugin->info.plugin_data */ OSYNC_EXPORT void *osync_plugin_get_data(OSyncPlugin *plugin); -/*! @brief Set the plugin_info data for the plugin object +/** @brief Set the plugin_info data for the plugin object * * @param plugin Pointer to the plugin * @param data Pointer to data which should get set */ OSYNC_EXPORT void osync_plugin_set_data(OSyncPlugin *plugin, void *data); -/*! @brief Set timeout interval for plugin discovery +/** @brief Set timeout interval for plugin discovery * * @param plugin The plugin to check * @param timeout Timeout value @@ -220,7 +220,7 @@ */ OSYNC_EXPORT void osync_plugin_set_discover_timeout(OSyncPlugin *plugin, unsigned int timeout); -/*! @brief Set timeout interval for plugin initialization +/** @brief Set timeout interval for plugin initialization * * @param plugin The plugin to check * @param timeout Timeout value @@ -228,7 +228,7 @@ */ OSYNC_EXPORT void osync_plugin_set_initialize_timeout(OSyncPlugin *plugin, unsigned int timeout); -/*! @brief Set timeout interval for plugin finalization +/** @brief Set timeout interval for plugin finalization * * @param plugin The plugin to check * @param timeout Timeout value @@ -236,7 +236,7 @@ */ OSYNC_EXPORT void osync_plugin_set_finalize_timeout(OSyncPlugin *plugin, unsigned int timeout); -/*! @brief Initialize Plugin +/** @brief Initialize Plugin * * @param plugin Pointer to the plugin * @param info Pointer to OSyncPluginInfo which describes the plugin @@ -245,14 +245,14 @@ */ OSYNC_EXPORT void *osync_plugin_initialize(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error); -/*! @brief Finalize Plugin +/** @brief Finalize Plugin * * @param plugin Pointer to the plugin * @param data Pointer to userdata which got returned by plugin initialize function */ OSYNC_EXPORT void osync_plugin_finalize(OSyncPlugin *plugin, void *data); -/*! @brief Call plugin discovery +/** @brief Call plugin discovery * * @param plugin Pointer to the plugin * @param data Pointer to userdata which got returned by plugin initialize function Modified: trunk/tests/mock-plugin/mock_sync.c ============================================================================== --- trunk/tests/mock-plugin/mock_sync.c Tue Jan 6 04:15:09 2009 (r5039) +++ trunk/tests/mock-plugin/mock_sync.c Tue Jan 6 09:48:34 2009 (r5040) @@ -753,7 +753,7 @@ /* Here we actually tell opensync which sinks are available. For this plugin, we * go through the list of directories and enable all, since all have been configured */ -static osync_bool mock_discover(void *data, OSyncPluginInfo *info, OSyncError **error) +static osync_bool mock_discover(OSyncPluginInfo *info, void *data, OSyncError **error) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, data, info, error); |
From: <dg...@su...> - 2009-01-06 03:15:30
|
Author: dgollub Date: Tue Jan 6 04:15:09 2009 New Revision: 5039 URL: http://www.opensync.org/changeset/5039 Log: Replace mapping-table inconsistent assert() protection with a real error. Since this might happen in future due to various crazy bugs. Modified: trunk/opensync/engine/opensync_mapping_engine.c Modified: trunk/opensync/engine/opensync_mapping_engine.c ============================================================================== --- trunk/opensync/engine/opensync_mapping_engine.c Tue Jan 6 03:06:49 2009 (r5038) +++ trunk/opensync/engine/opensync_mapping_engine.c Tue Jan 6 04:15:09 2009 (r5039) @@ -72,7 +72,12 @@ OSyncMember *member = osync_client_proxy_get_member(sink_engine->proxy); OSyncMappingEntry *mapping_entry = osync_mapping_find_entry_by_member_id(mapping, osync_member_get_id(member)); - osync_assert(mapping_entry); + if (!mapping_entry) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "Inconsistency in Mapping Table " + "for Object Type \"%s\" detected.", + osync_obj_engine_get_objtype(engine->parent)); + goto error; + } entry_engine = osync_entry_engine_new(mapping_entry, engine, sink_engine, parent, error); if (!entry_engine) |
From: <dg...@su...> - 2009-01-06 02:07:12
|
Author: dgollub Date: Tue Jan 6 03:06:49 2009 New Revision: 5038 URL: http://www.opensync.org/changeset/5038 Log: Use osync_marshal_write_data() insted of osync_marshal_write_buffer(). Later one would add additional buffer size information, which is not wanted when loading the marshal object from already marshaled data from the archive. Modified: trunk/opensync/engine/opensync_engine.c Modified: trunk/opensync/engine/opensync_engine.c ============================================================================== --- trunk/opensync/engine/opensync_engine.c Tue Jan 6 02:27:31 2009 (r5037) +++ trunk/opensync/engine/opensync_engine.c Tue Jan 6 03:06:49 2009 (r5038) @@ -287,7 +287,7 @@ if (!marshal) goto error; - osync_marshal_write_buffer(marshal, entirebuf, entsize); + osync_marshal_write_data(marshal, entirebuf, entsize); if (!osync_objformat_demarshal(objformat, marshal, &entirebuf, &entsize, &error)) { osync_marshal_unref(marshal); |
From: <dg...@su...> - 2009-01-06 01:27:53
|
Author: dgollub Date: Tue Jan 6 02:27:31 2009 New Revision: 5037 URL: http://www.opensync.org/changeset/5037 Log: Introduce trival testcases xmlformat_print and xmlformat_destory. Modified: format-plugins/xmlformat/trunk/tests/check_xmlformat.c Modified: format-plugins/xmlformat/trunk/tests/check_xmlformat.c ============================================================================== --- format-plugins/xmlformat/trunk/tests/check_xmlformat.c Tue Jan 6 02:17:21 2009 (r5036) +++ format-plugins/xmlformat/trunk/tests/check_xmlformat.c Tue Jan 6 02:27:31 2009 (r5037) @@ -18,6 +18,52 @@ } END_TEST +START_TEST (xmlformat_print) +{ + char *testbed = setup_testbed("xmlformats"); + + char *buffer, *print_buffer; + unsigned int size; + OSyncError *error = NULL; + + fail_unless(osync_file_read( "contact.xml", &buffer, &size, &error), NULL); + + OSyncXMLFormat *xmlformat = osync_xmlformat_parse(buffer, size, &error); + fail_unless(xmlformat != NULL, NULL); + fail_unless(error == NULL, NULL); + + fail_unless((print_buffer = print_xmlformat((char *)xmlformat, osync_xmlformat_size(), NULL)) != NULL, NULL); + + osync_free(print_buffer); + + osync_xmlformat_unref(xmlformat); + + destroy_testbed(testbed); +} +END_TEST + +START_TEST (xmlformat_destroy) +{ + char *testbed = setup_testbed("xmlformats"); + + char *buffer; + unsigned int size; + OSyncError *error = NULL; + + fail_unless(osync_file_read( "contact.xml", &buffer, &size, &error), NULL); + + OSyncXMLFormat *xmlformat = osync_xmlformat_parse(buffer, size, &error); + fail_unless(xmlformat != NULL, NULL); + fail_unless(error == NULL, NULL); + + destroy_xmlformat((char *)xmlformat, osync_xmlformat_size(), NULL); + + osync_xmlformat_unref(xmlformat); + + destroy_testbed(testbed); +} +END_TEST + START_TEST (xmlformat_compare_test) { char *testbed = setup_testbed("xmlformats"); @@ -258,6 +304,8 @@ // Suite *s2 = suite_create("XMLFormat"); create_case(s, "xmlformat_init", xmlformat_init); + create_case(s, "xmlformat_print", xmlformat_print); + create_case(s, "xmlformat_destroy", xmlformat_destroy); create_case(s, "xmlformat_compare_test", xmlformat_compare_test); create_case(s, "xmlformat_compare_field2null", xmlformat_compare_field2null); create_case(s, "xmlformat_compare_ignore_fields", xmlformat_compare_ignore_fields); |
From: <dg...@su...> - 2009-01-06 01:17:40
|
Author: dgollub Date: Tue Jan 6 02:17:21 2009 New Revision: 5036 URL: http://www.opensync.org/changeset/5036 Log: Fix compiler warning about unused variables. Modified: format-plugins/xmlformat/trunk/src/xmlformat.c Modified: format-plugins/xmlformat/trunk/src/xmlformat.c ============================================================================== --- format-plugins/xmlformat/trunk/src/xmlformat.c Tue Jan 6 02:16:53 2009 (r5035) +++ format-plugins/xmlformat/trunk/src/xmlformat.c Tue Jan 6 02:17:21 2009 (r5036) @@ -319,8 +319,6 @@ osync_bool validate_xmlformat(const char *data, unsigned int size, void *user_data, OSyncError **error) { osync_bool ret; - char *buffer; - unsigned int bufsize; OSyncXMLFormat *xmlformat = (OSyncXMLFormat *) data; XMLFormat *xmlformat_data = user_data; osync_assert(xmlformat); |
From: <dg...@su...> - 2009-01-06 01:17:13
|
Author: dgollub Date: Tue Jan 6 02:16:53 2009 New Revision: 5035 URL: http://www.opensync.org/changeset/5035 Log: Dropped osync_trace() from xmlformat-validate function. This kind of trace should be done in the framework. Don't hide framework bugs with additional conditions, like in print_xmlformat(). Modified: format-plugins/xmlformat/trunk/src/xmlformat.c Modified: format-plugins/xmlformat/trunk/src/xmlformat.c ============================================================================== --- format-plugins/xmlformat/trunk/src/xmlformat.c Tue Jan 6 02:12:56 2009 (r5034) +++ format-plugins/xmlformat/trunk/src/xmlformat.c Tue Jan 6 02:16:53 2009 (r5035) @@ -74,8 +74,8 @@ char *buffer; unsigned int i; - if (!data) - return NULL; + osync_assert(data); + osync_assert(size > 0); if(!osync_xmlformat_assemble((OSyncXMLFormat *)data, &buffer, &i)) return NULL; @@ -318,8 +318,6 @@ osync_bool validate_xmlformat(const char *data, unsigned int size, void *user_data, OSyncError **error) { - osync_trace(TRACE_ENTRY, "%s(%p, %u, %p, %p)", __func__, data, size, user_data, error); - osync_bool ret; char *buffer; unsigned int bufsize; @@ -327,11 +325,7 @@ XMLFormat *xmlformat_data = user_data; osync_assert(xmlformat); - if (osync_trace_is_enabled()) { - osync_xmlformat_assemble(xmlformat, &buffer, &bufsize); - osync_trace(TRACE_SENSITIVE, "XMLFormat:\n%s", buffer); - osync_free(buffer); - } + osync_trace(TRACE_ENTRY, "%s(%p, %u, %p, %p)", __func__, data, size, user_data, error); ret = osync_xmlformat_schema_validate(xmlformat_data->xmlformat_schema, xmlformat, error); |