You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(56) |
Apr
(109) |
May
(15) |
Jun
(3) |
Jul
(37) |
Aug
(96) |
Sep
(40) |
Oct
(4) |
Nov
(54) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(47) |
Feb
(30) |
Mar
(102) |
Apr
(120) |
May
(68) |
Jun
(54) |
Jul
(53) |
Aug
(122) |
Sep
(190) |
Oct
(71) |
Nov
(85) |
Dec
(108) |
2007 |
Jan
(72) |
Feb
(190) |
Mar
(53) |
Apr
(101) |
May
(145) |
Jun
(148) |
Jul
(167) |
Aug
(143) |
Sep
(23) |
Oct
(198) |
Nov
(223) |
Dec
(195) |
2008 |
Jan
(100) |
Feb
(129) |
Mar
(79) |
Apr
(77) |
May
(34) |
Jun
(95) |
Jul
(112) |
Aug
(160) |
Sep
(82) |
Oct
(124) |
Nov
(199) |
Dec
(355) |
2009 |
Jan
(436) |
Feb
(89) |
Mar
(298) |
Apr
(189) |
May
(33) |
Jun
(88) |
Jul
(105) |
Aug
(44) |
Sep
(181) |
Oct
(87) |
Nov
(75) |
Dec
(1) |
2010 |
Jan
(63) |
Feb
(21) |
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(26) |
Aug
(37) |
Sep
(26) |
Oct
(15) |
Nov
(13) |
Dec
|
From: <svn...@op...> - 2009-04-17 08:02:35
|
Author: bellmich Date: Fri Apr 17 10:02:28 2009 New Revision: 5615 URL: http://www.opensync.org/changeset/5615 Log: patch from Johan Ladan to correct grammar errors Modified: trunk/docs/whitepaper/introduction.tex trunk/docs/whitepaper/synchronization.tex Modified: trunk/docs/whitepaper/introduction.tex ============================================================================== --- trunk/docs/whitepaper/introduction.tex Wed Apr 15 22:48:31 2009 (r5614) +++ trunk/docs/whitepaper/introduction.tex Fri Apr 17 10:02:28 2009 (r5615) @@ -6,18 +6,18 @@ \section{History} MultiSync, started by Bo Lincoln, was intended to synchronize various mobiles, PDAs and PIM applications. MultiSync was a GTK application and provided -support for different PIM applications and devices by providing plugins. -Primary focus of MultiSync was to synchronize just PIM data (contacts, +support for different PIM applications and devices by providing plugins. +The primary focus of MultiSync was to synchronize just PIM data (contacts, appointments, notes). Unfortunately this approach was fixed to a single UI and -only limited to PIM synchronization. Development branch MultiSync 0.9x was +limited to PIM synchronization. Development branch MultiSync 0.9x was intended fix those needs.\\ \\ Early in 2005, Armin Bauer started refactoring the MultiSync project and separated the UI code from MultiSync and the Plugin interface and -Synchronization logic. Result of his work is the most powerful and +Synchronization logic. The result of his work is the most powerful and flexible Synchronization Framework, known today as OpenSync. \section{Big Picture} -OpenSync is intended to provide a low-level synchronization API for all kind of +OpenSync is intended to provide a low-level synchronization API for all kinds of data. \\ \begin{figure} @@ -33,38 +33,38 @@ The goals of the OpenSync project are: \begin{itemize} - \item Reusabilty. OpenSync should be usable for all kind of synchronization + \item Reusabilty. OpenSync should be usable for all kinds of synchronization applications - \item Speed. Synchronization should be efficent and fast as possible to give the + \item Speed. Synchronization should be efficent and as fast as possible to give the user the best experience. - \item Flexibility. Nobody can predict what comes next to synchronize; after the - G- \& iPhone. So OpenSync has to be designed and built as flexible and modular + \item Flexibility. Nobody can predict what will come next to synchronize after the + G- \& iPhone, so OpenSync has to be designed and built as flexible and modular as possible. \item Integrity. Data MUST never be lost or malformed, no matter what happens. Data loss is just a no go! - \item Portability. OpenSync should just run on as many platforms as possible as + \item Portability. OpenSync should run on as many platforms as possible as possible. \item Fun. The experience of using and developing OpenSync MUST be fun! You should not work on OpenSync if you're unhappy :) \end{itemize} -Not all of the mentioned goals are reached already, but OpenSync tries to get +Not all of the mentioned goals are achieved yet, but OpenSync tries to get close as possible over time. \section{Who should read this document?} This Document is intended for everyone who is interested in a Open Source -Synchronization solution. This is not a HowTo, Tutorial or Guide how to use -OpenSync. It's a detailed introducation in the OpenSync framework. No (high) +Synchronization solution. This is not a HowTo, Tutorial or Guide on how to use +OpenSync. It is a detailed introduction of the OpenSync framework. No (high) programming skills/experince are required for this document. \section{How should this document be read?} Some chapter are very detailed about internal technial stuff, which is mainly -intended for developers or people who are interested in how OpenSync ticks. Those -chapters could be safetly skipped if someone isn't interested in touching the -internals of the OpenSync Framework. Such section are marked with a little hint. +intended for developers or people who are interested in how OpenSync works. Those +chapters could be safely skipped if someone isn't interested in touching the +internals of the OpenSync Framework. Such sections are marked with a little hint. \section{Is this the most recent version of this paper?} Maybe not, OpenSync is in a very early stage of development and lots of stuff -might changed within the last weeks. On doubts you might compare your version +might changed within the last weeks. If in doubt, you might compare your version with the one from:\\ \\ \hyperref[http://www.opensync.org/download/LATEST-WHITEPAPER]{http://www.opensync.org/download/LATEST-WHITEPAPER}\\ Modified: trunk/docs/whitepaper/synchronization.tex ============================================================================== --- trunk/docs/whitepaper/synchronization.tex Wed Apr 15 22:48:31 2009 (r5614) +++ trunk/docs/whitepaper/synchronization.tex Fri Apr 17 10:02:28 2009 (r5615) @@ -1,8 +1,8 @@ \chapter{Synchronization} -This chapter give a brief introduction of synchronization basics as well as how +This chapter gives brief introduction of synchronization basics as well as how OpenSync works and handles real life synchronization issues.\\ \\ -Different synchronization techniques used nowadays, which have some of the +Different synchronization techniques are used nowadays, which have some of the following tasks in common: \begin{itemize} \item Connect @@ -12,136 +12,148 @@ \item Commit changes \item Disconnect \end{itemize} -Those tasks are in common for synchronization technique/protocol, but differ in -detail to fit the needs for different circumstances to meet the best efficiency. -Such circumstances could be: +Those tasks are common for synchronization technique/protocol, but differ in +detail, in order to fit the needs for different circumstances and to meet the +best efficiency. Such circumstances could be: \begin{itemize} - \item Number of synchronization parties. If the number of synchronization + \item Number of synchronization parties. If number of synchronization parties is two, then multiplying of changes is just simple duplication of the change. - \item Unidirectional/Bidirectional synchronization. On unidirectional - synchronization no conflict resolution required for two parties. - \item Resource. Depending of the type of data resource further work is required + \item Unidirectional/Bidirectional synchronization. For unidirectional + synchronization, no conflict resolution is required for two parties. + \item Resource. Depending of the type of data resource, further work is required to get changes. Is the resource able to tell which data changed since the last - synchronization, by its own? Or is further help/facility required to detect - which data changed since the last sync. Example: file systems, databases, - stacked data in a single file, ... + synchronization, on its own, or is further help/facility required to detect + which data changed since the last sync? For example: file systems, databases, + or stacked data in a single file. + % The following item is still quite awkward. \item Type of data. Is the data in a consistent format and supported by all - parties? File synchronization. Is the data not consistent and contains unique - information which doesn't allow to do a binary compare? Weak compare? Is + parties? File synchronization. Is the data inconsistent and does it contain unique + information which doesn't allow for a binary compare? Weak compare? Is conversion to a common format for different parties required? - \item Protocol. Does the protocol require to read only the latest changes or - all at once? - \item Transport. Are various transport layer involved? Does it require to - connect and disconnect in a specified way? Limited bandwidth? Example: - Bluetooth, USB, ... + \item Protocol. Does the protocol require reading only the latest changes or + all changes at once? + \item Transport. Are various transport layers involved? Does it need to + connect and disconnect in a specified way? Limited bandwidth? For example: + Bluetooth, or USB. \end{itemize} -You see, there lots of different circumstances which makes it quite complicated -to meet all the needs of different ways to synchronize and synchronization -protocols.\\ -This is also only the tip of the iceberg, since it describes only the -synchronization role of the ">Server"<. +There are many different circumstances, which makes meeting all the needs of different +ways to synchronize quite comlpicated.\\ +% You see, there are many different circumstances which make it quite complicated +% to meet all the needs of different ways to synchronize and synchronization +% protocols.\\ +This is only the tip of the iceberg, since it describes only the +synchronization role of the ``Server''. \section{Synchronization Role} -The term ">Server"< is quite confusing, +The term ``Server'' is quite confusing, especially in the combination of a synchronization protocol which uses a -transport protocol based on the ">Client"<- and ">Server<"-Model. Most famous -example is ">SyncML"<, which support among others the HTTP and OBEX protocol as -transport. You might know ">HTTP Server"< like the Apache Webserver and ">HTTP -Client"< like the Firefox Webbrowser. In SyncML you can have for example (same -for other transports supported by SyncML): +transport protocol based on the \emph{Client}- and \emph{Server}-Model. The most famous +example is \emph{SyncML}, which supports, among others, the HTTP and OBEX protocol for +transport. You might know \emph{HTTP Server} like the Apache Webserver and \emph{HTTP +Client} like the Firefox Webbrowser. In \emph{SyncML} you can have for example: \begin{itemize} \item HTTP Server transport and act as Synchronization Server \item HTTP Client transport and act as Synchronization Server \item HTTP Server transport and act as Synchronization Client \item HTTP Client transport and act as Synchronization Client \end{itemize} -OpenSync doesn't care much about Transport Server/Client role, this is -up to the Plugins. There is only a little detail which OpenSync have to care -about plugin when they're acting as the transport Server role, which is about +Likewise for other transport protocols supported be \emph{SyncML} + +% the second sentence is awkward +OpenSync doesn't care much about the Transport Server/Client role, this is +up to the Plugins. There is only a little detail that OpenSync has to care +about the plugin, when it is acting in the transport Server role, which is that the plugin has to be initialized all the time so the client can connect. More about this in the Plugin chapter.\\ \\ -Unfortunately OpenSync supports in version 0.40 only the Synchronization role -Server. The passive role as Synchronization Client isn't yet implemented, but is +Unfortunately, in version 0.40, OpenSync only supports the Synchronization Server +role. The passive role as Synchronization Client isn't yet implemented, but is on the top of the project agenda. The reason for this is that the current implementation of synchronization tasks/steps mentioned above are currently -fixed. As Synchronization Client the order and number of this synchronization -steps/tasks would differ to the Server role. More about this issue you can find +fixed. As a Synchronization Client, the order and number of this synchronization +steps/tasks would differ from the Server role. You can find more about this issue in the Framework Chapter in section Synchronization Role. \section{Slow Sync} -Various Synchronization protocols are using so called ">Slow Sync"< +Various Synchronization protocols are using the so called \emph{Slow Sync} synchronization technique. This consists of two types of synchronizations, the -already mentioned ">Slow Sync"< and a regular Synchronization (sometimes called -">Fast Sync<"). The difference between the Slow and the regular (Fast) Sync is +already mentioned \emph{Slow Sync} and a regular Synchronization (sometimes called +\emph{Fast Sync}). The difference between the Slow and the regular (Fast) Sync is that the regular one only transfers changes since the last synchronization. -This means on a regular synchronization not all entries have to be transfered, +This means, on a regular synchronization, not all entries have to be transfered, or converted. This makes the synchronization quite efficient and very fast. The -so called ">Slow Sync"< requests intentionally all entries, which makes the -synchronization a bit slower. Additionally the Synchronization Framework has to +so called \emph{Slow Sync} intentionally requests all entries, which makes the +synchronization a bit slower. Additionally, the Synchronization Framework has to interpret every single entry/change as newly added, since the Framework vanished -in advance the entire mappings and has to compare every single reported entry -from each party and find the fitting counterpart. This and the combination of -transferring all entries makes the synchronization compared to the regular -(Fast) synchronization very slow. The ">Slow Sync"< is only used in certain -cases to avoid data inconsistence and to keep all the data in sync. ">Slow -Sync"< got emitted in following circumstances: +in advance of the entire mappings and has to compare every single reported entry +from each party and find the fitting counterpart. This, and the transferring of +all entries, makes the synchronization much slower when compared with the regular +(Fast) synchronization. The \emph{Slow Sync} is only used in certain +cases to avoid data inconsistence and to keep all the data in sync. \emph{Slow +Sync} is emitted in following circumstances: \begin{itemize} \item First/Initial Synchronization -\item Party got reseted (same as first sync) -\item Party got synchronized in meanwhile within another environment +\item Party has been reset (same as first sync) +\item Party has been synchronized within another environment \item After an aborted/failed synchronization \end{itemize} + \section{Object Types} -The term ">Object Types"< is in OpenSync used to describe the type/category of -data. Example for ">Object Types"< are Contacts, Events, Todos, Notes or plain -Data (like the content of a file) and others. (It's not limited to PIM Data!). -Those Object Types get separated processed, to make it configurable which -Object Type should get synchronized. Example: Only synchronize contacts of the +The term \emph{Object Types} is used in OpenSync to describe the type/category of +data. Examples of \emph{Object Types} are Contacts, Events, Todos, Notes or plain +Data (like the content of a file). It's not limited to PIM Data! +Those Object Types processed separately, to make it configurable which +Object Type should get synchronized. For example: only synchronize contacts of the mobile, no events, todos nor notes. + \section{Formats} The ability to synchronize different Parties which use different formats, makes the OpenSync Framework to a very powerful Synchronization Framework. In OpenSync -each Format is associated with one Object Type (see previous chapter). This +each Format is associated with one Object Type (see previous chapter). Having this Object Type as common denominator for different formats makes it possible to determine a conversion path between different formats. The conversion path consists of various format converters, which are provided by Format Plugins. -Example: Two parties should synchronize their contacts (the Object Type). Party + +For example: two parties should synchronize their contacts (the Object Type). Party A stores the contacts as VCard 3.0 and Party B stores the contacts in some -Binary Format. To synchronize the VCard 3.0 and the Random Binary Contact Format +Binary Format. To synchronize the VCard 3.0 and the Random Binary Contact Format, format plugins have to register those formats and provide converters. The -Plugins don't have to provide converters for every known Format, often a certain +Plugins don't have to provide converters for every known Format; often a certain amount of converters to common formats or a common denominator format is enough to create a conversion path between VCard 3.0 to Binary Contact Format. + \section{Mappings} -If an entry got changed on one Party, the logical same entry has to be updated -on the other parties while synchronization. Often different parties use -different ids to identify their entries. So it's required to map the logical -same entries which each others native id. The combination of those different -entries on different parties are called ">Mappings"<. Those ">Mappings"< make it +If an entry has been changed on one Party, the logical same entry has to be updated +on the other parties during synchronization. Different parties often use +different ids to identify their entries. So it is necessary to map the logical +same entries to each others native id. + +The combination of those different +entries on different parties are called \emph{Mappings}. Those \emph{Mappings} make it possible to determine a conflict if mapped entries got changed on different parties the same time in a different way. + \section{Conflicts} -So called ">Conflicts"< appear if at least two entries of the same mapping got +So called \emph{Conflicts} appear if at least two entries of the same mapping got changed in a different way. No conflict appears if all entries of the mapping -changed the same way. Such conflicts have to be handled by the Synchronization +changed the same way. Conflicts have to be handled by the Synchronization Framework to avoid data loss. There are several ways to solve such conflicts. -OpenSync provides several different for a proper conflict resolution without -gaining unintended loss of data. Following conflict resolution are supported by +OpenSync provides several different methods for a proper conflict resolution without +unintended loss of data. The following conflict resolution methods are supported by the OpenSync Framework: \begin{itemize} \item Solve, means intentionally choosing one of the conflicting entries to -solve the conflict. The chosen one will be multiplied to all parties and will -overwrite the other conflicting changes. This also allows to configure in -advance who is the ">Winning"< Party, who's changes will always used as the -solving change (">master change"<) for the conflict. -\item Duplicate, (intentionally) will duplicate all changed entries. +solve the conflict. The chosen entry will be multiplied to all parties and will +overwrite the other conflicting changes. This also permits the user to configure in +advance who is the \emph{Winning} Party, who's changes will always used as the +solving change (\emph{master change}) for the conflict. +\item Duplicate, will (intentionally) duplicate all changed entries. \item Latest, using the latest changed entry of the conflicting entries. This is -only an conflict resolution option if all changes provide within their formats -enough information to determine which got most recently changed. -\item Ignoring, (temporarily) the conflict till the next synchronization. +only a conflict resolution option if all changes provide enough information within +their formats to determine which one was changed most recently. +\item Ignoring, (temporarily) the conflict until the next synchronization. Conflicting entries will be read and compared again by the OpenSync Framework on the next synchronization. To avoid inconsistence and data loss. If the entries/changes are equal on the next synchronization the conflict is solved as @@ -151,4 +163,4 @@ \section{Capabilities} \section{Filter} OpenSync provides initial code for filtering, but it's not yet usable within -OpenSync 0.40. Looking forward to OpenSync 0.41! +OpenSync 0.40. Look forward to OpenSync 0.41! |
From: <svn...@op...> - 2009-04-16 15:23:09
|
Author: bellmich Date: Thu Apr 16 17:22:51 2009 New Revision: 1052 URL: http://libsyncml.opensync.org/changeset/1052 Log: If there are no options then don't use new_with_options. (This can result in an unexpected va_list handling by libsoup.) Modified: trunk/libsyncml/transports/http_client.c Modified: trunk/libsyncml/transports/http_client.c ============================================================================== --- trunk/libsyncml/transports/http_client.c Thu Apr 16 15:10:20 2009 (r1051) +++ trunk/libsyncml/transports/http_client.c Thu Apr 16 17:22:51 2009 (r1052) @@ -318,12 +318,12 @@ NULL); } else { #ifdef HAVE_LIBSOUP22_SOLARIS - env->session = soup_session_sync_new_with_options( + env->session = soup_session_sync_new(); #else env->session = soup_session_async_new_with_options( SOUP_SESSION_ASYNC_CONTEXT, env->tsp->context, -#endif NULL); +#endif } } if (!env->session) { |
From: <svn...@op...> - 2009-04-16 13:10:24
|
Author: bellmich Date: Thu Apr 16 15:10:20 2009 New Revision: 1051 URL: http://libsyncml.opensync.org/changeset/1051 Log: - one additional test - fixed number of changes in some sync calls Modified: trunk/tests/check_ds.c Modified: trunk/tests/check_ds.c ============================================================================== --- trunk/tests/check_ds.c Thu Apr 16 15:09:32 2009 (r1050) +++ trunk/tests/check_ds.c Thu Apr 16 15:10:20 2009 (r1051) @@ -337,6 +337,7 @@ sml_fail_unless(GPOINTER_TO_INT(userdata) == 1 || GPOINTER_TO_INT(userdata) == 2, NULL); if (GPOINTER_TO_INT(userdata) == 1) { + sml_fail_unless(newuid != NULL, NULL); sml_fail_unless(!strcmp(newuid, "newuid"), NULL); } else { sml_fail_unless(newuid == NULL, NULL); @@ -1294,7 +1295,7 @@ usleep(500); } - smlDsSessionSendSync(client_corr->dsession, 0, _sync_reply, GINT_TO_POINTER(1), &error); + smlDsSessionSendSync(client_corr->dsession, 1, _sync_reply, GINT_TO_POINTER(1), &error); sml_fail_unless(smlDsSessionQueueChange(client_corr->dsession, SML_CHANGE_ADD, "uid", "data", 4, SML_ELEMENT_TEXT_VCARD, _add_reply, GINT_TO_POINTER(2), &error), NULL); sml_fail_unless(error == NULL, NULL); @@ -1316,7 +1317,7 @@ usleep(500); } - smlDsSessionSendSync(server_corr->dsession, 0, _sync_reply, GINT_TO_POINTER(1), &error); + smlDsSessionSendSync(server_corr->dsession, 1, _sync_reply, GINT_TO_POINTER(1), &error); sml_fail_unless(smlDsSessionQueueChange(server_corr->dsession, SML_CHANGE_ADD, "uid", "data", 4, SML_ELEMENT_TEXT_VCARD, _add_reply, GINT_TO_POINTER(1), &error), NULL); sml_fail_unless(error == NULL, NULL); |
From: <svn...@op...> - 2009-04-16 13:09:44
|
Author: bellmich Date: Thu Apr 16 15:09:32 2009 New Revision: 1050 URL: http://libsyncml.opensync.org/changeset/1050 Log: small fixes for the mapping callback Modified: trunk/libsyncml/objects/sml_ds_server.h trunk/libsyncml/objects/sml_ds_server_internals.h Modified: trunk/libsyncml/objects/sml_ds_server.h ============================================================================== --- trunk/libsyncml/objects/sml_ds_server.h Thu Apr 16 15:08:03 2009 (r1049) +++ trunk/libsyncml/objects/sml_ds_server.h Thu Apr 16 15:09:32 2009 (r1050) @@ -43,6 +43,9 @@ typedef void (* SmlDsSessionSyncCb) (SmlDsSession *dsession, unsigned int numchanges, void *userdata); typedef void (* SmlDsSessionEventCb) (SmlDsSession *dsession, SmlDsEvent event, void *userdata); typedef SmlBool (* SmlDsSessionChangesCb) (SmlDsSession *dsession, SmlChangeType type, const char *uid, char *data, unsigned int size, const char *contenttype, void *userdata, SmlError **error); +/* FIXME: newuid must be removed before next API break */ +/* FIXME: an internal mapping callback already exists */ +/* FIXME: DEPRECATED */ typedef void (* SmlDsSessionWriteCb) (SmlDsSession *dsession, SmlStatus *status, const char *newuid, void *userdata); SmlDsServer *smlDsServerNew(const char *type, SmlLocation *location, SmlError **error); Modified: trunk/libsyncml/objects/sml_ds_server_internals.h ============================================================================== --- trunk/libsyncml/objects/sml_ds_server_internals.h Thu Apr 16 15:08:03 2009 (r1049) +++ trunk/libsyncml/objects/sml_ds_server_internals.h Thu Apr 16 15:09:32 2009 (r1050) @@ -30,7 +30,7 @@ #ifndef _SML_DS_SERVER_INTERNALS_H_ #define _SML_DS_SERVER_INTERNALS_H_ -typedef SmlBool (* SmlDsSessionMapCb) (SmlDsSession *dsession, SmlLocation *orig, SmlLocation *mapped, void *userdata); +typedef void (* SmlDsSessionMapCb) (SmlDsSession *dsession, SmlLocation *orig, SmlLocation *mapped, void *userdata); typedef struct SmlWriteContext { SmlDsSessionWriteCb callback; |
From: <svn...@op...> - 2009-04-16 13:08:11
|
Author: bellmich Date: Thu Apr 16 15:08:03 2009 New Revision: 1049 URL: http://libsyncml.opensync.org/changeset/1049 Log: added support for a separate mapping callback Modified: trunk/libsyncml/data_sync_api/callbacks.h trunk/libsyncml/data_sync_api/data_sync.c trunk/libsyncml/data_sync_api/data_sync.h trunk/libsyncml/data_sync_api/data_sync_callbacks.c trunk/libsyncml/data_sync_api/data_sync_callbacks.h Modified: trunk/libsyncml/data_sync_api/callbacks.h ============================================================================== --- trunk/libsyncml/data_sync_api/callbacks.h Thu Apr 16 14:31:29 2009 (r1048) +++ trunk/libsyncml/data_sync_api/callbacks.h Thu Apr 16 15:08:03 2009 (r1049) @@ -52,12 +52,21 @@ unsigned int size, void *userdata, SmlError **error); +/* FIXME: newuid must be removed before next API break */ +/* FIXME: DEPRECATED */ typedef SmlBool (* SmlDataSyncChangeStatusCallback) ( SmlDataSyncObject *dsObject, unsigned int code, const char *newuid, void *userdata, SmlError **error); +typedef SmlBool (* SmlDataSyncMappingCallback) ( + SmlDataSyncObject *dsObject, + const char *source, + const char *orig, + const char *newuid, + void *userdata, + SmlError **error); typedef char *(* SmlDataSyncGetAnchorCallback) ( SmlDataSyncObject *dsObject, const char *name, @@ -99,6 +108,10 @@ SmlDataSyncObject *dsObject, SmlDataSyncChangeCallback callback, void *userdata); +void smlDataSyncRegisterMappingCallback( + SmlDataSyncObject *dsObject, + SmlDataSyncMappingCallback callback, + void *userdata); void smlDataSyncRegisterGetAnchorCallback( SmlDataSyncObject *dsObject, SmlDataSyncGetAnchorCallback callback, Modified: trunk/libsyncml/data_sync_api/data_sync.c ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync.c Thu Apr 16 14:31:29 2009 (r1048) +++ trunk/libsyncml/data_sync_api/data_sync.c Thu Apr 16 15:08:03 2009 (r1049) @@ -37,6 +37,7 @@ #include "data_sync_devinf.h" #include "data_sync_loop.h" #include "transport.h" +#include "libsyncml/objects/sml_ds_server_internals.h" /* ********************************* */ /* object creation and configuration */ @@ -431,6 +432,31 @@ smlTrace(TRACE_EXIT, "%s", __func__); } +void smlDataSyncRegisterMapCallback( + SmlDataSyncObject *dsObject, + SmlDataSyncMappingCallback callback, + void *userdata) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + smlAssert(dsObject); + smlAssert(callback); + + dsObject->mappingCallback = callback; + dsObject->mappingUserdata = userdata; + + GList *o = dsObject->datastores; + for (;o;o = o->next) { + SmlDataSyncDatastore *datastore = o->data; + if (datastore->session) { + smlDsSessionGetMapping(datastore->session, + smlDataSyncMappingCallback, datastore); + } + } + + smlTrace(TRACE_EXIT, "%s", __func__); +} + + void smlDataSyncRegisterGetAnchorCallback( SmlDataSyncObject *dsObject, SmlDataSyncGetAnchorCallback callback, Modified: trunk/libsyncml/data_sync_api/data_sync.h ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync.h Thu Apr 16 14:31:29 2009 (r1048) +++ trunk/libsyncml/data_sync_api/data_sync.h Thu Apr 16 15:08:03 2009 (r1049) @@ -175,6 +175,9 @@ SmlDataSyncChangeStatusCallback changeStatusCallback; + SmlDataSyncMappingCallback mappingCallback; + void *mappingUserdata; + SmlDataSyncGetAnchorCallback getAnchorCallback; void *getAnchorUserdata; Modified: trunk/libsyncml/data_sync_api/data_sync_callbacks.c ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync_callbacks.c Thu Apr 16 14:31:29 2009 (r1048) +++ trunk/libsyncml/data_sync_api/data_sync_callbacks.c Thu Apr 16 15:08:03 2009 (r1049) @@ -385,6 +385,8 @@ smlDataSyncSyncCallback, datastore); smlDsSessionGetChanges(datastore->session, smlDataSyncChangeCallback, datastore); + smlDsSessionGetMapping(datastore->session, + smlDataSyncMappingCallback, datastore); } smlDsSessionRef(dsession); } @@ -634,6 +636,41 @@ smlTrace(TRACE_EXIT_ERROR, "%s - %s", __func__, smlErrorPrint(&error)); smlErrorDeref(&error); } + +void smlDataSyncMappingCallback( + SmlDsSession *dsession, + SmlLocation *orig, + SmlLocation *newuid, + void *userdata) +{ + smlTrace(TRACE_ENTRY, "%s(%p, %s, %s, %p)", __func__, dsession, VA_STRING(smlLocationGetURI(orig)), VA_STRING(smlLocationGetURI(newuid)), userdata); + + SmlError *error = NULL; + SmlDataSyncDatastore *datastore = userdata; + + smlAssert(datastore); + smlAssert(datastore->dsObject); + smlAssert(datastore->dsObject->mappingCallback); + + /* perform callback */ + if (!datastore->dsObject->mappingCallback( + datastore->dsObject, datastore->sourceUri, + smlLocationGetURI(orig), + smlLocationGetURI(newuid), + datastore->dsObject->mappingUserdata, + &error)) + goto error; + + smlTrace(TRACE_EXIT, "%s", __func__); + return; +error: + smlErrorRef(&error); + smlDataSyncSendEvent( + datastore->dsObject, SML_DATA_SYNC_EVENT_ERROR, + datastore->dsObject->eventUserdata, error); + smlTrace(TRACE_EXIT_ERROR, "%s - %s", __func__, smlErrorPrint(&error)); + smlErrorDeref(&error); +} /* ********************************* */ /* ***** Map Callbacks ***** */ Modified: trunk/libsyncml/data_sync_api/data_sync_callbacks.h ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync_callbacks.h Thu Apr 16 14:31:29 2009 (r1048) +++ trunk/libsyncml/data_sync_api/data_sync_callbacks.h Thu Apr 16 15:08:03 2009 (r1049) @@ -89,6 +89,12 @@ const char *newuid, void *userdata); +void smlDataSyncMappingCallback( + SmlDsSession *dsession, + SmlLocation *orig, + SmlLocation *newuid, + void *userdata); + /* ********************************* */ /* ***** Map Callbacks ***** */ /* ********************************* */ |
From: <svn...@op...> - 2009-04-16 12:31:42
|
Author: bellmich Date: Thu Apr 16 14:31:29 2009 New Revision: 1048 URL: http://libsyncml.opensync.org/changeset/1048 Log: introduced internal mapping function A change can now be freed after the status was received. Modified: trunk/libsyncml/objects/sml_ds_server.c trunk/libsyncml/objects/sml_ds_server_internals.h Modified: trunk/libsyncml/objects/sml_ds_server.c ============================================================================== --- trunk/libsyncml/objects/sml_ds_server.c Wed Apr 15 17:05:26 2009 (r1047) +++ trunk/libsyncml/objects/sml_ds_server.c Thu Apr 16 14:31:29 2009 (r1048) @@ -79,38 +79,39 @@ smlTrace(TRACE_INTERNAL, "%s: Dispatching: uid %s, Type %i, newuid %s, result %i", __func__, VA_STRING(ctx->uid), ctx->type, VA_STRING(ctx->newuid), smlStatusGetCode(ctx->status)); - if (((ctx->type != SML_CHANGE_ADD || smlStatusGetClass(ctx->status) != SML_ERRORCLASS_SUCCESS) && !ctx->newuid) || dsession->server->servertype == SML_DS_CLIENT) { - ctx->callback(dsession, ctx->status, NULL, ctx->userdata); - - g_mutex_lock(dsession->pendingMapsLock); - dsession->pendingMaps = g_list_remove(dsession->pendingMaps, ctx); - g_mutex_unlock(dsession->pendingMapsLock); - _write_context_free(ctx); - - smlTrace(TRACE_EXIT, "%s", __func__); - return; - } - - if (!ctx->newuid) { + if (ctx->type == SML_CHANGE_ADD && + smlStatusGetClass(ctx->status) == SML_ERRORCLASS_SUCCESS && + !dsession->recvMappingCallback && + !ctx->newuid && + dsession->server->servertype == SML_DS_SERVER) + { smlTrace(TRACE_EXIT, "%s: No mapitem yet", __func__); return; } - + ctx->callback(dsession, ctx->status, ctx->newuid, ctx->userdata); g_mutex_lock(dsession->pendingMapsLock); dsession->pendingMaps = g_list_remove(dsession->pendingMaps, ctx); g_mutex_unlock(dsession->pendingMapsLock); - _write_context_free(ctx); - /* FIXME: Are you sure about this comment? */ - // Now there are no more MapItems ... do some fancy callback. Some applications will love it ;) - if (dsession->recvEventCallback && !dsession->pendingMaps) { + if (ctx->type == SML_CHANGE_ADD && + smlStatusGetClass(ctx->status) == SML_ERRORCLASS_SUCCESS && + dsession->recvEventCallback && + !dsession->pendingMaps) + { + /* FIXME: I'm sure that this event is buggy. + * FIXME: What is the semantic of this event? + * Now there are no more MapItems ... + * do some fancy callback. Some applications will love it ;) + */ dsession->recvEventCallback(dsession, SML_DS_EVENT_COMMITEDCHANGES, dsession->recvEventCallbackUserdata); smlTrace(TRACE_INTERNAL, "%s: recvEventCallback commited changes callback", __func__); } - smlTrace(TRACE_EXIT, "%s: Dispatched add", __func__); + _write_context_free(ctx); + + smlTrace(TRACE_EXIT, "%s", __func__); } static void _alert_reply(SmlSession *session, SmlStatus *status, void *userdata) @@ -898,10 +899,24 @@ GList *m = NULL; for (m = cmd->private.map.items; m; m = m->next) { SmlMapItem *item = m->data; - SmlWriteContext *ctx = _write_context_find(dsession, item->target->locURI, SML_CHANGE_ADD); - if (ctx) { - ctx->newuid = g_strdup(item->source->locURI); - _write_context_dispatch(dsession, ctx); + + if (dsession->recvMappingCallback) { + dsession->recvMappingCallback( + dsession, + item->target, + item->source, + dsession->recvMappingCallbackUserdata); + } else { + SmlWriteContext *ctx = _write_context_find(dsession, item->target->locURI, SML_CHANGE_ADD); + if (ctx) { + ctx->newuid = g_strdup(item->source->locURI); + _write_context_dispatch(dsession, ctx); + } else { + smlTrace(TRACE_ERROR, "%s: Unknown map ... %s => %s", + __func__, + VA_STRING(item->target->locURI), + VA_STRING(item->source->locURI)); + } } } @@ -980,6 +995,17 @@ return FALSE; } +void smlDsSessionGetMapping( + SmlDsSession *dsession, + SmlDsSessionMapCb mapCallback, + void *userdata) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + dsession->recvMappingCallback = mapCallback; + dsession->recvMappingCallbackUserdata = userdata; + smlTrace(TRACE_EXIT, "%s", __func__); +} + /** @brief Gets a already received sync command * * This function will get a already received sync command or register a callback that will be Modified: trunk/libsyncml/objects/sml_ds_server_internals.h ============================================================================== --- trunk/libsyncml/objects/sml_ds_server_internals.h Wed Apr 15 17:05:26 2009 (r1047) +++ trunk/libsyncml/objects/sml_ds_server_internals.h Thu Apr 16 14:31:29 2009 (r1048) @@ -30,6 +30,8 @@ #ifndef _SML_DS_SERVER_INTERNALS_H_ #define _SML_DS_SERVER_INTERNALS_H_ +typedef SmlBool (* SmlDsSessionMapCb) (SmlDsSession *dsession, SmlLocation *orig, SmlLocation *mapped, void *userdata); + typedef struct SmlWriteContext { SmlDsSessionWriteCb callback; char *uid; @@ -77,7 +79,7 @@ SmlStatusReplyCb sentSyncCallback; void *sentSyncCallbackUserdata; - /** Callback that will infomration about the Ds Session events */ + /** Callback that will information about the Ds Session events */ SmlDsSessionEventCb recvEventCallback; void *recvEventCallbackUserdata; @@ -87,8 +89,11 @@ GList *pendingMaps; GMutex *pendingMapsLock; GList *mapItems; - //SmlCommand *mapCommand; - + + /** Callback that signals mappings */ + SmlDsSessionMapCb recvMappingCallback; + void *recvMappingCallbackUserdata; + GMutex *write_lock; GMutex *lock; }; @@ -120,5 +125,7 @@ SmlDsSession *smlDsSessionNew(SmlDsServer *server, SmlSession *session, SmlError **error); void smlDsSessionFree(SmlDsSession *dsession); +void smlDsSessionGetMapping(SmlDsSession *dsession, SmlDsSessionMapCb mapCallback, void *userdata); + #endif //_SML_DS_SERVER_INTERNALS_H_ /*@}*/ |
From: <svn...@op...> - 2009-04-15 20:48:44
|
Author: scriptor Date: Wed Apr 15 22:48:31 2009 New Revision: 5614 URL: http://www.opensync.org/changeset/5614 Log: Modified command line parsing in orientation towards http://www.opensync.org/ticket/853 Modified: plugins/ldap-sync/misc/ldap_format_convert.c plugins/ldap-sync/tests/check_do_convert_from_to.c Modified: plugins/ldap-sync/misc/ldap_format_convert.c ============================================================================== --- plugins/ldap-sync/misc/ldap_format_convert.c Tue Apr 14 20:27:12 2009 (r5613) +++ plugins/ldap-sync/misc/ldap_format_convert.c Wed Apr 15 22:48:31 2009 (r5614) @@ -942,9 +942,7 @@ program = argv[0]; - input_filename = argv[1]; - - for (i = 2; i < argc; i++) { + for (i = 1; i < argc; i++) { char *arg = argv[i]; @@ -996,6 +994,7 @@ } else if (!strcmp (arg, "--to-ldap-note")) { detection_type = TARGET_LDAP_NOTE; + } else if (!strcmp (arg, "--out")) { if (!strncmp(argv[i + 1], "--", 2)) { osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: Output filename MUST NOT begin with \'--\'. Use --help, if necessary.", __FILE__, __LINE__); @@ -1012,6 +1011,7 @@ } else { output_filename = argv[i + 1]; i++; + continue; } } else if (!strcmp (arg, "--")) { @@ -1021,14 +1021,24 @@ osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: \"-\" is an invalid option. Use --help, if necessary.\n", __FILE__, __LINE__); goto error; - } else { - osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: Unknown option.\n", __FILE__, __LINE__); + } else if (arg[0] == '-' && arg[1] != 0) { + osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: Unknown option\"%s\".\n", __FILE__, __LINE__, arg); goto error; + + } else { + input_filename = arg; + + } + } + if (i < argc && argv[i + 1]) { + if (argv[i + 1][0]) { + input_filename = argv[i + 1]; } } + // Check input_filename if (input_filename == NULL) { osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: input_filename = NULL. input_filename has not been set.", __FILE__, __LINE__); @@ -1036,6 +1046,10 @@ goto error; } + + osync_trace(TRACE_INTERNAL, "input_filename = \"%s\", i = %i, argc = %i\n", input_filename, i, argc); + + if (input_filename[0] == 0) { osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: input_filename[0] = 0. input_filename has not been set.", __FILE__, __LINE__); Modified: plugins/ldap-sync/tests/check_do_convert_from_to.c ============================================================================== --- plugins/ldap-sync/tests/check_do_convert_from_to.c Tue Apr 14 20:27:12 2009 (r5613) +++ plugins/ldap-sync/tests/check_do_convert_from_to.c Wed Apr 15 22:48:31 2009 (r5614) @@ -942,9 +942,7 @@ program = argv[0]; - input_filename = argv[1]; - - for (i = 2; i < argc; i++) { + for (i = 1; i < argc; i++) { char *arg = argv[i]; @@ -996,6 +994,7 @@ } else if (!strcmp (arg, "--to-ldap-note")) { detection_type = TARGET_LDAP_NOTE; + } else if (!strcmp (arg, "--out")) { if (!strncmp(argv[i + 1], "--", 2)) { osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: Output filename MUST NOT begin with \'--\'. Use --help, if necessary.", __FILE__, __LINE__); @@ -1012,6 +1011,7 @@ } else { output_filename = argv[i + 1]; i++; + continue; } } else if (!strcmp (arg, "--")) { @@ -1021,14 +1021,24 @@ osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: \"-\" is an invalid option. Use --help, if necessary.\n", __FILE__, __LINE__); goto error; - } else { - osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: Unknown option.\n", __FILE__, __LINE__); + } else if (arg[0] == '-' && arg[1] != 0) { + osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: Unknown option\"%s\".\n", __FILE__, __LINE__, arg); goto error; + + } else { + input_filename = arg; + + } + } + if (i < argc && argv[i + 1]) { + if (argv[i + 1][0]) { + input_filename = argv[i + 1]; } } + // Check input_filename if (input_filename == NULL) { osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: input_filename = NULL. input_filename has not been set.", __FILE__, __LINE__); @@ -1036,6 +1046,10 @@ goto error; } + + osync_trace(TRACE_INTERNAL, "input_filename = \"%s\", i = %i, argc = %i\n", input_filename, i, argc); + + if (input_filename[0] == 0) { osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: input_filename[0] = 0. input_filename has not been set.", __FILE__, __LINE__); |
From: <svn...@op...> - 2009-04-15 15:05:31
|
Author: bellmich Date: Wed Apr 15 17:05:26 2009 New Revision: 1047 URL: http://libsyncml.opensync.org/changeset/1047 Log: abort more carefully depending on the internal state Modified: trunk/libsyncml/data_sync_api/data_sync_abort.c Modified: trunk/libsyncml/data_sync_api/data_sync_abort.c ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync_abort.c Wed Apr 15 17:02:28 2009 (r1046) +++ trunk/libsyncml/data_sync_api/data_sync_abort.c Wed Apr 15 17:05:26 2009 (r1047) @@ -56,15 +56,22 @@ /* stop transport */ WORKAROUND: smlTrace(TRACE_INTERNAL, "%s: A hard abort is required.", __func__); - SmlLink *link_ = smlManagerSessionGetLink( - dsObject->manager, - dsObject->session, - error); - if (!link_ && *error) - goto error; - if (!smlTransportDisconnect(dsObject->tsp, link_, error)) - goto error; + if (SML_DATA_SYNC_STATE_CONNECTED <= dsObject->internalState && + dsObject->internalState < SML_DATA_SYNC_STATE_DISCONNECT_IN_PROGRESS) + { + dsObject->internalState = SML_DATA_SYNC_STATE_DISCONNECT_IN_PROGRESS; + + SmlLink *link_ = smlManagerSessionGetLink( + dsObject->manager, + dsObject->session, + error); + if (!link_ && *error) + goto error; + + if (!smlTransportDisconnect(dsObject->tsp, link_, error)) + goto error; + } } smlTrace(TRACE_EXIT, "%s", __func__); |
From: <svn...@op...> - 2009-04-15 15:02:40
|
Author: bellmich Date: Wed Apr 15 17:02:28 2009 New Revision: 1046 URL: http://libsyncml.opensync.org/changeset/1046 Log: unified the different internal state variables Modified: trunk/libsyncml/data_sync_api/data_sync.c trunk/libsyncml/data_sync_api/data_sync.h trunk/libsyncml/data_sync_api/data_sync_callbacks.c trunk/libsyncml/data_sync_api/transport_http_client.c Modified: trunk/libsyncml/data_sync_api/data_sync.c ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync.c Wed Apr 15 14:30:38 2009 (r1045) +++ trunk/libsyncml/data_sync_api/data_sync.c Wed Apr 15 17:02:28 2009 (r1046) @@ -60,8 +60,7 @@ dsObject->dsType = dsType; dsObject->tspType = tspType; dsObject->version = SML_VERSION_11; - dsObject->sentChanges = FALSE; - dsObject->isInitialized = FALSE; + dsObject->internalState = SML_DATA_SYNC_STATE_NEW; dsObject->useNumberOfChanges = TRUE; dsObject->useTimestampAnchor = TRUE; @@ -117,8 +116,11 @@ smlTrace(TRACE_EXIT, "%s - %p", __func__, dsObject); return dsObject; error: - if (dsObject) + if (dsObject) { + if (dsObject->tsp) + smlTransportFree(dsObject->tsp); smlDataSyncObjectUnref(&dsObject); + } smlTrace(TRACE_EXIT_ERROR, "%s - %s", __func__, smlErrorPrint(error)); return NULL; } @@ -514,8 +516,6 @@ CHECK_ERROR_REF smlAssert(dsObject); - dsObject->isConnected = FALSE; - if (!dsObject->identifier) dsObject->identifier = smlDataSyncDevInfGetIdentifier(); @@ -527,7 +527,7 @@ if (!dsObject->funcDsInit(dsObject, error)) goto error; - dsObject->isInitialized = TRUE; + dsObject->internalState = SML_DATA_SYNC_STATE_INITIALIZED; smlTrace(TRACE_EXIT, "%s - TRUE", __func__); return TRUE; @@ -650,13 +650,13 @@ /* Verify that the library is in the correct state */ - if (dsObject->sentChanges) + if (dsObject->internalState >= SML_DATA_SYNC_STATE_SENT_CHANGES) { smlErrorSet(error, SML_ERROR_GENERIC, - "The function %s is called more than once.", __func__); + "The function %s is called to late or more than once.", __func__); goto error; } else { - dsObject->sentChanges = TRUE; + dsObject->internalState = SML_DATA_SYNC_STATE_SENT_CHANGES; } if (dsObject->dsType == SML_SESSION_TYPE_SERVER && dsObject->actualPackage != SML_PACKAGE_4) @@ -830,8 +830,8 @@ if ((*dsObject)->tsp) { SmlError *error = NULL; if ((*dsObject)->dsType == SML_SESSION_TYPE_CLIENT && - (*dsObject)->isConnected && - !(*dsObject)->gotDisconnect && + SML_DATA_SYNC_STATE_CONNECTED >= (*dsObject)->internalState && + (*dsObject)->internalState <= SML_DATA_SYNC_STATE_DISCONNECTED && !smlTransportDisconnect((*dsObject)->tsp, NULL, &error)) { /* just ignore the error */ smlTrace(TRACE_ERROR, "%s: %s", @@ -839,7 +839,7 @@ smlErrorDeref(&error); } /* FIXME: we have to wait here for the disconnect ... */ - if ((*dsObject)->isInitialized && + if ((*dsObject)->internalState >= SML_DATA_SYNC_STATE_INITIALIZED && !smlTransportFinalize((*dsObject)->tsp, &error)) { smlTrace(TRACE_ERROR, "%s: %s", __func__, smlErrorPrint(&error)); Modified: trunk/libsyncml/data_sync_api/data_sync.h ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync.h Wed Apr 15 14:30:38 2009 (r1045) +++ trunk/libsyncml/data_sync_api/data_sync.h Wed Apr 15 17:02:28 2009 (r1046) @@ -75,6 +75,17 @@ SML_PACKAGE_END = 7, /* client after end received from server */ } SmlDataSyncPackageType; +typedef enum { + SML_DATA_SYNC_STATE_UNKNOWN = 0, + SML_DATA_SYNC_STATE_NEW = 1, + SML_DATA_SYNC_STATE_INITIALIZED = 2, + SML_DATA_SYNC_STATE_CONNECTED = 3, + SML_DATA_SYNC_STATE_SESSION_READY = 4, + SML_DATA_SYNC_STATE_SENT_CHANGES = 5, + SML_DATA_SYNC_STATE_DISCONNECT_IN_PROGRESS = 6, + SML_DATA_SYNC_STATE_DISCONNECTED = 7, +} SmlDataSyncInternalStateType; + /* typedefs for internal objects */ /*! @brief This object represents an OMA DS datastore. @@ -147,11 +158,7 @@ /* states */ - SmlBool isInitialized; - SmlBool isConnected; - SmlBool gotDisconnect; - SmlBool tryDisconnect; - SmlBool sentChanges; + SmlDataSyncInternalStateType internalState; int refCount; SmlDataSyncPackageType actualPackage; Modified: trunk/libsyncml/data_sync_api/data_sync_callbacks.c ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync_callbacks.c Wed Apr 15 14:30:38 2009 (r1045) +++ trunk/libsyncml/data_sync_api/data_sync_callbacks.c Wed Apr 15 17:02:28 2009 (r1046) @@ -60,11 +60,11 @@ case SML_MANAGER_SESSION_FLUSH: case SML_MANAGER_CONNECT_DONE: smlTrace(TRACE_INTERNAL, "%s: ignored event %d ", __func__, type); + dsObject->internalState = SML_DATA_SYNC_STATE_CONNECTED; break; case SML_MANAGER_SESSION_ESTABLISHED: smlTrace(TRACE_INTERNAL, "%s: session established", __func__); - dsObject->gotDisconnect = FALSE; - dsObject->isConnected = TRUE; + dsObject->internalState = SML_DATA_SYNC_STATE_SESSION_READY; smlDataSyncSendEvent( dsObject, SML_DATA_SYNC_EVENT_CONNECT, dsObject->eventUserdata, NULL); @@ -75,7 +75,7 @@ * then it is useless to handle the disconnect * event. */ - if (!dsObject->isConnected) + if (dsObject->internalState < SML_DATA_SYNC_STATE_CONNECTED) { smlTrace(TRACE_INTERNAL, "%s: ignored disconnect because never connected", @@ -110,7 +110,7 @@ } } - dsObject->gotDisconnect = TRUE; + dsObject->internalState = SML_DATA_SYNC_STATE_DISCONNECTED; smlDataSyncSendEvent( dsObject, SML_DATA_SYNC_EVENT_DISCONNECT, dsObject->eventUserdata, NULL); @@ -122,10 +122,10 @@ smlTrace(TRACE_INTERNAL, "There was an error in the transport: %s", smlErrorPrint(&error)); - if (dsObject->isConnected && - !dsObject->gotDisconnect) { - if (dsObject->tryDisconnect == FALSE) { - dsObject->tryDisconnect = TRUE; + if (SML_DATA_SYNC_STATE_CONNECTED <= dsObject->internalState && + dsObject->internalState < SML_DATA_SYNC_STATE_DISCONNECTED) { + if (dsObject->internalState < SML_DATA_SYNC_STATE_DISCONNECT_IN_PROGRESS) { + dsObject->internalState = SML_DATA_SYNC_STATE_DISCONNECT_IN_PROGRESS; SmlError *locerror = NULL; SmlLink *link_ = smlManagerSessionGetLink( dsObject->manager, @@ -162,7 +162,7 @@ */ } else { /* disconnect failed */ - dsObject->gotDisconnect = TRUE; + dsObject->internalState = SML_DATA_SYNC_STATE_DISCONNECTED; } } goto error; Modified: trunk/libsyncml/data_sync_api/transport_http_client.c ============================================================================== --- trunk/libsyncml/data_sync_api/transport_http_client.c Wed Apr 15 14:30:38 2009 (r1045) +++ trunk/libsyncml/data_sync_api/transport_http_client.c Wed Apr 15 17:02:28 2009 (r1046) @@ -132,8 +132,6 @@ smlTrace(TRACE_ENTRY, "%s(%p, %p)", __func__, dsObject, error); CHECK_ERROR_REF - dsObject->tryDisconnect = FALSE; - /* init new session */ if (!smlDataSyncTransportHttpClientInitNewSession(dsObject, error)) goto error; |
From: <svn...@op...> - 2009-04-15 12:30:56
|
Author: bellmich Date: Wed Apr 15 14:30:38 2009 New Revision: 1045 URL: http://libsyncml.opensync.org/changeset/1045 Log: committed patch from Henrik for ticket #228 Modified: trunk/libsyncml/objects/sml_devinf_obj.c trunk/libsyncml/transports/obex_client.c trunk/libsyncml/transports/obex_client_internals.h trunk/libsyncml/transports/obex_server.c Modified: trunk/libsyncml/objects/sml_devinf_obj.c ============================================================================== --- trunk/libsyncml/objects/sml_devinf_obj.c Wed Apr 15 14:08:41 2009 (r1044) +++ trunk/libsyncml/objects/sml_devinf_obj.c Wed Apr 15 14:30:38 2009 (r1045) @@ -29,7 +29,11 @@ #include <libsyncml/sml_command_internals.h> #include "libsyncml/sml_error_internals.h" +#ifdef WIN32 +#include <windef.h> +#else #include<sys/utsname.h> +#endif /* Design notice * @@ -371,6 +375,18 @@ smlDevInfSetModel(devinf, "libsyncml"); if (!smlDevInfGetOEM(devinf)) { +#ifdef WIN32 + smlDevInfSetOEM(devinf, "Windows"); + DWORD dwVersion = GetVersion(); + DWORD dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); + DWORD dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion))); + DWORD dwBuild = 0; + if (dwVersion < 0x80000000) dwBuild = (DWORD)(HIWORD(dwVersion)); + + char szVersion[1024]; + sprintf(szVersion, "%d.%d (%d)", dwMajorVersion, dwMinorVersion, dwBuild); + smlDevInfSetFirmwareVersion(devinf, szVersion); +#else struct utsname *buf = malloc(sizeof(struct utsname)); if (uname(buf) == 0) { @@ -378,6 +394,7 @@ smlDevInfSetFirmwareVersion(devinf, buf->release); } smlSafeFree((gpointer *)&buf); +#endif } if (!smlDevInfGetSoftwareVersion(devinf)) smlDevInfSetSoftwareVersion(devinf, VERSION); Modified: trunk/libsyncml/transports/obex_client.c ============================================================================== --- trunk/libsyncml/transports/obex_client.c Wed Apr 15 14:08:41 2009 (r1044) +++ trunk/libsyncml/transports/obex_client.c Wed Apr 15 14:30:38 2009 (r1045) @@ -37,23 +37,27 @@ #endif #include <fcntl.h> +#ifndef WIN32 #include <sys/poll.h> #include <sys/stat.h> -#include <sys/types.h> #include <termios.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> - -#include <stdio.h> #include <sys/socket.h> #include <arpa/inet.h> +#include <netinet/in.h> +#endif + +#include <sys/types.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <netinet/in.h> #include <strings.h> +#ifndef WIN32 + static SmlBool obex_cable_at( SmlTransportObexClientEnv *userdata, const char *cmd, @@ -408,6 +412,8 @@ } +#endif + static void smlTransportObexClientEvent(obex_t *handle, obex_object_t *object, int mode, int event, int obex_cmd, int obex_rsp) { smlTrace(TRACE_ENTRY, "%s(%p, %p, %i, %i, %i, %i)", __func__, handle, object, mode, event, obex_cmd, obex_rsp); @@ -727,6 +733,7 @@ return FALSE; } +#ifndef WIN32 if (env->type == SML_TRANSPORT_CONNECTION_TYPE_SERIAL) { obex_ctrans_t cabletrans = { smlTransportObexClientCableConnect, @@ -735,9 +742,9 @@ smlTransportObexClientCableWrite, obex_cable_handleinput, env}; - OBEX_RegisterCTransport(env->obexhandle, &cabletrans); } +#endif smlTrace(TRACE_EXIT, "%s", __func__); return TRUE; @@ -978,6 +985,7 @@ smlTrace(TRACE_INTERNAL, "%s: IrDA connect done", __func__); } else { +#ifndef WIN32 struct termios tio; memset(&tio, 0, sizeof(tio)); @@ -1020,6 +1028,7 @@ goto error_unlock; } tcflush(fd, TCIFLUSH); +#endif } if (env->type != SML_TRANSPORT_CONNECTION_TYPE_USB @@ -1083,8 +1092,10 @@ error_transport_close: OBEX_Cleanup(env->obexhandle); error_unlock: +#ifndef WIN32 if (!lockf(fd, F_ULOCK, 0)) smlTrace(TRACE_ERROR, "%s: error_unlock failed.", __func__); +#endif error_close: close(fd); error: Modified: trunk/libsyncml/transports/obex_client_internals.h ============================================================================== --- trunk/libsyncml/transports/obex_client_internals.h Wed Apr 15 14:08:41 2009 (r1044) +++ trunk/libsyncml/transports/obex_client_internals.h Wed Apr 15 14:30:38 2009 (r1045) @@ -25,8 +25,10 @@ #include "obex_bluetooth.h" #include <openobex/obex.h> +#ifndef WIN32 #include <termios.h> #include <sys/ioctl.h> +#endif #define STREAM_CHUNK 4096 @@ -61,8 +63,9 @@ char *databuf; int *databuflen; int connected; +#ifndef WIN32 struct termios oldtio; - +#endif SmlBool busy; SmlBool error; SmlMimeType mimetype; Modified: trunk/libsyncml/transports/obex_server.c ============================================================================== --- trunk/libsyncml/transports/obex_server.c Wed Apr 15 14:08:41 2009 (r1044) +++ trunk/libsyncml/transports/obex_server.c Wed Apr 15 14:30:38 2009 (r1045) @@ -28,6 +28,7 @@ #include "obex_internals.h" #include "obex_server_internals.h" +#ifndef WIN32 #include <fcntl.h> #include <sys/poll.h> #include <sys/stat.h> @@ -36,6 +37,7 @@ #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> +#endif static gboolean _dispatch_obex(gpointer data) { |
From: <svn...@op...> - 2009-04-15 12:08:53
|
Author: bellmich Date: Wed Apr 15 14:08:41 2009 New Revision: 1044 URL: http://libsyncml.opensync.org/changeset/1044 Log: ds means data store and not data sync Modified: trunk/tests/CMakeLists.txt trunk/tests/check_ds.c Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Wed Apr 15 14:07:55 2009 (r1043) +++ trunk/tests/CMakeLists.txt Wed Apr 15 14:08:41 2009 (r1044) @@ -206,19 +206,19 @@ SML_ADD_TESTCASE( md5_7 ) SML_END_TEST() - SML_START_TEST( "DataSync" datasync check_ds.c ${TEST_TARGET_LIBRARIES} ) - SML_ADD_TESTCASE( ds_server_new ) - SML_ADD_TESTCASE( ds_client_new ) - SML_ADD_TESTCASE( ds_send_alert ) - SML_ADD_TESTCASE( ds_send_alert2 ) - SML_ADD_TESTCASE( ds_send_empty_sync ) - SML_ADD_TESTCASE( ds_reply_empty_sync ) - SML_ADD_TESTCASE( ds_add ) - SML_ADD_TESTCASE( ds_add2 ) - SML_ADD_TESTCASE( ds_delete ) - SML_ADD_TESTCASE( ds_map_full ) - SML_ADD_TESTCASE( ds_add_large ) - SML_ADD_TESTCASE( ds_limit ) + SML_START_TEST( "DataStore" datastore check_ds.c ${TEST_TARGET_LIBRARIES} ) + SML_ADD_TESTCASE( datastore_server_new ) + SML_ADD_TESTCASE( datastore_client_new ) + SML_ADD_TESTCASE( datastore_send_alert ) + SML_ADD_TESTCASE( datastore_send_alert2 ) + SML_ADD_TESTCASE( datastore_send_empty_sync ) + SML_ADD_TESTCASE( datastore_reply_empty_sync ) + SML_ADD_TESTCASE( datastore_add ) + SML_ADD_TESTCASE( datastore_add2 ) + SML_ADD_TESTCASE( datastore_delete ) + SML_ADD_TESTCASE( datastore_map_full ) + SML_ADD_TESTCASE( datastore_add_large ) + SML_ADD_TESTCASE( datastore_limit ) SML_END_TEST() SML_START_TEST( "SAN" san check_san.c ${TEST_TARGET_LIBRARIES} ) Modified: trunk/tests/check_ds.c ============================================================================== --- trunk/tests/check_ds.c Wed Apr 15 14:07:55 2009 (r1043) +++ trunk/tests/check_ds.c Wed Apr 15 14:08:41 2009 (r1044) @@ -389,7 +389,7 @@ smlTrace(TRACE_EXIT, "%s", __func__); } -START_TEST (ds_server_new) +START_TEST (datastore_server_new) { setup_testbed(NULL); @@ -405,7 +405,7 @@ } END_TEST -START_TEST (ds_client_new) +START_TEST (datastore_client_new) { setup_testbed(NULL); @@ -505,7 +505,7 @@ /* Send Alert -> C -- Put, Alert --> S -> init_alert, get_alert, recv_alert * end session -> S -- Status --> C -> manager event (Session End) */ -START_TEST (ds_send_alert) +START_TEST (datastore_send_alert) { /* General setup */ setup_testbed(NULL); @@ -596,7 +596,7 @@ * S -- Status, Put, Alert --> C * C -- Status --> S * S -- Status --> C */ -START_TEST (ds_send_alert2) +START_TEST (datastore_send_alert2) { data_received = 0; init_alerts_received = 0; @@ -719,7 +719,7 @@ * S -- Status, Put, Alert --> C * C -- Status, Sync --> S * S -- Status --> S */ -START_TEST (ds_send_empty_sync) +START_TEST (datastore_send_empty_sync) { data_received = 0; init_alerts_received = 0; @@ -865,7 +865,7 @@ * S -- Status, Sync --> S * C -- Status --> S * S -- Status --> C */ -START_TEST (ds_reply_empty_sync) +START_TEST (datastore_reply_empty_sync) { data_received = 0; init_alerts_received = 0; @@ -1030,7 +1030,7 @@ * S -- Status, Sync --> S * C -- Status --> S * S -- Status --> C */ -START_TEST (ds_add) +START_TEST (datastore_add) { data_received = 0; init_alerts_received = 0; @@ -1206,7 +1206,7 @@ * S -- Status, Sync, Add --> S * C -- Status, Map --> S * S -- Status --> C */ -START_TEST (ds_add2) +START_TEST (datastore_add2) { data_received = 0; init_alerts_received = 0; @@ -1397,7 +1397,7 @@ * S -- Status, Sync, Delete --> S * C -- Status --> S * S -- Status --> C */ -START_TEST (ds_delete) +START_TEST (datastore_delete) { data_received = 0; init_alerts_received = 0; @@ -1485,7 +1485,7 @@ usleep(500); } - smlDsSessionSendSync(client_corr->dsession, 0, _sync_reply, GINT_TO_POINTER(1), &error); + smlDsSessionSendSync(client_corr->dsession, 1, _sync_reply, GINT_TO_POINTER(1), &error); sml_fail_unless(smlDsSessionQueueChange(client_corr->dsession, SML_CHANGE_DELETE, "uid", NULL, 0, SML_ELEMENT_TEXT_VCARD, _delete_reply, GINT_TO_POINTER(1), &error), NULL); sml_fail_unless(error == NULL, NULL); @@ -1507,7 +1507,7 @@ usleep(500); } - smlDsSessionSendSync(server_corr->dsession, 0, _sync_reply, GINT_TO_POINTER(1), &error); + smlDsSessionSendSync(server_corr->dsession, 1, _sync_reply, GINT_TO_POINTER(1), &error); sml_fail_unless(smlDsSessionQueueChange(server_corr->dsession, SML_CHANGE_DELETE, "uid", NULL, 0, SML_ELEMENT_TEXT_VCARD, _delete_reply, GINT_TO_POINTER(1), &error), NULL); sml_fail_unless(error == NULL, NULL); @@ -1579,7 +1579,7 @@ * S -- Status, Sync, Add, Replace, Delete --> S * C -- Status, Map --> S * S -- Status --> C */ -START_TEST (ds_map_full) +START_TEST (datastore_map_full) { data_received = 0; init_alerts_received = 0; @@ -1782,7 +1782,7 @@ * S -- Status, Sync, 500 * Add --> S * C -- Status, Map --> S * S -- Status --> C */ -START_TEST (ds_add_large) +START_TEST (datastore_add_large) { data_received = 0; init_alerts_received = 0; @@ -1979,7 +1979,7 @@ * C -- Status, Map --> S * S -- Status --> C */ /* Limit the sending size of both sides */ -START_TEST (ds_limit) +START_TEST (datastore_limit) { data_received = 0; init_alerts_received = 0; @@ -2172,7 +2172,7 @@ * C -- Status, Map --> S * S -- Status --> C */ /* Limit the sending size of both sides */ -START_TEST (ds_multi_server) +START_TEST (datastore_multi_server) { data_received = 0; init_alerts_received = 0; |
From: <svn...@op...> - 2009-04-15 12:08:03
|
Author: bellmich Date: Wed Apr 15 14:07:55 2009 New Revision: 1043 URL: http://libsyncml.opensync.org/changeset/1043 Log: fixed ticket #229 Modified: trunk/libsyncml/objects/sml_ds_server.c trunk/libsyncml/parser/sml_xml_assm.c trunk/libsyncml/sml_command.c Modified: trunk/libsyncml/objects/sml_ds_server.c ============================================================================== --- trunk/libsyncml/objects/sml_ds_server.c Wed Apr 15 11:43:37 2009 (r1042) +++ trunk/libsyncml/objects/sml_ds_server.c Wed Apr 15 14:07:55 2009 (r1043) @@ -155,14 +155,28 @@ SmlWriteContext *ctx = userdata; SmlDsSession *dsession = ctx->session; - if (status->type == SML_COMMAND_TYPE_ADD) { + /* Please see smlChangeAssemble in sml_xml_parser.c for + * a more detailed description on the checked behaviour. + * If the received command is an Add or the remote peer + * is an OMA DS client then the remote peer must send a + * Source. Otherwise a Target must be sent by the remote + * peer. We only check the required behaviour and not + * the optional one. + */ + if (status->type == SML_COMMAND_TYPE_ADD || + session->sessionType == SML_SESSION_TYPE_CLIENT) { + /* FIXME: How do we handle remote peers which are clients + * FIXME: and only support replace? The assembler will + * FIXME: send a replace command with a target instead of + * FIXME: an add command with a source. + */ if (!status->sourceRef) { - smlTrace(TRACE_EXIT_ERROR, "%s: Received add status without sourceRef", __func__); + smlTrace(TRACE_EXIT_ERROR, "%s: Received add status or change reply from an OMA DS server without sourceRef", __func__); return; } - } else if (status->type == SML_COMMAND_TYPE_REPLACE || status->type == SML_COMMAND_TYPE_DELETE) { + } else { if (!status->targetRef) { - smlTrace(TRACE_EXIT_ERROR, "%s: Received delete or modify status without targetRef", __func__); + smlTrace(TRACE_EXIT_ERROR, "%s: Received delete or modify status or change reply from an OMA DS client without targetRef", __func__); return; } } Modified: trunk/libsyncml/parser/sml_xml_assm.c ============================================================================== --- trunk/libsyncml/parser/sml_xml_assm.c Wed Apr 15 11:43:37 2009 (r1042) +++ trunk/libsyncml/parser/sml_xml_assm.c Wed Apr 15 14:07:55 2009 (r1043) @@ -514,12 +514,60 @@ goto error; //Item(s) + + /* Item has to deal with four different situations: + * 1. If this is a new item but the remote peer only supports + * the Replace command and the local peer is an OMA DS + * server then the ID/location must be send as target. + * If the local peer is an OMA DS client then nothing + * changes. FYI an OMA DS server must support the Add + * command. + * => Target must be set (Target is the former Source) + * 2. If this is a new item then the local peer only knows + * the ID of the item. + * => Source must be set + * 3. If this is a changed or deleted item and the local peer + * is an OMA DS server then the item must reference the ID + * of the remote peer because of the submitted map. Please + * not that the remote peer as an OMA DS client must only + * know its own ID of the item. The mapping of locations + * (IDs) is the exclusive job of the OMA DS server. + * => Target must be set (Source is optional) + * 4. If this is a changed or deleted item and the local peer + * is an OMA DS client then the item must reference the ID + * of the local peer only because the mapping of locations + * (IDs) must be done by the OMA DS server. + * => Source must be set + */ + SmlSessionType sessionType = assm->session->sessionType; opt = smlAssemblerGetOption(assm->assembler, "ONLY_REPLACE"); - if (opt && atoi(opt) && change->type == SML_COMMAND_TYPE_ADD) { - if (item->target) - smlLocationUnref(item->target); - item->target = item->source; - item->source = NULL; + if (change->type == SML_COMMAND_TYPE_ADD) + { + if (opt && atoi(opt) && /* remote peer supports ONLY_REPLACE */ + sessionType == SML_SESSION_TYPE_SERVER) { + /* only Target must be set */ + if (item->target) + smlLocationUnref(item->target); + item->target = item->source; + item->source = NULL; + } else { + /* only Source must be set */ + if (item->target) + smlLocationUnref(item->target); + item->target = NULL; + } + } else { + if (sessionType == SML_SESSION_TYPE_SERVER) { + /* Target must be set */ + if (item->source) + smlLocationUnref(item->source); + item->source = NULL; + } else { + /* only Source must be set */ + if (item->target) + smlLocationUnref(item->target); + item->target = NULL; + } } if (!smlItemAssemble(item, assm, error)) Modified: trunk/libsyncml/sml_command.c ============================================================================== --- trunk/libsyncml/sml_command.c Wed Apr 15 11:43:37 2009 (r1042) +++ trunk/libsyncml/sml_command.c Wed Apr 15 14:07:55 2009 (r1043) @@ -398,10 +398,20 @@ if (!loc) goto error_free_cmd; - if (type != SML_CHANGE_ADD) + /* The usage of target and source depends on the role of the + * local peer. We cannot determine if the local peer is an + * OMA DS client or server. This function is only used by + * smlDsSessionQueueChange. So the correct usage of target + * and source must be ensured by the XML assembler. + */ + item->source = loc; + if (type != SML_CHANGE_ADD) { + /* If this is an Add command then nobody knows + * which ID the remote peer will be use for this item. + */ + smlLocationRef(loc); item->target = loc; - else - item->source = loc; + } item->contenttype = g_strdup(contenttype); |
From: <svn...@op...> - 2009-04-15 09:43:46
|
Author: bellmich Date: Wed Apr 15 11:43:37 2009 New Revision: 1042 URL: http://libsyncml.opensync.org/changeset/1042 Log: added default XML encoding explicitly because Sync4j requires it (ticket #225) Modified: trunk/libsyncml/parser/sml_xml_assm.c Modified: trunk/libsyncml/parser/sml_xml_assm.c ============================================================================== --- trunk/libsyncml/parser/sml_xml_assm.c Tue Apr 14 17:45:41 2009 (r1041) +++ trunk/libsyncml/parser/sml_xml_assm.c Wed Apr 15 11:43:37 2009 (r1042) @@ -1700,7 +1700,11 @@ goto error_free_buffer; } - if (xmlTextWriterStartDocument(assm->writer, NULL, NULL, NULL) < 0) { + /* Sync4j has a bug and cannot handle the default XML encoding. + * The default XML encoding is UTF-8. So this default encoding + * is explicitly added to support buggy XML parsers. + */ + if (xmlTextWriterStartDocument(assm->writer, NULL, "UTF-8", NULL) < 0) { smlErrorSet(error, SML_ERROR_GENERIC, "Unable to create new writer"); goto error_free_writer; } |
From: <svn...@op...> - 2009-04-14 18:27:16
|
Author: scriptor Date: Tue Apr 14 20:27:12 2009 New Revision: 5613 URL: http://www.opensync.org/changeset/5613 Log: Forgot a newline. Modified: plugins/ldap-sync/misc/ldap_format_convert.c plugins/ldap-sync/tests/check_do_convert_from_to.c Modified: plugins/ldap-sync/misc/ldap_format_convert.c ============================================================================== --- plugins/ldap-sync/misc/ldap_format_convert.c Tue Apr 14 19:39:30 2009 (r5612) +++ plugins/ldap-sync/misc/ldap_format_convert.c Tue Apr 14 20:27:12 2009 (r5613) @@ -1232,7 +1232,7 @@ osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: Unknown reason.\n", __FILE__, __LINE__); } - fprintf(stderr, "%s: %s", __func__, osync_error_print(&error)); + fprintf(stderr, "%s: %s\n", __func__, osync_error_print(&error)); fflush(stderr); osync_trace(TRACE_ERROR, "%s: %s", __func__, osync_error_print(&error)); osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error)); Modified: plugins/ldap-sync/tests/check_do_convert_from_to.c ============================================================================== --- plugins/ldap-sync/tests/check_do_convert_from_to.c Tue Apr 14 19:39:30 2009 (r5612) +++ plugins/ldap-sync/tests/check_do_convert_from_to.c Tue Apr 14 20:27:12 2009 (r5613) @@ -1232,7 +1232,7 @@ osync_error_set(&error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: Unknown reason.\n", __FILE__, __LINE__); } - fprintf(stderr, "%s: %s", __func__, osync_error_print(&error)); + fprintf(stderr, "%s: %s\n", __func__, osync_error_print(&error)); fflush(stderr); osync_trace(TRACE_ERROR, "%s: %s", __func__, osync_error_print(&error)); osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error)); |
From: <svn...@op...> - 2009-04-14 17:39:42
|
Author: cdfrey Date: Tue Apr 14 19:39:30 2009 New Revision: 5612 URL: http://www.opensync.org/changeset/5612 Log: Fixed OSyncList* leak from osync_plugin_info_get_objtype_sinks() Modified: plugins/kdepim/src/kdepim_sync.cpp Modified: plugins/kdepim/src/kdepim_sync.cpp ============================================================================== --- plugins/kdepim/src/kdepim_sync.cpp Tue Apr 14 19:38:50 2009 (r5611) +++ plugins/kdepim/src/kdepim_sync.cpp Tue Apr 14 19:39:30 2009 (r5612) @@ -154,6 +154,7 @@ OSyncObjTypeSink *sink = (OSyncObjTypeSink *) l->data; osync_objtype_sink_set_available(sink, TRUE); } + osync_list_free(list); // set information about the peer (KDE itself) { |
From: <svn...@op...> - 2009-04-14 17:38:57
|
Author: cdfrey Date: Tue Apr 14 19:38:50 2009 New Revision: 5611 URL: http://www.opensync.org/changeset/5611 Log: Get rid of unused variable compiler warnings Modified: plugins/kdepim/src/datasource.cpp plugins/kdepim/src/kaddrbook.cpp plugins/kdepim/src/kcal.cpp plugins/kdepim/src/knotes.cpp Modified: plugins/kdepim/src/datasource.cpp ============================================================================== --- plugins/kdepim/src/datasource.cpp Tue Apr 14 19:38:03 2009 (r5610) +++ plugins/kdepim/src/datasource.cpp Tue Apr 14 19:38:50 2009 (r5611) @@ -68,7 +68,7 @@ //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- -bool OSyncDataSource::initialize(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error) +bool OSyncDataSource::initialize(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, plugin, info); Modified: plugins/kdepim/src/kaddrbook.cpp ============================================================================== --- plugins/kdepim/src/kaddrbook.cpp Tue Apr 14 19:38:03 2009 (r5610) +++ plugins/kdepim/src/kaddrbook.cpp Tue Apr 14 19:38:50 2009 (r5611) @@ -77,7 +77,7 @@ //-------------------------------------------------------------------------------- -void KContactDataSource::disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) +void KContactDataSource::disconnect(OSyncObjTypeSink *, OSyncPluginInfo *info, OSyncContext *ctx) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); Modified: plugins/kdepim/src/kcal.cpp ============================================================================== --- plugins/kdepim/src/kcal.cpp Tue Apr 14 19:38:03 2009 (r5610) +++ plugins/kdepim/src/kcal.cpp Tue Apr 14 19:38:50 2009 (r5611) @@ -257,7 +257,7 @@ //-------------------------------------------------------------------------------- -void KCalEventDataSource::disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *, OSyncContext *ctx) +void KCalEventDataSource::disconnect(OSyncObjTypeSink *, OSyncPluginInfo *, OSyncContext *ctx) { if (kcal->close(ctx)) osync_context_report_success(ctx); @@ -265,7 +265,7 @@ //-------------------------------------------------------------------------------- -void KCalTodoDataSource::disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *, OSyncContext *ctx) +void KCalTodoDataSource::disconnect(OSyncObjTypeSink *, OSyncPluginInfo *, OSyncContext *ctx) { if (kcal->close(ctx)) osync_context_report_success(ctx); Modified: plugins/kdepim/src/knotes.cpp ============================================================================== --- plugins/kdepim/src/knotes.cpp Tue Apr 14 19:38:03 2009 (r5610) +++ plugins/kdepim/src/knotes.cpp Tue Apr 14 19:38:50 2009 (r5611) @@ -75,7 +75,7 @@ //-------------------------------------------------------------------------------- -void KNotesDataSource::disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *, OSyncContext *ctx) +void KNotesDataSource::disconnect(OSyncObjTypeSink *, OSyncPluginInfo *, OSyncContext *ctx) { osync_trace(TRACE_ENTRY, "%s(%p)", __func__, ctx); |
From: <svn...@op...> - 2009-04-14 17:38:11
|
Author: cdfrey Date: Tue Apr 14 19:38:03 2009 New Revision: 5610 URL: http://www.opensync.org/changeset/5610 Log: A number of related 0.4x API changes - hashtable API change - added OSyncObjTypeSink *sink to C++ wrapper class member args - added osync_bool slow_sync to args as well Modified: plugins/kdepim/src/datasource.cpp plugins/kdepim/src/datasource.h plugins/kdepim/src/kaddrbook.cpp plugins/kdepim/src/kaddrbook.h plugins/kdepim/src/kcal.cpp plugins/kdepim/src/kcal.h plugins/kdepim/src/knotes.cpp plugins/kdepim/src/knotes.h Modified: plugins/kdepim/src/datasource.cpp ============================================================================== --- plugins/kdepim/src/datasource.cpp Tue Apr 14 19:37:11 2009 (r5609) +++ plugins/kdepim/src/datasource.cpp Tue Apr 14 19:38:03 2009 (r5610) @@ -1,6 +1,7 @@ /** * @author Andrew Baumann <an...@cs...> * changed to 0.40 API by Martin Koller <ko...@ao...> + * some additional 0.40 API updates by Chris Frey <cd...@fo...> */ #include <stdlib.h> @@ -16,7 +17,7 @@ { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, sink, userdata, info, ctx); OSyncDataSource *obj = static_cast<OSyncDataSource *>(userdata); - obj->connect(info, ctx); + obj->connect(sink, info, ctx); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } @@ -26,7 +27,7 @@ { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __PRETTY_FUNCTION__, sink, userdata, info, ctx); OSyncDataSource *obj = static_cast<OSyncDataSource *>(userdata); - obj->disconnect(info, ctx); + obj->disconnect(sink, info, ctx); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } @@ -37,7 +38,7 @@ { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __PRETTY_FUNCTION__, sink, userdata, info, ctx); OSyncDataSource *obj = static_cast<OSyncDataSource *>(userdata); - obj->get_changes(info, ctx); + obj->get_changes(sink, info, ctx, slow_sync); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } @@ -48,7 +49,7 @@ { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p, %p)", __PRETTY_FUNCTION__, sink, userdata, info, ctx, chg); OSyncDataSource *obj = static_cast<OSyncDataSource *>(userdata); - obj->commit(info, ctx, chg); + obj->commit(sink, info, ctx, chg); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } @@ -58,7 +59,7 @@ { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __PRETTY_FUNCTION__, sink, userdata, info, ctx); OSyncDataSource *obj = static_cast<OSyncDataSource *>(userdata); - obj->sync_done(info, ctx); + obj->sync_done(sink, info, ctx); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } @@ -91,18 +92,8 @@ // Request a state_db from the framework. osync_objtype_sink_enable_state_db(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; - } + // Request a hashtable from the framework + osync_objtype_sink_enable_hashtable(sink, TRUE); // 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.) @@ -126,7 +117,7 @@ //-------------------------------------------------------------------------------- -void OSyncDataSource::connect(OSyncPluginInfo *info, OSyncContext *ctx) +void OSyncDataSource::connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); @@ -134,7 +125,6 @@ OSyncError *error = NULL; osync_bool statematch = FALSE; - OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); OSyncSinkStateDB *state_db = osync_objtype_sink_get_state_db(sink); if ( !osync_sink_state_equal(state_db, "done", "true", &statematch, &error) ) @@ -157,14 +147,13 @@ //-------------------------------------------------------------------------------- -void OSyncDataSource::sync_done(OSyncPluginInfo *info, OSyncContext *ctx) +void OSyncDataSource::sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); // Detection mechanismn if this is the first sync OSyncError *error = NULL; - OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); OSyncSinkStateDB *state_db = osync_objtype_sink_get_state_db(sink); if ( !osync_sink_state_set(state_db, "done", "true", &error) ) @@ -176,19 +165,12 @@ } 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__); } //-------------------------------------------------------------------------------- -bool OSyncDataSource::report_change(OSyncPluginInfo *info, OSyncContext *ctx, +bool OSyncDataSource::report_change(OSyncObjTypeSink *sink, 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__, @@ -209,6 +191,7 @@ osync_change_set_uid(change, uid.utf8()); osync_change_set_hash(change, hash.utf8()); + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); OSyncChangeType changetype = osync_hashtable_get_changetype(hashtable, change); osync_change_set_changetype(change, changetype); @@ -246,11 +229,12 @@ //-------------------------------------------------------------------------------- -bool OSyncDataSource::report_deleted(OSyncPluginInfo *info, OSyncContext *ctx, OSyncObjFormat *objformat) +bool OSyncDataSource::report_deleted(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncObjFormat *objformat) { osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __PRETTY_FUNCTION__, info, ctx, objformat); OSyncError *error = NULL; + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); OSyncList *u, *uids = osync_hashtable_get_deleted(hashtable); OSyncChange *change = NULL; @@ -296,8 +280,6 @@ OSyncDataSource::~OSyncDataSource() { - if (hashtable) - osync_hashtable_unref(hashtable); } //-------------------------------------------------------------------------------- Modified: plugins/kdepim/src/datasource.h ============================================================================== --- plugins/kdepim/src/datasource.h Tue Apr 14 19:37:11 2009 (r5609) +++ plugins/kdepim/src/datasource.h Tue Apr 14 19:38:03 2009 (r5610) @@ -15,7 +15,7 @@ friend class KCalSharedResource; public: - OSyncDataSource(const char *objtype) : objtype(objtype), hashtable(0) {} + OSyncDataSource(const char *objtype) : objtype(objtype) {} virtual ~OSyncDataSource(); const char *getObjType() const { return objtype; } @@ -24,11 +24,11 @@ virtual bool initialize(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error); /* these map to opensync's per-sink callbacks */ - virtual void connect(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void disconnect(OSyncPluginInfo *info, OSyncContext *ctx) = 0; - virtual void get_changes(OSyncPluginInfo *info, OSyncContext *ctx) = 0; - virtual void commit(OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg) = 0; - virtual void sync_done(OSyncPluginInfo *info, OSyncContext *ctx); + virtual void connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); + virtual void disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) = 0; + virtual void get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync) = 0; + virtual void commit(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg) = 0; + virtual void sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); // return true if at least one item in the given list is included in the categories member bool has_category(const QStringList &list) const; @@ -37,12 +37,11 @@ protected: const char *objtype; - OSyncHashTable *hashtable; QStringList categories; /* utility functions for subclasses */ - bool report_change(OSyncPluginInfo *info, OSyncContext *ctx, QString uid, QString data, QString hash, OSyncObjFormat *objformat); - bool report_deleted(OSyncPluginInfo *info, OSyncContext *ctx, OSyncObjFormat *objformat); + bool report_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, QString uid, QString data, QString hash, OSyncObjFormat *objformat); + bool report_deleted(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncObjFormat *objformat); }; #endif // KDEPIM_OSYNC_DATASOURCE_H Modified: plugins/kdepim/src/kaddrbook.cpp ============================================================================== --- plugins/kdepim/src/kaddrbook.cpp Tue Apr 14 19:37:11 2009 (r5609) +++ plugins/kdepim/src/kaddrbook.cpp Tue Apr 14 19:38:03 2009 (r5610) @@ -54,7 +54,7 @@ //-------------------------------------------------------------------------------- -void KContactDataSource::connect(OSyncPluginInfo *info, OSyncContext *ctx) +void KContactDataSource::connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); @@ -70,14 +70,14 @@ return; } - OSyncDataSource::connect(info, ctx); + OSyncDataSource::connect(sink, info, ctx); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } //-------------------------------------------------------------------------------- -void KContactDataSource::disconnect(OSyncPluginInfo *info, OSyncContext *ctx) +void KContactDataSource::disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); @@ -101,15 +101,14 @@ //-------------------------------------------------------------------------------- -void KContactDataSource::get_changes(OSyncPluginInfo *info, OSyncContext *ctx) +void KContactDataSource::get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); OSyncError *error = NULL; + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); - OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); - - if (osync_objtype_sink_get_slowsync(sink)) { + if (slow_sync) { osync_trace(TRACE_INTERNAL, "Got slow-sync, resetting hashtable"); if (!osync_hashtable_slowsync(hashtable, &error)) { osync_context_report_osyncerror(ctx, error); @@ -132,7 +131,7 @@ // only vcard3.0 exports Categories QString data = converter.createVCard(*it, KABC::VCardConverter::v3_0); - if (!report_change(info, ctx, it->uid(), data, calc_hash(*it), objformat)) { + if (!report_change(sink, info, ctx, it->uid(), data, calc_hash(*it), objformat)) { osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, "Failed to get changes"); osync_trace(TRACE_EXIT_ERROR, "%s", __PRETTY_FUNCTION__); @@ -140,7 +139,7 @@ } } - if (!report_deleted(info, ctx, objformat)) { + if (!report_deleted(sink, info, ctx, objformat)) { osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, "Failed detecting deleted changes."); osync_trace(TRACE_EXIT_ERROR, "%s", __PRETTY_FUNCTION__); return; @@ -152,7 +151,7 @@ //-------------------------------------------------------------------------------- -void KContactDataSource::commit(OSyncPluginInfo *, OSyncContext *ctx, OSyncChange *chg) +void KContactDataSource::commit(OSyncObjTypeSink *sink, OSyncPluginInfo *, OSyncContext *ctx, OSyncChange *chg) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, ctx, chg); KABC::VCardConverter converter; @@ -224,6 +223,7 @@ } } + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); osync_hashtable_update_change(hashtable, chg); osync_context_report_success(ctx); Modified: plugins/kdepim/src/kaddrbook.h ============================================================================== --- plugins/kdepim/src/kaddrbook.h Tue Apr 14 19:37:11 2009 (r5609) +++ plugins/kdepim/src/kaddrbook.h Tue Apr 14 19:38:03 2009 (r5610) @@ -33,10 +33,10 @@ KContactDataSource() : OSyncDataSource("contact"), addressbookptr(0), modified(false), ticket(0) {}; virtual ~KContactDataSource() {}; - virtual void connect(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void disconnect(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void get_changes(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void commit(OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg); + virtual void connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); + virtual void disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); + virtual void get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync); + virtual void commit(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg); private: QString calc_hash(KABC::Addressee &e); Modified: plugins/kdepim/src/kcal.cpp ============================================================================== --- plugins/kdepim/src/kcal.cpp Tue Apr 14 19:37:11 2009 (r5609) +++ plugins/kdepim/src/kcal.cpp Tue Apr 14 19:38:03 2009 (r5610) @@ -175,7 +175,9 @@ * This function exists because the logic for converting the events or to-dos * is the same, only the objtype and format is different. */ -bool KCalSharedResource::report_incidence(OSyncDataSource *dsobj, OSyncPluginInfo *info, OSyncContext *ctx, +bool KCalSharedResource::report_incidence(OSyncDataSource *dsobj, + OSyncObjTypeSink *sink, + OSyncPluginInfo *info, OSyncContext *ctx, KCal::Incidence *e, OSyncObjFormat *objformat) { /* Build a local calendar for the incidence data */ @@ -186,12 +188,12 @@ KCal::ICalFormat format; QString data = format.toString(&cal); - return dsobj->report_change(info, ctx, e->uid(), data, calc_hash(e), objformat); + return dsobj->report_change(sink, info, ctx, e->uid(), data, calc_hash(e), objformat); } //-------------------------------------------------------------------------------- -bool KCalSharedResource::get_event_changes(OSyncDataSource *dsobj, OSyncPluginInfo *info, OSyncContext *ctx) +bool KCalSharedResource::get_event_changes(OSyncDataSource *dsobj, OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); OSyncObjFormat *objformat = osync_format_env_find_objformat(formatenv, "vevent20"); @@ -210,7 +212,7 @@ if ( (*i)->uid().contains("KABC_Birthday") || (*i)->uid().contains("KABC_Anniversary") ) continue; - if (!report_incidence(dsobj, info, ctx, *i, objformat)) + if (!report_incidence(dsobj, sink, info, ctx, *i, objformat)) return false; } @@ -219,7 +221,7 @@ //-------------------------------------------------------------------------------- -bool KCalSharedResource::get_todo_changes(OSyncDataSource *dsobj, OSyncPluginInfo *info, OSyncContext *ctx) +bool KCalSharedResource::get_todo_changes(OSyncDataSource *dsobj, OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); OSyncObjFormat *objformat = osync_format_env_find_objformat(formatenv, "vtodo20"); @@ -230,7 +232,7 @@ if ( ! dsobj->has_category((*i)->categories()) ) continue; - if (!report_incidence(dsobj, info, ctx, *i, objformat)) + if (!report_incidence(dsobj, sink, info, ctx, *i, objformat)) return false; } @@ -239,23 +241,23 @@ //-------------------------------------------------------------------------------- -void KCalEventDataSource::connect(OSyncPluginInfo *info, OSyncContext *ctx) +void KCalEventDataSource::connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { if (kcal->open(ctx)) - OSyncDataSource::connect(info, ctx); + OSyncDataSource::connect(sink, info, ctx); } //-------------------------------------------------------------------------------- -void KCalTodoDataSource::connect(OSyncPluginInfo *info, OSyncContext *ctx) +void KCalTodoDataSource::connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { if (kcal->open(ctx)) - OSyncDataSource::connect(info, ctx); + OSyncDataSource::connect(sink, info, ctx); } //-------------------------------------------------------------------------------- -void KCalEventDataSource::disconnect(OSyncPluginInfo *, OSyncContext *ctx) +void KCalEventDataSource::disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *, OSyncContext *ctx) { if (kcal->close(ctx)) osync_context_report_success(ctx); @@ -263,7 +265,7 @@ //-------------------------------------------------------------------------------- -void KCalTodoDataSource::disconnect(OSyncPluginInfo *, OSyncContext *ctx) +void KCalTodoDataSource::disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *, OSyncContext *ctx) { if (kcal->close(ctx)) osync_context_report_success(ctx); @@ -271,15 +273,14 @@ //-------------------------------------------------------------------------------- -void KCalEventDataSource::get_changes(OSyncPluginInfo *info, OSyncContext *ctx) +void KCalEventDataSource::get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); OSyncError *error = NULL; + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - - if (osync_objtype_sink_get_slowsync(sink)) { + if (slow_sync) { osync_trace(TRACE_INTERNAL, "Got slow-sync, resetting hashtable"); if (!osync_hashtable_slowsync(hashtable, &error)) { osync_context_report_osyncerror(ctx, error); @@ -288,7 +289,7 @@ } } - if (!kcal->get_event_changes(this, info, ctx)) { + if (!kcal->get_event_changes(this, sink, info, ctx)) { osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, "Error while reciving latest changes."); osync_trace(TRACE_EXIT_ERROR, "%s: error in get_todo_changes", __PRETTY_FUNCTION__); return; @@ -297,7 +298,7 @@ OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); OSyncObjFormat *objformat = osync_format_env_find_objformat(formatenv, "vevent20"); - if (!report_deleted(info, ctx, objformat)) { + if (!report_deleted(sink, info, ctx, objformat)) { osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, "Error while detecting latest changes."); osync_trace(TRACE_EXIT_ERROR, "%s", __PRETTY_FUNCTION__); return; @@ -309,18 +310,17 @@ //-------------------------------------------------------------------------------- -void KCalTodoDataSource::get_changes(OSyncPluginInfo *info, OSyncContext *ctx) +void KCalTodoDataSource::get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); OSyncError *error = NULL; - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); OSyncObjFormat *objformat = osync_format_env_find_objformat(formatenv, "vtodo20"); + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); - if (osync_objtype_sink_get_slowsync(sink)) { + if (slow_sync) { osync_trace(TRACE_INTERNAL, "Got slow-sync"); if (!osync_hashtable_slowsync(hashtable, &error)) { osync_context_report_osyncerror(ctx, error); @@ -330,13 +330,13 @@ } - if (!kcal->get_todo_changes(this, info, ctx)) { + if (!kcal->get_todo_changes(this, sink, info, ctx)) { osync_trace(TRACE_EXIT_ERROR, "%s: error in get_todo_changes", __PRETTY_FUNCTION__); osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, "Error while detecting latest changes."); return; } - if (!report_deleted(info, ctx, objformat)) { + if (!report_deleted(sink, info, ctx, objformat)) { osync_trace(TRACE_EXIT_ERROR, "%s", __PRETTY_FUNCTION__); osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, "Error while detecting deleted entries."); return; @@ -348,24 +348,26 @@ //-------------------------------------------------------------------------------- -void KCalEventDataSource::commit(OSyncPluginInfo *, OSyncContext *ctx, OSyncChange *chg) +void KCalEventDataSource::commit(OSyncObjTypeSink *sink, OSyncPluginInfo *, OSyncContext *ctx, OSyncChange *chg) { // We use the same function for events and to-do if (!kcal->commit(this, ctx, chg)) return; + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); osync_hashtable_update_change(hashtable, chg); osync_context_report_success(ctx); } //-------------------------------------------------------------------------------- -void KCalTodoDataSource::commit(OSyncPluginInfo *, OSyncContext *ctx, OSyncChange *chg) +void KCalTodoDataSource::commit(OSyncObjTypeSink *sink, OSyncPluginInfo *, OSyncContext *ctx, OSyncChange *chg) { // We use the same function for calendar and to-do if (!kcal->commit(this, ctx, chg)) return; + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); osync_hashtable_update_change(hashtable, chg); osync_context_report_success(ctx); } Modified: plugins/kdepim/src/kcal.h ============================================================================== --- plugins/kdepim/src/kcal.h Tue Apr 14 19:37:11 2009 (r5609) +++ plugins/kdepim/src/kcal.h Tue Apr 14 19:38:03 2009 (r5610) @@ -35,15 +35,15 @@ KCalSharedResource() : calendar(0), refcount(0) { } bool open(OSyncContext *ctx); bool close(OSyncContext *ctx); - bool get_event_changes(OSyncDataSource *dsobj, OSyncPluginInfo *info, OSyncContext *ctx); - bool get_todo_changes(OSyncDataSource *dsobj, OSyncPluginInfo *info, OSyncContext *ctx); + bool get_event_changes(OSyncDataSource *dsobj, OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); + bool get_todo_changes(OSyncDataSource *dsobj, OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); bool commit(OSyncDataSource *dsobj, OSyncContext *ctx, OSyncChange *chg); private: KCal::CalendarResources *calendar; int refcount; - bool report_incidence(OSyncDataSource *dsobj, OSyncPluginInfo *info, OSyncContext *ctx, + bool report_incidence(OSyncDataSource *dsobj, OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, KCal::Incidence *e, OSyncObjFormat *objformat); }; @@ -55,10 +55,10 @@ KCalEventDataSource(KCalSharedResource *kcal) : OSyncDataSource("event"), kcal(kcal) {}; virtual ~KCalEventDataSource() {}; - virtual void connect(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void disconnect(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void get_changes(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void commit(OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg); + virtual void connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); + virtual void disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); + virtual void get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync); + virtual void commit(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg); private: KCalSharedResource *kcal; @@ -72,10 +72,10 @@ KCalTodoDataSource(KCalSharedResource *kcal) : OSyncDataSource("todo"), kcal(kcal) {}; virtual ~KCalTodoDataSource() {}; - virtual void connect(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void disconnect(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void get_changes(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void commit(OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg); + virtual void connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); + virtual void disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); + virtual void get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync); + virtual void commit(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg); private: KCalSharedResource *kcal; Modified: plugins/kdepim/src/knotes.cpp ============================================================================== --- plugins/kdepim/src/knotes.cpp Tue Apr 14 19:37:11 2009 (r5609) +++ plugins/kdepim/src/knotes.cpp Tue Apr 14 19:38:03 2009 (r5610) @@ -36,7 +36,7 @@ //-------------------------------------------------------------------------------- -void KNotesDataSource::connect(OSyncPluginInfo *info, OSyncContext *ctx) +void KNotesDataSource::connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, info, ctx); @@ -68,14 +68,14 @@ kn_iface = new KNotesIface_stub("knotes", "KNotesIface"); - OSyncDataSource::connect(info, ctx); + OSyncDataSource::connect(sink, info, ctx); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } //-------------------------------------------------------------------------------- -void KNotesDataSource::disconnect(OSyncPluginInfo *, OSyncContext *ctx) +void KNotesDataSource::disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *, OSyncContext *ctx) { osync_trace(TRACE_ENTRY, "%s(%p)", __func__, ctx); @@ -125,7 +125,7 @@ //-------------------------------------------------------------------------------- -void KNotesDataSource::get_changes(OSyncPluginInfo *info, OSyncContext *ctx) +void KNotesDataSource::get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync) { osync_trace(TRACE_ENTRY, "%s(%p)", __func__, ctx); QMap <KNoteID_t,QString> fNotes; @@ -139,8 +139,8 @@ return; } - OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); - if (osync_objtype_sink_get_slowsync(sink)) { + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); + if (slow_sync) { osync_trace(TRACE_INTERNAL, "Got slow-sync, resetting hashtable"); if (!osync_hashtable_slowsync(hashtable, &error)) { osync_context_report_osyncerror(ctx, error); @@ -161,7 +161,7 @@ hash_value.update(data.utf8()); QString hash = hash_value.base64Digest(); - if ( !report_change(info, ctx, uid, data, hash, objformat) ) { + if ( !report_change(sink, info, ctx, uid, data, hash, objformat) ) { osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, "Failed to get changes"); osync_trace(TRACE_EXIT_ERROR, "%s", __PRETTY_FUNCTION__); return; @@ -170,7 +170,7 @@ hash_value.reset(); } - if (!report_deleted(info, ctx, objformat)) { + if (!report_deleted(sink, info, ctx, objformat)) { osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, "Failed detecting deleted changes."); osync_trace(TRACE_EXIT_ERROR, "%s", __func__); return; @@ -182,7 +182,7 @@ //-------------------------------------------------------------------------------- -void KNotesDataSource::commit(OSyncPluginInfo *, OSyncContext *ctx, OSyncChange *chg) +void KNotesDataSource::commit(OSyncObjTypeSink *sink, OSyncPluginInfo *, OSyncContext *ctx, OSyncChange *chg) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, ctx, chg); OSyncChangeType type = osync_change_get_changetype(chg); @@ -258,6 +258,7 @@ }*/ } + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); osync_hashtable_update_change(hashtable, chg); osync_context_report_success(ctx); osync_trace(TRACE_EXIT, "%s", __func__); Modified: plugins/kdepim/src/knotes.h ============================================================================== --- plugins/kdepim/src/knotes.h Tue Apr 14 19:37:11 2009 (r5609) +++ plugins/kdepim/src/knotes.h Tue Apr 14 19:38:03 2009 (r5610) @@ -57,10 +57,10 @@ KNotesDataSource() : OSyncDataSource("note") {}; virtual ~KNotesDataSource() {}; - virtual void connect(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void disconnect(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void get_changes(OSyncPluginInfo *info, OSyncContext *ctx); - virtual void commit(OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg); + virtual void connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); + virtual void disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); + virtual void get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync); + virtual void commit(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *chg); private: DCOPClient *kn_dcop; |
From: <svn...@op...> - 2009-04-14 17:37:18
|
Author: cdfrey Date: Tue Apr 14 19:37:11 2009 New Revision: 5609 URL: http://www.opensync.org/changeset/5609 Log: Updated for osync_context_report_slowsync() API change Modified: plugins/kdepim/src/datasource.cpp Modified: plugins/kdepim/src/datasource.cpp ============================================================================== --- plugins/kdepim/src/datasource.cpp Tue Apr 14 19:36:30 2009 (r5608) +++ plugins/kdepim/src/datasource.cpp Tue Apr 14 19:37:11 2009 (r5609) @@ -148,7 +148,7 @@ if ( !statematch ) { osync_trace(TRACE_INTERNAL, "Setting slow-sync for %s", objtype); - osync_objtype_sink_set_slowsync(sink, TRUE); + osync_context_report_slowsync(ctx); } osync_context_report_success(ctx); |
From: <svn...@op...> - 2009-04-14 17:36:43
|
Author: cdfrey Date: Tue Apr 14 19:36:30 2009 New Revision: 5608 URL: http://www.opensync.org/changeset/5608 Log: Updated for anchor/state_db and anchor key/value API changes Modified: plugins/kdepim/src/datasource.cpp Modified: plugins/kdepim/src/datasource.cpp ============================================================================== --- plugins/kdepim/src/datasource.cpp Tue Apr 14 19:35:43 2009 (r5607) +++ plugins/kdepim/src/datasource.cpp Tue Apr 14 19:36:30 2009 (r5608) @@ -88,8 +88,8 @@ osync_objtype_sink_set_userdata(sink, this); - // Request an anchor from the framework. - osync_objtype_sink_enable_anchor(sink, TRUE); + // Request a state_db from the framework. + osync_objtype_sink_enable_state_db(sink, TRUE); const char *configdir = osync_plugin_info_get_configdir(info); QString tablepath = QString("%1/hashtable.db").arg(configdir); @@ -132,12 +132,12 @@ // Detection mechanismn if this is the first sync OSyncError *error = NULL; - osync_bool anchormatch = FALSE; + osync_bool statematch = FALSE; OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); - OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + OSyncSinkStateDB *state_db = osync_objtype_sink_get_state_db(sink); - if ( !osync_anchor_compare(anchor, "true", &anchormatch, &error) ) + if ( !osync_sink_state_equal(state_db, "done", "true", &statematch, &error) ) { osync_context_report_osyncerror(ctx, error); osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); @@ -145,7 +145,7 @@ return; } - if ( !anchormatch ) + if ( !statematch ) { osync_trace(TRACE_INTERNAL, "Setting slow-sync for %s", objtype); osync_objtype_sink_set_slowsync(sink, TRUE); @@ -165,9 +165,9 @@ OSyncError *error = NULL; OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, objtype); - OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + OSyncSinkStateDB *state_db = osync_objtype_sink_get_state_db(sink); - if ( !osync_anchor_update(anchor, "true", &error) ) + if ( !osync_sink_state_set(state_db, "done", "true", &error) ) { osync_context_report_osyncerror(ctx, error); osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, osync_error_print(&error)); |
From: <svn...@op...> - 2009-04-14 17:35:55
|
Author: cdfrey Date: Tue Apr 14 19:35:43 2009 New Revision: 5607 URL: http://www.opensync.org/changeset/5607 Log: Updated to osync_objtype_sink_set_functions() API change Modified: plugins/kdepim/src/datasource.cpp Modified: plugins/kdepim/src/datasource.cpp ============================================================================== --- plugins/kdepim/src/datasource.cpp Tue Apr 14 19:34:53 2009 (r5606) +++ plugins/kdepim/src/datasource.cpp Tue Apr 14 19:35:43 2009 (r5607) @@ -80,15 +80,13 @@ 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_connect_func(sink, connect_wrapper); + osync_objtype_sink_set_disconnect_func(sink, disconnect_wrapper); + osync_objtype_sink_set_get_changes_func(sink, get_changes_wrapper); + osync_objtype_sink_set_commit_func(sink, commit_wrapper); + osync_objtype_sink_set_sync_done_func(sink, sync_done_wrapper); - osync_objtype_sink_set_functions(sink, functions, this); + osync_objtype_sink_set_userdata(sink, this); // Request an anchor from the framework. osync_objtype_sink_enable_anchor(sink, TRUE); |
From: <svn...@op...> - 2009-04-14 17:35:01
|
Author: cdfrey Date: Tue Apr 14 19:34:53 2009 New Revision: 5606 URL: http://www.opensync.org/changeset/5606 Log: Updated for osync_plugin_info_num_objtypes API change Modified: plugins/kdepim/src/kdepim_sync.cpp Modified: plugins/kdepim/src/kdepim_sync.cpp ============================================================================== --- plugins/kdepim/src/kdepim_sync.cpp Tue Apr 14 12:13:53 2009 (r5605) +++ plugins/kdepim/src/kdepim_sync.cpp Tue Apr 14 19:34:53 2009 (r5606) @@ -146,11 +146,14 @@ osync_bool kde_discover(OSyncPluginInfo *info, void *userdata, OSyncError **error) { + OSyncList *l, *list = NULL; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, error); - int num_objtypes = osync_plugin_info_num_objtypes(info); - for (int n = 0; n < num_objtypes; n++) - osync_objtype_sink_set_available(osync_plugin_info_nth_objtype(info, n), TRUE); + list = osync_plugin_info_get_objtype_sinks(info); + for (l=list; l; l = l->next) { + OSyncObjTypeSink *sink = (OSyncObjTypeSink *) l->data; + osync_objtype_sink_set_available(sink, TRUE); + } // set information about the peer (KDE itself) { |
From: <svn...@op...> - 2009-04-14 15:45:44
|
Author: bellmich Date: Tue Apr 14 17:45:41 2009 New Revision: 1041 URL: http://libsyncml.opensync.org/changeset/1041 Log: first potential solution for ticket #223 Modified: trunk/tests/CMakeLists.txt Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Tue Apr 14 17:43:53 2009 (r1040) +++ trunk/tests/CMakeLists.txt Tue Apr 14 17:45:41 2009 (r1041) @@ -30,7 +30,7 @@ ## flush test to source file and build it MACRO( SML_END_TEST ) SET( SML_TESTCASE_CODE "${SML_TESTCASE_CODE}SML_TESTCASE_END\n\n" ) - CONFIGURE_FILE( ${SML_TESTCASE_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/${SML_TESTCASE_SOURCE} ) + CONFIGURE_FILE( ${SML_TESTCASE_SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/${SML_TESTCASE_SOURCE} @ONLY ) ENDMACRO( SML_END_TEST ) IF( ENABLE_UNIT_TEST ) |
From: <svn...@op...> - 2009-04-14 15:43:57
|
Author: bellmich Date: Tue Apr 14 17:43:53 2009 New Revision: 1040 URL: http://libsyncml.opensync.org/changeset/1040 Log: fixed ticket #224 (patch is from henrik) Modified: trunk/libsyncml/sml_manager.c Modified: trunk/libsyncml/sml_manager.c ============================================================================== --- trunk/libsyncml/sml_manager.c Tue Apr 14 13:56:35 2009 (r1039) +++ trunk/libsyncml/sml_manager.c Tue Apr 14 17:43:53 2009 (r1040) @@ -164,7 +164,7 @@ smlQueueSend(manager->userEventQueue, event); } else { /* error handling is not possible here :( */ - g_error(smlErrorPrint(&lerr)); + g_error("%s", smlErrorPrint(&lerr)); smlErrorDeref(&lerr); } |
From: <svn...@op...> - 2009-04-14 11:56:38
|
Author: bellmich Date: Tue Apr 14 13:56:35 2009 New Revision: 1039 URL: http://libsyncml.opensync.org/changeset/1039 Log: fixed ticket #227 (modified patch from Patrick Pfeifer) Modified: trunk/libsyncml/transports/obex_client.c Modified: trunk/libsyncml/transports/obex_client.c ============================================================================== --- trunk/libsyncml/transports/obex_client.c Thu Apr 9 15:42:16 2009 (r1038) +++ trunk/libsyncml/transports/obex_client.c Tue Apr 14 13:56:35 2009 (r1039) @@ -485,6 +485,7 @@ { env->busy = FALSE; env->isDisconnected = TRUE; + OBEX_TransportDisconnect(env->obexhandle); smlTransportReceiveEvent(env->tsp, NULL, SML_TRANSPORT_EVENT_DISCONNECT_DONE, NULL, NULL); } break; @@ -557,6 +558,7 @@ { env->busy = FALSE; env->isDisconnected = TRUE; + OBEX_TransportDisconnect(env->obexhandle); smlTransportReceiveEvent(env->tsp, NULL, SML_TRANSPORT_EVENT_DISCONNECT_DONE, NULL, NULL); } } else { @@ -1173,6 +1175,7 @@ { env->busy = FALSE; env->isDisconnected = TRUE; + OBEX_TransportDisconnect(env->obexhandle); smlTransportReceiveEvent(env->tsp, NULL, SML_TRANSPORT_EVENT_DISCONNECT_DONE, NULL, NULL); } |
From: <svn...@op...> - 2009-04-14 10:14:05
|
Author: bricks Date: Tue Apr 14 12:13:53 2009 New Revision: 5605 URL: http://www.opensync.org/changeset/5605 Log: updated objtype sink function doxygen documentation Modified: trunk/opensync/plugin/opensync_objtype_sink.h Modified: trunk/opensync/plugin/opensync_objtype_sink.h ============================================================================== --- trunk/opensync/plugin/opensync_objtype_sink.h Tue Apr 14 11:44:27 2009 (r5604) +++ trunk/opensync/plugin/opensync_objtype_sink.h Tue Apr 14 12:13:53 2009 (r5605) @@ -121,7 +121,7 @@ * * The read sink function is used to support the "ignore" conflict resolution. * The read() function requires that the protocol/interface is able to query the native datastore for single entries. - * This plugin funciton is optional. + * This function is optional set through osync_objtype_sink_set_read_func. * * @param sink Pointer to the Sink which corresponds to the functions * @param info PluginInfo pointer e.g. to get all formats @@ -134,7 +134,8 @@ /** * @brief Callback function to which got called after sync is finished by all members/peers * - * This function could be used to store or clean up plugin specific data after a sync process + * This function could be used to store or clean up plugin specific data after a sync process. + * It is optional and set through osync_objtype_sink_set_sync_done_func. * * @param sink Pointer to the Sink which corresponds to the functions * @param info PluginInfo pointer e.g. to get all formats @@ -147,8 +148,9 @@ * @brief Callback function which got called after all members are connected * * Called after all peers have connected. At this point the slow sync status of - * all peers is known. If your plugin must connect differently depending on the + * all peers is known. If your plugin must connect differently depending on the * slow sync status of the group (e.g. syncml) then you may perform that connection here. + * This function is optional and set through osync_objtype_sink_set_connect_done_func. * * @param sink Pointer to the Sink which corresponds to the functions * @param info PluginInfo pointer e.g. to get all formats |