You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(56) |
Apr
(109) |
May
(15) |
Jun
(3) |
Jul
(37) |
Aug
(96) |
Sep
(40) |
Oct
(4) |
Nov
(54) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(47) |
Feb
(30) |
Mar
(102) |
Apr
(120) |
May
(68) |
Jun
(54) |
Jul
(53) |
Aug
(122) |
Sep
(190) |
Oct
(71) |
Nov
(85) |
Dec
(108) |
2007 |
Jan
(72) |
Feb
(190) |
Mar
(53) |
Apr
(101) |
May
(145) |
Jun
(148) |
Jul
(167) |
Aug
(143) |
Sep
(23) |
Oct
(198) |
Nov
(223) |
Dec
(195) |
2008 |
Jan
(100) |
Feb
(129) |
Mar
(79) |
Apr
(77) |
May
(34) |
Jun
(95) |
Jul
(112) |
Aug
(160) |
Sep
(82) |
Oct
(124) |
Nov
(199) |
Dec
(355) |
2009 |
Jan
(436) |
Feb
(89) |
Mar
(298) |
Apr
(189) |
May
(33) |
Jun
(88) |
Jul
(105) |
Aug
(44) |
Sep
(181) |
Oct
(87) |
Nov
(75) |
Dec
(1) |
2010 |
Jan
(63) |
Feb
(21) |
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(26) |
Aug
(37) |
Sep
(26) |
Oct
(15) |
Nov
(13) |
Dec
|
From: <svn...@op...> - 2009-03-25 07:54:03
|
Author: bricks Date: Wed Mar 25 08:53:53 2009 New Revision: 5304 URL: http://www.opensync.org/changeset/5304 Log: created a new branch for opensync db rewrite refs #1050 Added: branches/osyncdb2/ |
From: <svn...@op...> - 2009-03-24 17:58:56
|
Author: bellmich Date: Tue Mar 24 18:58:49 2009 New Revision: 1013 URL: http://libsyncml.opensync.org/changeset/1013 Log: tolerate lazy programmers which know that the http client transport has no real connect function Modified: trunk/libsyncml/transports/http_client.c trunk/tests/check_libsoup.c Modified: trunk/libsyncml/transports/http_client.c ============================================================================== --- trunk/libsyncml/transports/http_client.c Tue Mar 24 18:46:21 2009 (r1012) +++ trunk/libsyncml/transports/http_client.c Tue Mar 24 18:58:49 2009 (r1013) @@ -77,6 +77,16 @@ * transport layer itself. */ smlTrace(TRACE_INTERNAL, "%s: Connect done", __func__); + if (!env->tsp->connected) + { + /* If a user of the library know that connect + * is not available then this is tolerated. + */ + smlTransportReceiveEvent( + env->tsp, NULL, + SML_TRANSPORT_EVENT_CONNECT_DONE, + NULL, NULL); + } } env->connectDone = TRUE; } Modified: trunk/tests/check_libsoup.c ============================================================================== --- trunk/tests/check_libsoup.c Tue Mar 24 18:46:21 2009 (r1012) +++ trunk/tests/check_libsoup.c Tue Mar 24 18:58:49 2009 (r1013) @@ -291,7 +291,6 @@ sml_fail_unless(smlTransportSetConfigOption(client, "URL", url, &error), NULL); smlTransportSetEventCallback(client, _recv_event, GINT_TO_POINTER(1)); sml_fail_unless(smlTransportInitialize(client, &error), "%s", smlErrorPrint(&error)); - sml_fail_unless(smlTransportConnect(client, &error), "%s", smlErrorPrint(&error)); /* send test message */ |
From: <svn...@op...> - 2009-03-24 17:46:29
|
Author: bellmich Date: Tue Mar 24 18:46:21 2009 New Revision: 1012 URL: http://libsyncml.opensync.org/changeset/1012 Log: clients must call connect (even if it is not implemented) Modified: trunk/tests/check_libsoup.c Modified: trunk/tests/check_libsoup.c ============================================================================== --- trunk/tests/check_libsoup.c Tue Mar 24 18:45:14 2009 (r1011) +++ trunk/tests/check_libsoup.c Tue Mar 24 18:46:21 2009 (r1012) @@ -291,6 +291,7 @@ sml_fail_unless(smlTransportSetConfigOption(client, "URL", url, &error), NULL); smlTransportSetEventCallback(client, _recv_event, GINT_TO_POINTER(1)); sml_fail_unless(smlTransportInitialize(client, &error), "%s", smlErrorPrint(&error)); + sml_fail_unless(smlTransportConnect(client, &error), "%s", smlErrorPrint(&error)); /* send test message */ @@ -319,11 +320,12 @@ sml_fail_unless(smlTransportDisconnect(client, NULL, &error), "%s", smlErrorPrint(&error)); sleep_total = 0; - while (client_disconnects < 1 && sleep_total < sleep_max) + while (client_disconnects < 1 && client_errors < 1 && sleep_total < sleep_max) { sml_sleep(sleep_interval); sleep_total += sleep_interval; } + sml_fail_unless(client_errors == 0, NULL); sml_fail_unless(sleep_total < sleep_max, "client disconnect timed out"); sml_fail_unless(smlTransportFinalize(client, &error), NULL); smlTransportFree(client); @@ -481,11 +483,12 @@ int64_t sleep_max = 5000000000LL; int64_t sleep_interval = 50000000; int64_t sleep_total = 0; - while (server_disconnects < 1 && sleep_total < sleep_max) + while (server_disconnects < 1 && server_errors < 1 && sleep_total < sleep_max) { sml_sleep(sleep_interval); sleep_total += sleep_interval; } + sml_fail_unless(server_errors == 0, NULL); sml_fail_unless(sleep_total < sleep_max, "server disconnect timed out"); sml_fail_unless(smlTransportFinalize(server, &error), NULL); smlTransportFree(server); |
From: <svn...@op...> - 2009-03-24 17:45:26
|
Author: bellmich Date: Tue Mar 24 18:45:14 2009 New Revision: 1011 URL: http://libsyncml.opensync.org/changeset/1011 Log: - If a transport implementation has no public connect function then it cannot send a connect event. - fixed some traces Modified: trunk/libsyncml/transports/http_client.c Modified: trunk/libsyncml/transports/http_client.c ============================================================================== --- trunk/libsyncml/transports/http_client.c Tue Mar 24 16:44:01 2009 (r1010) +++ trunk/libsyncml/transports/http_client.c Tue Mar 24 18:45:14 2009 (r1011) @@ -72,11 +72,16 @@ } else { - smlTransportReceiveEvent(env->tsp, NULL, SML_TRANSPORT_EVENT_CONNECT_DONE, NULL, NULL); + /* If a transport has no public connect function + * then the connect event is sent by the + * transport layer itself. + */ + smlTrace(TRACE_INTERNAL, "%s: Connect done", __func__); } env->connectDone = TRUE; } - smlTrace(TRACE_INTERNAL, "Result: %d %s", msg->status_code, msg->reason_phrase); + smlTrace(TRACE_INTERNAL, "%s: Result: %d %s", + __func__, msg->status_code, msg->reason_phrase); /* start http handling with some checks */ @@ -89,7 +94,8 @@ /* check the header of the received message */ const char *header = soup_message_headers_get(msg->response_headers, "Content-Type"); - smlTrace(TRACE_INTERNAL, "content type: %s", header); + smlTrace(TRACE_INTERNAL, "%s: content type ::= %s", + __func__, header); SmlMimeType mimetype = SML_MIMETYPE_UNKNOWN; if (header && !g_strncasecmp(header, SML_ELEMENT_XML, strlen(SML_ELEMENT_XML))) |
From: <svn...@op...> - 2009-03-24 16:04:05
|
Author: dgollub Date: Tue Mar 24 17:03:47 2009 New Revision: 5303 URL: http://www.opensync.org/changeset/5303 Log: Fix build with latest API changes of r5301 Modified: plugins/syncml/src/syncml_devinf.c Modified: plugins/syncml/src/syncml_devinf.c ============================================================================== --- plugins/syncml/src/syncml_devinf.c Tue Mar 24 16:54:39 2009 (r5302) +++ plugins/syncml/src/syncml_devinf.c Tue Mar 24 17:03:47 2009 (r5303) @@ -1,5 +1,4 @@ #include "syncml_common.h" -#include<opensync/db/opensync_db.h> const char *get_database_pref_content_type( SmlDatabase *database, |
From: <svn...@op...> - 2009-03-24 15:54:46
|
Author: bellmich Date: Tue Mar 24 16:54:39 2009 New Revision: 5302 URL: http://www.opensync.org/changeset/5302 Log: replaced smlTrace with osync_trace Modified: plugins/syncml/src/syncml_common.c Modified: plugins/syncml/src/syncml_common.c ============================================================================== --- plugins/syncml/src/syncml_common.c Tue Mar 24 15:50:40 2009 (r5301) +++ plugins/syncml/src/syncml_common.c Tue Mar 24 16:54:39 2009 (r5302) @@ -266,7 +266,7 @@ if (!env->waitForDisconnect) { /* this is an abort */ - smlTrace(TRACE_INTERNAL, "%s: abort detected", __func__); + osync_trace(TRACE_INTERNAL, "%s: abort detected", __func__); SmlError *error = NULL; if (env->dsObject2 && env->state2 > SML_DATA_SYNC_EVENT_CONNECT) { @@ -465,13 +465,13 @@ osync_context_ref(database->connectCtx); if (g_atomic_int_dec_and_test(&(env->toBeConnected))) { /* all database received the connect callback */ - smlTrace(TRACE_INTERNAL, "%s: executing connect", __func__); + osync_trace(TRACE_INTERNAL, "%s: executing connect", __func__); if (!smlDataSyncInit(env->dsObject1, &error)) goto error; if (!smlDataSyncRun(env->dsObject1, &error)) goto error; } else { - smlTrace(TRACE_INTERNAL, "%s: just another connect", __func__); + osync_trace(TRACE_INTERNAL, "%s: just another connect", __func__); } osync_trace(TRACE_EXIT, "%s", __func__); |
From: <svn...@op...> - 2009-03-24 15:44:15
|
Author: bellmich Date: Tue Mar 24 16:44:01 2009 New Revision: 1010 URL: http://libsyncml.opensync.org/changeset/1010 Log: soup_session_unref => g_object_unref (wrong function name) Modified: trunk/tests/check_libsoup.c Modified: trunk/tests/check_libsoup.c ============================================================================== --- trunk/tests/check_libsoup.c Tue Mar 24 13:43:55 2009 (r1009) +++ trunk/tests/check_libsoup.c Tue Mar 24 16:44:01 2009 (r1010) @@ -421,7 +421,7 @@ #ifdef HAVE_LIBSOUP22_SOLARIS soup_session_abort(session); - soup_session_unref(session); + g_object_unref(session); #else /* cleanup session */ |
From: <svn...@op...> - 2009-03-24 14:50:56
|
Author: dgollub Date: Tue Mar 24 15:50:40 2009 New Revision: 5301 URL: http://www.opensync.org/changeset/5301 Log: Unexexport osync_db interface refs #1050 Modified: trunk/opensync.sym trunk/opensync/db/opensync_db_internals.h Modified: trunk/opensync.sym ============================================================================== --- trunk/opensync.sym Tue Mar 24 15:48:20 2009 (r5300) +++ trunk/opensync.sym Tue Mar 24 15:50:40 2009 (r5301) @@ -89,22 +89,6 @@ osync_data_set_objformat osync_data_set_objtype osync_data_unref -osync_db_bind_blob -osync_db_close -osync_db_count -osync_db_free_list -osync_db_get_blob -osync_db_last_rowid -osync_db_new -osync_db_open -osync_db_query -osync_db_query_single_int -osync_db_query_single_string -osync_db_query_table -osync_db_reset_full -osync_db_reset_table -osync_db_sql_escape -osync_db_table_exists osync_engine_abort osync_engine_continue osync_engine_discover Modified: trunk/opensync/db/opensync_db_internals.h ============================================================================== --- trunk/opensync/db/opensync_db_internals.h Tue Mar 24 15:48:20 2009 (r5300) +++ trunk/opensync/db/opensync_db_internals.h Tue Mar 24 15:50:40 2009 (r5301) @@ -30,7 +30,7 @@ * @ingroup OSyncDB *@{*/ -OSYNC_EXPORT OSyncDB *osync_db_new(OSyncError **error); +OSyncDB *osync_db_new(OSyncError **error); /** * @brief Open a database @@ -40,7 +40,7 @@ * @param error Pointer to a error struct * @return If database opened successfully then TRUE else FALSE */ -OSYNC_EXPORT osync_bool osync_db_open(OSyncDB *db, const char *dbfile, OSyncError **error); +osync_bool osync_db_open(OSyncDB *db, const char *dbfile, OSyncError **error); /** * @brief Close a sqlite3 database file @@ -49,7 +49,7 @@ * @param error Pointer to a error struct * @return If database closed successfully then TRUE else FALSE */ -OSYNC_EXPORT osync_bool osync_db_close(OSyncDB *db, OSyncError **error); +osync_bool osync_db_close(OSyncDB *db, OSyncError **error); /** * @brief Checks if requested table exists in database @@ -59,7 +59,7 @@ * @param error Pointer to a error struct * @return If the table exist 1 else 0. On error -1. */ -OSYNC_EXPORT int osync_db_table_exists(OSyncDB *db, const char *tablename, OSyncError **error); +int osync_db_table_exists(OSyncDB *db, const char *tablename, OSyncError **error); /** * @brief Full reset of a sqlite3 table. @@ -69,8 +69,8 @@ * @param error Pointer to a error struct * @return TRUE on success otherwise FALSE */ -OSYNC_EXPORT osync_bool osync_db_reset_table(OSyncDB *db, const char *tablename, OSyncError **error); -OSYNC_EXPORT osync_bool osync_db_reset_full(OSyncDB *db, OSyncError **error); +osync_bool osync_db_reset_table(OSyncDB *db, const char *tablename, OSyncError **error); +osync_bool osync_db_reset_full(OSyncDB *db, OSyncError **error); /** * @brief Counts result of a database query @@ -80,7 +80,7 @@ * @param error Pointer to a error struct * @return Returns number of query result or -1 on error */ -OSYNC_EXPORT int osync_db_count(OSyncDB *db, const char *query, OSyncError **error); +int osync_db_count(OSyncDB *db, const char *query, OSyncError **error); /** * @brief Execute a SQL query for a single string (char *). Do only use this @@ -92,7 +92,7 @@ * @param error Pointer to a error struct * @return Returns result string from database. NULL on more then one result or on error (the caller is responsible for freeing) */ -OSYNC_EXPORT char *osync_db_query_single_string(OSyncDB *db, const char *query, OSyncError **error); +char *osync_db_query_single_string(OSyncDB *db, const char *query, OSyncError **error); /** * @brief Execute a SQL query for a single integer. Do only use this @@ -104,7 +104,7 @@ * @param error Pointer to a error struct * @return Returns result integer from database. On more then one result or on error -1 */ -OSYNC_EXPORT int osync_db_query_single_int(OSyncDB *db, const char *query, OSyncError **error); +int osync_db_query_single_int(OSyncDB *db, const char *query, OSyncError **error); /** * @brief Executes a simple SQL query @@ -114,7 +114,7 @@ * @param error Pointer to a error struct * @return Returns TRUE on success otherwise FALSE */ -OSYNC_EXPORT osync_bool osync_db_query(OSyncDB *db, const char *query, OSyncError **error); +osync_bool osync_db_query(OSyncDB *db, const char *query, OSyncError **error); /** * @brief Exectues a SQL query and fill all requested data in a OSyncList. @@ -125,14 +125,14 @@ * @param error Pointer to a error struct * @return Returns pointer to OSyncList which contains the each result as another OSyncList ptr. Freeing is recommend with osync_db_free_list() */ -OSYNC_EXPORT OSyncList *osync_db_query_table(OSyncDB *db, const char *query, OSyncError **error); +OSyncList *osync_db_query_table(OSyncDB *db, const char *query, OSyncError **error); /** * @brief Frees the full result of osync_db_query_table(). * * @param list Result OSyncList pointer of osync_db_query_table() */ -OSYNC_EXPORT void osync_db_free_list(OSyncList *list); +void osync_db_free_list(OSyncList *list); /** * @brief Insert a data (blob) in database. @@ -144,7 +144,7 @@ * @param error Pointer to a error struct * @return TRUE on success otherwise FALSE */ -OSYNC_EXPORT osync_bool osync_db_bind_blob(OSyncDB *db, const char *query, const char *data, unsigned int size, OSyncError **error); +osync_bool osync_db_bind_blob(OSyncDB *db, const char *query, const char *data, unsigned int size, OSyncError **error); /** * @brief Get a data (blob) from the database. @@ -156,10 +156,10 @@ * @param error Pointer to a error struct * @return 1 on success, 0 no result, -1 on error. */ -OSYNC_EXPORT int osync_db_get_blob(OSyncDB *db, const char *query, char **data, unsigned int *size, OSyncError **error); +int osync_db_get_blob(OSyncDB *db, const char *query, char **data, unsigned int *size, OSyncError **error); -OSYNC_EXPORT long long int osync_db_last_rowid(OSyncDB *db); -OSYNC_EXPORT char *osync_db_sql_escape(const char *query); +long long int osync_db_last_rowid(OSyncDB *db); +char *osync_db_sql_escape(const char *query); /*@}*/ #endif /* _OPENSYNC_DB_H_ */ |
From: <svn...@op...> - 2009-03-24 14:48:36
|
Author: dgollub Date: Tue Mar 24 15:48:20 2009 New Revision: 5300 URL: http://www.opensync.org/changeset/5300 Log: Dropped public osync_db_ interface. The public osync_db_ interface needs a redesing - which is not mandatory for 0.40. (partial commit facing issues with webserver) refs #1050 Added: trunk/opensync/db/opensync_db_internals.h (props changed) - copied unchanged from r5299, trunk/opensync/db/opensync_db.h Deleted: trunk/opensync/db/opensync_db.h Modified: trunk/opensync/archive/opensync_archive.c trunk/opensync/db/opensync_db.c trunk/opensync/group/opensync_group.c trunk/opensync/helper/opensync_anchor.c trunk/opensync/helper/opensync_hashtable.c trunk/opensync/opensync-db.h Modified: trunk/opensync/archive/opensync_archive.c ============================================================================== --- trunk/opensync/archive/opensync_archive.c Tue Mar 24 15:12:54 2009 (r5299) +++ trunk/opensync/archive/opensync_archive.c Tue Mar 24 15:48:20 2009 (r5300) @@ -29,7 +29,7 @@ #include "opensync-archive.h" #include "opensync_archive_private.h" #include "opensync_archive_internals.h" -#include "opensync-db.h" +#include "db/opensync_db_internals.h" static osync_bool osync_archive_create_changes(OSyncDB *db, const char *objtype, OSyncError **error) { Modified: trunk/opensync/db/opensync_db.c ============================================================================== --- trunk/opensync/db/opensync_db.c Tue Mar 24 15:12:54 2009 (r5299) +++ trunk/opensync/db/opensync_db.c Tue Mar 24 15:48:20 2009 (r5300) @@ -21,7 +21,7 @@ #include "opensync.h" #include "opensync_internals.h" -#include "opensync_db.h" +#include "opensync_db_internals.h" #include "opensync_db_private.h" /* Modified: trunk/opensync/group/opensync_group.c ============================================================================== --- trunk/opensync/group/opensync_group.c Tue Mar 24 15:12:54 2009 (r5299) +++ trunk/opensync/group/opensync_group.c Tue Mar 24 15:48:20 2009 (r5300) @@ -22,13 +22,14 @@ #include "opensync_internals.h" #include "opensync-format.h" + #include "format/opensync_filter_internals.h" #include "common/opensync_xml_internals.h" +#include "db/opensync_db_internals.h" #include "opensync-group.h" #include "opensync_group_internals.h" #include "opensync_group_private.h" -#include "opensync-db.h" #include "opensync_member_internals.h" #ifdef OPENSYNC_UNITTESTS Modified: trunk/opensync/helper/opensync_anchor.c ============================================================================== --- trunk/opensync/helper/opensync_anchor.c Tue Mar 24 15:12:54 2009 (r5299) +++ trunk/opensync/helper/opensync_anchor.c Tue Mar 24 15:48:20 2009 (r5300) @@ -22,7 +22,7 @@ #include "opensync_internals.h" #include "opensync-helper.h" -#include "opensync-db.h" +#include "db/opensync_db_internals.h" #include "opensync_anchor_internals.h" #include "opensync_anchor_private.h" Modified: trunk/opensync/helper/opensync_hashtable.c ============================================================================== --- trunk/opensync/helper/opensync_hashtable.c Tue Mar 24 15:12:54 2009 (r5299) +++ trunk/opensync/helper/opensync_hashtable.c Tue Mar 24 15:48:20 2009 (r5300) @@ -26,7 +26,7 @@ #include "opensync-data.h" #include "opensync-helper.h" -#include "opensync-db.h" +#include "db/opensync_db_internals.h" /* start private api */ Modified: trunk/opensync/opensync-db.h ============================================================================== --- trunk/opensync/opensync-db.h Tue Mar 24 15:12:54 2009 (r5299) +++ trunk/opensync/opensync-db.h Tue Mar 24 15:48:20 2009 (r5300) @@ -23,7 +23,12 @@ OPENSYNC_BEGIN_DECLS +/* FIXME: Legacy include. Will be dropped for 0.39 */ +#warning "FIXME: <opensync/opensync-db.h> Legacy include. Will be dropped for 0.39." + +/* TODO: new public interface of #1050 #include "db/opensync_db.h" +*/ OPENSYNC_END_DECLS |
From: <svn...@op...> - 2009-03-24 14:13:06
|
Author: dgollub Date: Tue Mar 24 15:12:54 2009 New Revision: 5299 URL: http://www.opensync.org/changeset/5299 Log: Temporarily disable devinf caching (#1079) due to dropping the OSyncDB interface from public API #1050. refs #1079 refs #1050 Modified: plugins/syncml/src/syncml_common.c plugins/syncml/src/syncml_devinf.c Modified: plugins/syncml/src/syncml_common.c ============================================================================== --- plugins/syncml/src/syncml_common.c Sun Mar 22 12:13:43 2009 (r5298) +++ plugins/syncml/src/syncml_common.c Tue Mar 24 15:12:54 2009 (r5299) @@ -815,8 +815,12 @@ smlDataSyncRegisterGetAlertTypeCallback(env->dsObject1, _get_alert_type, env); smlDataSyncRegisterGetAnchorCallback(env->dsObject1, _get_anchor, env); smlDataSyncRegisterSetAnchorCallback(env->dsObject1, _set_anchor, env); + + /* FIXME: disabled devinf callbacks due to missing OSyncCapabilities interface - #1079 smlDataSyncRegisterWriteDevInfCallback(env->dsObject1, _write_devinf, env); smlDataSyncRegisterReadDevInfCallback(env->dsObject1, _read_devinf, env); + */ + smlDataSyncRegisterHandleRemoteDevInfCallback(env->dsObject1, _handle_remote_devinf, env); smlDataSyncRegisterChangeStatusCallback(env->dsObject1, _recv_change_status); if (sessionType == SML_SESSION_TYPE_CLIENT) @@ -825,8 +829,11 @@ smlDataSyncRegisterGetAlertTypeCallback(env->dsObject2, _get_alert_type, env); smlDataSyncRegisterGetAnchorCallback(env->dsObject2, _get_anchor, env); smlDataSyncRegisterSetAnchorCallback(env->dsObject2, _set_anchor, env); + + /* FIXME: disabled devinf callbacks due to missing OSyncCapabilities interface - #1079 smlDataSyncRegisterWriteDevInfCallback(env->dsObject2, _write_devinf, env); smlDataSyncRegisterReadDevInfCallback(env->dsObject2, _read_devinf, env); + */ smlDataSyncRegisterHandleRemoteDevInfCallback(env->dsObject2, _handle_remote_devinf, env); smlDataSyncRegisterChangeStatusCallback(env->dsObject2, _recv_change_status); } Modified: plugins/syncml/src/syncml_devinf.c ============================================================================== --- plugins/syncml/src/syncml_devinf.c Sun Mar 22 12:13:43 2009 (r5298) +++ plugins/syncml/src/syncml_devinf.c Tue Mar 24 15:12:54 2009 (r5299) @@ -39,6 +39,8 @@ return ct; } +#if 0 /* MISSING OSYNC CAPABILITIES - #1079 */ + /* ************************ */ /* CACHE DATABASE */ /* ************************ */ @@ -780,3 +782,5 @@ return load_devinf(devid, env->devinf_path, error); } +#endif /* MISSING OSYNC CAPABILITIES - #1079 */ + |
From: <svn...@op...> - 2009-03-24 12:44:06
|
Author: bellmich Date: Tue Mar 24 13:43:55 2009 New Revision: 1009 URL: http://libsyncml.opensync.org/changeset/1009 Log: libsoup_async respects now that SoupSessionAsync was designed for single-threaded applications. Modified: trunk/tests/check_libsoup.c Modified: trunk/tests/check_libsoup.c ============================================================================== --- trunk/tests/check_libsoup.c Tue Mar 24 13:41:46 2009 (r1008) +++ trunk/tests/check_libsoup.c Tue Mar 24 13:43:55 2009 (r1009) @@ -336,6 +336,36 @@ smlTrace(TRACE_EXIT, "%s", __func__); } +GMainContext *client_ctx; +SoupSession *client_session; + +SmlBool init_soup_session(gpointer data, SmlError **error) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + sml_fail_unless(data != NULL, NULL); + SoupMessage *msg = data; + client_session = soup_session_async_new_with_options( + SOUP_SESSION_ASYNC_CONTEXT, client_ctx, + SOUP_SESSION_TIMEOUT, 5, + NULL); + sml_fail_unless(client_session != NULL, NULL); + soup_session_queue_message(client_session, msg, client_callback, NULL); + return TRUE; +} + +SmlBool cleanup_soup_session(gpointer data, SmlError **error) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + + smlTrace(TRACE_INTERNAL, "%s: aborting session", __func__); + soup_session_abort(client_session); + smlTrace(TRACE_INTERNAL, "%s: unref session", __func__); + g_object_unref(client_session); + + smlTrace(TRACE_EXIT, "%s", __func__); + return TRUE; +} + START_TEST (libsoup_async) { smlTrace(TRACE_ENTRY, "%s", __func__); @@ -365,17 +395,13 @@ #else /* create asynchronous client */ - GMainContext *client_ctx = g_main_context_new(); + client_ctx = g_main_context_new(); sml_fail_unless(client_ctx != NULL, NULL); SmlThread *client_thread = smlThreadNew(client_ctx, &error); sml_fail_unless(client_thread != NULL, "%s", smlErrorPrint(&error)); smlThreadStart(client_thread); - SoupSession *session = soup_session_async_new_with_options( - SOUP_SESSION_ASYNC_CONTEXT, client_ctx, - SOUP_SESSION_TIMEOUT, 5, - NULL); - sml_fail_unless(session != NULL, NULL); - soup_session_queue_message(session, msg, client_callback, NULL); + + sml_fail_unless(smlThreadCallFunction(client_thread, init_soup_session, msg, &error), "%s", smlErrorPrint(&error)); #endif /* test and cleanup server */ @@ -392,13 +418,20 @@ sleep_total += sleep_interval; } sml_fail_unless(sleep_total < sleep_max, "client disconnect timed out"); - smlTrace(TRACE_INTERNAL, "%s: aborting session", __func__); + +#ifdef HAVE_LIBSOUP22_SOLARIS soup_session_abort(session); - // FIXME: This crashes sometimes. - // smlTrace(TRACE_INTERNAL, "%s: unref session", __func__); - // g_object_unref(session); + soup_session_unref(session); +#else + /* cleanup session */ + + sml_fail_unless(smlThreadCallFunction(client_thread, cleanup_soup_session, NULL, &error), "%s", smlErrorPrint(&error)); -#ifndef HAVE_LIBSOUP22_SOLARIS + /* The client thread must be stopped first + * because libsoup is not thread safe. + * If the client thread is still running + * then the behaviour of the session is not predictable. + */ smlTrace(TRACE_INTERNAL, "%s: cleanup client thread", __func__); smlThreadStop(client_thread); smlThreadFree(client_thread); |
From: <svn...@op...> - 2009-03-24 12:42:03
|
Author: bellmich Date: Tue Mar 24 13:41:46 2009 New Revision: 1008 URL: http://libsyncml.opensync.org/changeset/1008 Log: added an internal function to run a function in a special thread This feature is necessary because some libaries like libsoup are only designed for single-threaded applications. This means that every function must be called from the same thread. Otherwise there is no guarantee about the behaviour of the library. Modified: trunk/libsyncml/sml_support.c trunk/libsyncml/sml_support.h Modified: trunk/libsyncml/sml_support.c ============================================================================== --- trunk/libsyncml/sml_support.c Mon Mar 23 16:55:38 2009 (r1007) +++ trunk/libsyncml/sml_support.c Tue Mar 24 13:41:46 2009 (r1008) @@ -496,6 +496,111 @@ smlTrace(TRACE_EXIT, "%s", __func__); } +/** + * This context is used to cache the environment for direct function + * calls within a special thread. + * Please see smlThreadCallFunction for more details. + */ +typedef struct SmlThreadFunctionContext { + GMutex *mutex; + GCond *cond; + SmlThreadCallFunctionType func; + gpointer data; + SmlBool result; + SmlError **error; +} SmlThreadFunctionContext; + +/** + * This callback is used to call a function within a special thread. + * Please see smlThreadCallFunction for more details. + */ +gboolean smlThreadCallFunctionCallback(gpointer data) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + smlAssert(data); + + SmlThreadFunctionContext *ctx = data; + ctx->result = ctx->func(ctx->data, ctx->error); + g_mutex_lock(ctx->mutex); + g_cond_signal(ctx->cond); + g_mutex_unlock(ctx->mutex); + + /* This function should only run once. */ + smlTrace(TRACE_EXIT, "%s", __func__); + return FALSE; +} + +/** + * This function can be used to execute a function in a special thread. + * Some libraries are designed for single-threaded applications. + * They require that a set of commands is only executed in one thread. + * These applications use g_main_loop too. So the functions must be + * executed in this loop. This will be done synchronously by this + * function. + * + * Please note: This function is blocking. + * Please note: The glib source priority is IDLE. + */ +SmlBool smlThreadCallFunction( + SmlThread *thread, + SmlThreadCallFunctionType func, + gpointer data, + SmlError **error) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + CHECK_ERROR_REF + smlAssert(func); + + /* initialize function context */ + SmlThreadFunctionContext *ctx; + ctx = smlTryMalloc0(sizeof(SmlThreadFunctionContext), error); + if (!ctx) + goto error; + ctx->mutex = g_mutex_new(); + if (!ctx->mutex) { + smlErrorSet(error, SML_ERROR_GENERIC, "Cannot create new mutex."); + goto error; + } + ctx->cond = g_cond_new(); + if (!ctx->cond) { + smlErrorSet(error, SML_ERROR_GENERIC, "Cannot create new condition."); + goto error; + } + ctx->func = func; + ctx->data = data; + ctx->error = error; + + /* prepare glib source */ + GSource *source = g_idle_source_new(); + g_source_set_callback(source, smlThreadCallFunctionCallback, ctx, NULL); + + /* call function "synchronously" */ + g_mutex_lock(ctx->mutex); + g_source_attach(source, thread->context); + g_cond_wait(ctx->cond, ctx->mutex); + g_mutex_unlock(ctx->mutex); + + /* cleanup */ + SmlBool result = ctx->result; + g_source_unref(source); + g_mutex_free(ctx->mutex); + g_cond_free(ctx->cond); + smlSafeFree((gpointer *) &ctx); + + /* return result */ + smlTrace(TRACE_EXIT, "%s - %i", __func__, result); + return result; +error: + if (ctx->cond) + g_cond_free(ctx->cond); + if (ctx->mutex) + g_mutex_free(ctx->mutex); + if (ctx) + smlSafeFree((gpointer *) &ctx); + smlTrace(TRACE_EXIT_ERROR, "%s - %s", __func__, smlErrorPrint(error)); + return FALSE; +} + void smlSafeFree(gpointer *address) { smlAssert(address); Modified: trunk/libsyncml/sml_support.h ============================================================================== --- trunk/libsyncml/sml_support.h Mon Mar 23 16:55:38 2009 (r1007) +++ trunk/libsyncml/sml_support.h Tue Mar 24 13:41:46 2009 (r1008) @@ -63,6 +63,16 @@ void smlThreadStart(SmlThread *thread); void smlThreadStop(SmlThread *thread); +typedef SmlBool (* SmlThreadCallFunctionType) ( + gpointer data, + SmlError **error); + +SmlBool smlThreadCallFunction( + SmlThread *thread, + SmlThreadCallFunctionType func, + gpointer data, + SmlError **error); + void smlSafeFree(gpointer *address); void smlSafeCFree(char **address); |
From: <svn...@op...> - 2009-03-24 09:28:27
|
Author: bellmich Date: Tue Mar 24 10:28:20 2009 New Revision: 197 URL: http://libwbxml.opensync.org/changeset/197 Log: commited patch from ticket #31 It fixes the installation on MS Windows. Modified: wbxml2/trunk/src/CMakeLists.txt Modified: wbxml2/trunk/src/CMakeLists.txt ============================================================================== --- wbxml2/trunk/src/CMakeLists.txt Mon Mar 9 13:33:47 2009 (r196) +++ wbxml2/trunk/src/CMakeLists.txt Tue Mar 24 10:28:20 2009 (r197) @@ -27,7 +27,11 @@ SET_TARGET_PROPERTIES( wbxml2 PROPERTIES VERSION ${LIBWBXML_LIBVERSION_VERSION} ) TARGET_LINK_LIBRARIES( wbxml2 ${EXPAT_LIBRARIES} ) -INSTALL( TARGETS wbxml2 DESTINATION ${LIBWBXML_LIBRARIES_DIR} ) +INSTALL( TARGETS wbxml2 + RUNTIME DESTINATION ${LIBWBXML_BIN_DIR} + LIBRARY DESTINATION ${LIBWBXML_LIBRARIES_DIR} + ARCHIVE DESTINATION ${LIBWBXML_LIBRARIES_DIR} +) INSTALL( FILES wbxml.h |
From: <svn...@op...> - 2009-03-23 15:55:43
|
Author: bellmich Date: Mon Mar 23 16:55:38 2009 New Revision: 1007 URL: http://libsyncml.opensync.org/changeset/1007 Log: added code to test the http server transport Modified: trunk/tests/check_libsoup.c Modified: trunk/tests/check_libsoup.c ============================================================================== --- trunk/tests/check_libsoup.c Mon Mar 23 15:48:13 2009 (r1006) +++ trunk/tests/check_libsoup.c Mon Mar 23 16:55:38 2009 (r1007) @@ -34,6 +34,8 @@ #endif static int server_messages; +static int server_connects; +static int server_disconnects; static int server_errors; static int client_messages; @@ -129,6 +131,7 @@ SmlThread *server_thread; SmlQueue *queue; SoupServer *server; +SmlLink *server_link; static void init_server(unsigned int port) { smlTrace(TRACE_ENTRY, "%s", __func__); @@ -204,7 +207,7 @@ } -SmlBool _recv_client_event( +SmlBool _recv_event( SmlTransport *tsp, SmlLink *link, SmlTransportEventType type, @@ -214,24 +217,59 @@ { smlTrace(TRACE_ENTRY, "%s(%d)", __func__, type); - sml_fail_unless(GPOINTER_TO_INT(userdata) == 1, NULL); + int source = GPOINTER_TO_INT(userdata); switch (type) { case SML_TRANSPORT_EVENT_CONNECT_DONE: - g_atomic_int_inc(&client_connects); + if (source == 1) + g_atomic_int_inc(&client_connects); + else + g_atomic_int_inc(&server_connects); break; case SML_TRANSPORT_EVENT_DISCONNECT_DONE: - g_atomic_int_inc(&client_disconnects); + if (source == 1) + g_atomic_int_inc(&client_disconnects); + else + g_atomic_int_inc(&server_disconnects); break; case SML_TRANSPORT_EVENT_DATA: - sml_fail_unless(!strcmp(data->data, "answer"), NULL); - sml_fail_unless(data->size == 6, NULL); - sml_fail_unless(data->type == SML_MIMETYPE_XML, NULL); - g_atomic_int_inc(&client_messages); + sml_fail_unless(1 <= source && source <= 2, NULL); + if (source == 1) { + sml_fail_unless(!strcmp(data->data, "answer"), NULL); + sml_fail_unless(data->size == 6, NULL); + sml_fail_unless(data->type == SML_MIMETYPE_XML, NULL); + g_atomic_int_inc(&client_messages); + } else { + if (link) { + server_link = link; + smlLinkRef(server_link); + } + + sml_fail_unless(!strcmp(data->data, "test"), NULL); + sml_fail_unless(data->size == 4, NULL); + sml_fail_unless(data->type == SML_MIMETYPE_XML, NULL); + g_atomic_int_inc(&server_messages); + + SmlTransportData *data; + data = smlTransportDataNew( + "answer", 6, + SML_MIMETYPE_XML, FALSE, + &error); + sml_fail_unless(data != NULL, NULL); + sml_fail_unless(error == NULL, NULL); + + sml_fail_unless(smlTransportSend(tsp, server_link, data, &error), NULL); + sml_fail_unless(error == NULL, NULL); + + smlTransportDataDeref(data); + } break; case SML_TRANSPORT_EVENT_ERROR: sml_fail_unless(error != NULL, NULL); - g_atomic_int_inc(&client_errors); + if (source == 1) + g_atomic_int_inc(&client_errors); + else + g_atomic_int_inc(&server_errors); break; default: sml_fail_unless(FALSE, "An unexpected transport event %d was received.", type); @@ -251,7 +289,7 @@ SmlTransport *client = smlTransportNew(SML_TRANSPORT_HTTP_CLIENT, &error); sml_fail_unless(smlTransportSetConfigOption(client, "URL", url, &error), NULL); - smlTransportSetEventCallback(client, _recv_client_event, GINT_TO_POINTER(1)); + smlTransportSetEventCallback(client, _recv_event, GINT_TO_POINTER(1)); sml_fail_unless(smlTransportInitialize(client, &error), "%s", smlErrorPrint(&error)); /* send test message */ @@ -385,6 +423,42 @@ } END_TEST +START_TEST (libsoup_http_server) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + init_testbed(); + SmlError *error = NULL; + + /* init server transport */ + + SmlTransport *server = smlTransportNew(SML_TRANSPORT_HTTP_SERVER, &error); + sml_fail_unless(server != NULL, "%s", smlErrorPrint(&error)); + sml_fail_unless(smlTransportSetConfigOption(server, "PORT", "13003", &error), NULL); + smlTransportSetEventCallback(server, _recv_event, GINT_TO_POINTER(2)); + sml_fail_unless(smlTransportInitialize(server, &error), "%s", smlErrorPrint(&error)); + + /* client stuff */ + + run_transport_client("http://127.0.0.1:13003"); + + /* cleanup server transport */ + + sml_fail_unless(smlTransportDisconnect(server, server_link, &error), NULL); + smlLinkDeref(server_link); + int64_t sleep_max = 5000000000LL; + int64_t sleep_interval = 50000000; + int64_t sleep_total = 0; + while (server_disconnects < 1 && sleep_total < sleep_max) + { + sml_sleep(sleep_interval); + sleep_total += sleep_interval; + } + sml_fail_unless(sleep_total < sleep_max, "server disconnect timed out"); + sml_fail_unless(smlTransportFinalize(server, &error), NULL); + smlTransportFree(server); +} +END_TEST + Suite *http_suite(void) { Suite *s = suite_create("libsoup validation"); @@ -392,6 +466,7 @@ create_case(s, "libsoup_async", libsoup_async); create_case(s, "libsoup_http_client", libsoup_http_client); + create_case(s, "libsoup_http_server", libsoup_http_server); return s; } |
From: <svn...@op...> - 2009-03-23 14:48:20
|
Author: bellmich Date: Mon Mar 23 15:48:13 2009 New Revision: 1006 URL: http://libsyncml.opensync.org/changeset/1006 Log: added some code to test the http client of libsyncml Modified: trunk/tests/check_libsoup.c Modified: trunk/tests/check_libsoup.c ============================================================================== --- trunk/tests/check_libsoup.c Mon Mar 23 13:10:01 2009 (r1005) +++ trunk/tests/check_libsoup.c Mon Mar 23 15:48:13 2009 (r1006) @@ -20,6 +20,7 @@ #include "support.h" #include <libsyncml/sml_queue_internals.h> +#include <libsyncml/sml_transport_internals.h> #include <libsoup/soup-session-async.h> #include <libsoup/soup-uri.h> @@ -59,6 +60,7 @@ void transport_dummy_callback(void *message, void *userdata) { /* this function should never be called */ + smlTrace(TRACE_ERROR, "%s", __func__); g_atomic_int_inc(&server_errors); } @@ -94,8 +96,18 @@ } else { g_atomic_int_inc(&server_errors); } - /* glib has problems if it must print NULL on Solaris */ + + /* prepare the response*/ + soup_message_set_status (msg, SOUP_STATUS_OK); + soup_message_set_response ( + msg, SML_ELEMENT_XML, +#ifdef HAVE_LIBSOUP22 + SOUP_BUFFER_STATIC, +#else + SOUP_MEMORY_STATIC, +#endif + "answer", 6); smlTrace(TRACE_EXIT, "%s", __func__); } @@ -119,6 +131,7 @@ SoupServer *server; static void init_server(unsigned int port) { + smlTrace(TRACE_ENTRY, "%s", __func__); SmlError *error = NULL; /* prepare asynchronous runtime environment */ @@ -156,10 +169,13 @@ /* start thread */ smlThreadStart(server_thread); + + smlTrace(TRACE_EXIT, "%s", __func__); } static void cleanup_server() { + smlTrace(TRACE_ENTRY, "%s", __func__); /* wait until message was received by server */ int64_t sleep_max = 5000000000LL; @@ -184,11 +200,107 @@ soup_server_quit(server); g_object_unref(server); smlQueueFree(queue); + smlTrace(TRACE_EXIT, "%s", __func__); + +} + +SmlBool _recv_client_event( + SmlTransport *tsp, + SmlLink *link, + SmlTransportEventType type, + SmlTransportData *data, + SmlError *error, + void *userdata) +{ + smlTrace(TRACE_ENTRY, "%s(%d)", __func__, type); + + sml_fail_unless(GPOINTER_TO_INT(userdata) == 1, NULL); + + switch (type) { + case SML_TRANSPORT_EVENT_CONNECT_DONE: + g_atomic_int_inc(&client_connects); + break; + case SML_TRANSPORT_EVENT_DISCONNECT_DONE: + g_atomic_int_inc(&client_disconnects); + break; + case SML_TRANSPORT_EVENT_DATA: + sml_fail_unless(!strcmp(data->data, "answer"), NULL); + sml_fail_unless(data->size == 6, NULL); + sml_fail_unless(data->type == SML_MIMETYPE_XML, NULL); + g_atomic_int_inc(&client_messages); + break; + case SML_TRANSPORT_EVENT_ERROR: + sml_fail_unless(error != NULL, NULL); + g_atomic_int_inc(&client_errors); + break; + default: + sml_fail_unless(FALSE, "An unexpected transport event %d was received.", type); + break; + } + + smlTrace(TRACE_EXIT, "%s()", __func__); + return TRUE; +} + +static void run_transport_client(const char *url) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + SmlError *error = NULL; + + /* init client */ + + SmlTransport *client = smlTransportNew(SML_TRANSPORT_HTTP_CLIENT, &error); + sml_fail_unless(smlTransportSetConfigOption(client, "URL", url, &error), NULL); + smlTransportSetEventCallback(client, _recv_client_event, GINT_TO_POINTER(1)); + sml_fail_unless(smlTransportInitialize(client, &error), "%s", smlErrorPrint(&error)); + + /* send test message */ + + SmlTransportData *data = smlTransportDataNew("test", 4, SML_MIMETYPE_XML, FALSE, &error); + sml_fail_unless(data != NULL, NULL); + sml_fail_unless(error == NULL, NULL); + + sml_fail_unless(smlTransportSend(client, NULL, data, &error), NULL); + sml_fail_unless(error == NULL, NULL); + + smlTransportDataDeref(data); + + /* wait for client connect */ + + int64_t sleep_max = 5000000000LL; + int64_t sleep_interval = 50000000; + int64_t sleep_total = 0; + while (client_connects < 1 && sleep_total < sleep_max) + { + sml_sleep(sleep_interval); + sleep_total += sleep_interval; + } + sml_fail_unless(sleep_total < sleep_max, "client connect timed out"); + + /* cleanup client */ + + sml_fail_unless(smlTransportDisconnect(client, NULL, &error), "%s", smlErrorPrint(&error)); + sleep_total = 0; + while (client_disconnects < 1 && sleep_total < sleep_max) + { + sml_sleep(sleep_interval); + sleep_total += sleep_interval; + } + sml_fail_unless(sleep_total < sleep_max, "client disconnect timed out"); + sml_fail_unless(smlTransportFinalize(client, &error), NULL); + smlTransportFree(client); + + /* verify results */ + sml_fail_unless(client_errors == 0, NULL); + // sml_fail_unless(client_messages != 0, NULL); + + smlTrace(TRACE_EXIT, "%s", __func__); } START_TEST (libsoup_async) { + smlTrace(TRACE_ENTRY, "%s", __func__); init_testbed(); SmlError *error = NULL; @@ -228,15 +340,48 @@ soup_session_queue_message(session, msg, client_callback, NULL); #endif - /* cleanup */ + /* test and cleanup server */ cleanup_server(); + + /* wait for client disconnect */ + + int64_t sleep_max = 5000000000LL; + int64_t sleep_interval = 50000000; + int64_t sleep_total = 0; + while (client_messages < 1 && sleep_total < sleep_max) + { + sml_sleep(sleep_interval); + sleep_total += sleep_interval; + } + sml_fail_unless(sleep_total < sleep_max, "client disconnect timed out"); + smlTrace(TRACE_INTERNAL, "%s: aborting session", __func__); soup_session_abort(session); - g_object_unref(session); + // FIXME: This crashes sometimes. + // smlTrace(TRACE_INTERNAL, "%s: unref session", __func__); + // g_object_unref(session); + #ifndef HAVE_LIBSOUP22_SOLARIS + smlTrace(TRACE_INTERNAL, "%s: cleanup client thread", __func__); smlThreadStop(client_thread); smlThreadFree(client_thread); + smlTrace(TRACE_INTERNAL, "%s: cleanup client context", __func__); g_main_context_unref(client_ctx); #endif + + smlTrace(TRACE_EXIT, "%s", __func__); +} +END_TEST + +START_TEST (libsoup_http_client) +{ + smlTrace(TRACE_ENTRY, "%s", __func__); + init_testbed(); + SmlError *error = NULL; + + init_server(13002); + run_transport_client("http://127.0.0.1:13002"); + cleanup_server(); + smlTrace(TRACE_EXIT, "%s", __func__); } END_TEST @@ -246,6 +391,7 @@ //Suite *s2 = suite_create("libsoup validation"); create_case(s, "libsoup_async", libsoup_async); + create_case(s, "libsoup_http_client", libsoup_http_client); return s; } |
From: <svn...@op...> - 2009-03-23 12:10:13
|
Author: bellmich Date: Mon Mar 23 13:10:01 2009 New Revision: 1005 URL: http://libsyncml.opensync.org/changeset/1005 Log: modularized the code Modified: trunk/tests/check_libsoup.c Modified: trunk/tests/check_libsoup.c ============================================================================== --- trunk/tests/check_libsoup.c Mon Mar 23 11:21:24 2009 (r1004) +++ trunk/tests/check_libsoup.c Mon Mar 23 13:10:01 2009 (r1005) @@ -35,6 +35,11 @@ static int server_messages; static int server_errors; +static int client_messages; +static int client_connects; +static int client_disconnects; +static int client_errors; + static void init_testbed() { setup_testbed(NULL); @@ -43,6 +48,11 @@ server_messages = 0; server_errors = 0; + + client_messages = 0; + client_connects = 0; + client_disconnects = 0; + client_errors = 0; } /* dummy callback for the transport queue */ @@ -53,7 +63,10 @@ } #ifdef HAVE_LIBSOUP22 -static void server_callback(SoupServerContext *context, SoupMessage *msg, gpointer data) +static void server_callback( + SoupServerContext *context, + SoupMessage *msg, + gpointer data) #else static void server_callback( SoupServer *server, @@ -89,46 +102,97 @@ #ifdef HAVE_LIBSOUP22 static void client_callback(SoupMessage *msg, gpointer userdata) #else -static void client_callback(SoupSession *session, SoupMessage *msg, gpointer userdata) +static void client_callback( + SoupSession *session, + SoupMessage *msg, + gpointer userdata) #endif { smlTrace(TRACE_ENTRY, "%s(%p)", __func__, msg); + g_atomic_int_inc(&client_messages); smlTrace(TRACE_EXIT, "%s", __func__); } -START_TEST (libsoup_async) +GMainContext *server_ctx; +SmlThread *server_thread; +SmlQueue *queue; +SoupServer *server; +static void init_server(unsigned int port) { - init_testbed(); SmlError *error = NULL; /* prepare asynchronous runtime environment */ - GMainContext *ctx = g_main_context_new(); - sml_fail_unless(ctx != NULL, NULL); - SmlThread *thread = smlThreadNew(ctx, &error); - sml_fail_unless(thread != NULL, "%s", smlErrorPrint(&error)); + server_ctx = g_main_context_new(); + sml_fail_unless(server_ctx != NULL, NULL); + server_thread = smlThreadNew(server_ctx, &error); + sml_fail_unless(server_thread != NULL, "%s", smlErrorPrint(&error)); /* simulate the transport layer behaviour */ - SmlQueue *queue = smlQueueNew(&error); + queue = smlQueueNew(&error); sml_fail_unless(queue != NULL, "%s", smlErrorPrint(&error)); smlQueueSetHandler(queue, (SmlQueueHandler)transport_dummy_callback, NULL); - smlQueueAttach(queue, ctx); + smlQueueAttach(queue, server_ctx); /* create async server */ - SoupServer *server = soup_server_new (SOUP_SERVER_PORT, 13001, SOUP_SERVER_ASYNC_CONTEXT, ctx, NULL); + server = soup_server_new ( + SOUP_SERVER_PORT, port, + SOUP_SERVER_ASYNC_CONTEXT, server_ctx, + NULL); sml_fail_unless(server != NULL, NULL); #ifdef HAVE_LIBSOUP22 - soup_server_add_handler (server, NULL, NULL, server_callback, NULL, NULL); -#else - soup_server_add_handler (server, NULL, server_callback, NULL, NULL); + soup_server_add_handler( + server, NULL, NULL, + server_callback, NULL, NULL); +#else + soup_server_add_handler ( + server, NULL, + server_callback, NULL, NULL); #endif - soup_server_run_async (server); + soup_server_run_async (server); /* start thread */ - smlThreadStart(thread); + smlThreadStart(server_thread); +} + +static void cleanup_server() +{ + /* wait until message was received by server */ + + int64_t sleep_max = 5000000000LL; + int64_t sleep_interval = 50000000; + int64_t sleep_total = 0; + while (server_messages < 1 && server_errors < 1 && sleep_total < sleep_max) + { + sml_sleep(sleep_interval); + sleep_total += sleep_interval; + } + + /* check counter */ + + sml_fail_unless(sleep_total < sleep_max, "timeout detected"); + sml_fail_unless(server_messages == 1, NULL); + sml_fail_unless(server_errors == 0, NULL); + + /* cleanup */ + smlThreadStop(server_thread); + smlThreadFree(server_thread); + g_main_context_unref(server_ctx); + soup_server_quit(server); + g_object_unref(server); + smlQueueFree(queue); + +} + +START_TEST (libsoup_async) +{ + init_testbed(); + SmlError *error = NULL; + + init_server(13001); /* prepare message */ @@ -164,24 +228,8 @@ soup_session_queue_message(session, msg, client_callback, NULL); #endif - /* wait until message was received by server */ - - int64_t sleep_max = 5000000000LL; - int64_t sleep_interval = 50000000; - int64_t sleep_total = 0; - while (server_messages < 1 && server_errors < 1 && sleep_total < sleep_max) - { - sml_sleep(sleep_interval); - sleep_total += sleep_interval; - } - - /* check counter */ - - sml_fail_unless(sleep_total < sleep_max, "timeout detected"); - sml_fail_unless(server_messages == 1, NULL); - sml_fail_unless(server_errors == 0, NULL); - /* cleanup */ + cleanup_server(); soup_session_abort(session); g_object_unref(session); #ifndef HAVE_LIBSOUP22_SOLARIS @@ -189,13 +237,6 @@ smlThreadFree(client_thread); g_main_context_unref(client_ctx); #endif - - smlThreadStop(thread); - smlThreadFree(thread); - g_main_context_unref(ctx); - soup_server_quit(server); - g_object_unref(server); - smlQueueFree(queue); } END_TEST |
From: <svn...@op...> - 2009-03-23 10:21:32
|
Author: bellmich Date: Mon Mar 23 11:21:24 2009 New Revision: 1004 URL: http://libsyncml.opensync.org/changeset/1004 Log: integrated Solaris libsoup 2.2 testing Modified: trunk/tests/check_libsoup.c Modified: trunk/tests/check_libsoup.c ============================================================================== --- trunk/tests/check_libsoup.c Wed Mar 18 21:14:53 2009 (r1003) +++ trunk/tests/check_libsoup.c Mon Mar 23 11:21:24 2009 (r1004) @@ -130,6 +130,25 @@ smlThreadStart(thread); + /* prepare message */ + + SoupMessage *msg = soup_message_new (SOUP_METHOD_POST, "http://127.0.0.1:13001/"); + soup_message_headers_append(msg->request_headers, "Accept", "text/plain"); + soup_message_set_request (msg, "text/plain", +#ifdef HAVE_LIBSOUP22 + SOUP_BUFFER_SYSTEM_OWNED, +#else + SOUP_MEMORY_TAKE, +#endif + g_memdup("test", 4), 4); + +#ifdef HAVE_LIBSOUP22_SOLARIS + /* create synchronous client */ + + SoupSession *session = soup_session_sync_new(); + soup_session_send_message(session, msg); + client_callback(msg, NULL); +#else /* create asynchronous client */ GMainContext *client_ctx = g_main_context_new(); @@ -142,16 +161,8 @@ SOUP_SESSION_TIMEOUT, 5, NULL); sml_fail_unless(session != NULL, NULL); - SoupMessage *msg = soup_message_new (SOUP_METHOD_POST, "http://127.0.0.1:13001/"); - soup_message_headers_append(msg->request_headers, "Accept", "text/plain"); - soup_message_set_request (msg, "text/plain", -#ifdef HAVE_LIBSOUP22 - SOUP_BUFFER_SYSTEM_OWNED, -#else - SOUP_MEMORY_TAKE, -#endif - g_memdup("test", 4), 4); soup_session_queue_message(session, msg, client_callback, NULL); +#endif /* wait until message was received by server */ @@ -173,9 +184,11 @@ /* cleanup */ soup_session_abort(session); g_object_unref(session); +#ifndef HAVE_LIBSOUP22_SOLARIS smlThreadStop(client_thread); smlThreadFree(client_thread); g_main_context_unref(client_ctx); +#endif smlThreadStop(thread); smlThreadFree(thread); |
From: <svn...@op...> - 2009-03-22 11:13:52
|
Author: henrik Date: Sun Mar 22 12:13:43 2009 New Revision: 5298 URL: http://www.opensync.org/changeset/5298 Log: Correct handling of deleted entries Modified: plugins/mozilla-sync/trunk/src/mozilla-sync.cpp Modified: plugins/mozilla-sync/trunk/src/mozilla-sync.cpp ============================================================================== --- plugins/mozilla-sync/trunk/src/mozilla-sync.cpp Sat Mar 21 16:30:49 2009 (r5297) +++ plugins/mozilla-sync/trunk/src/mozilla-sync.cpp Sun Mar 22 12:13:43 2009 (r5298) @@ -8,7 +8,7 @@ See http://www.KaarPoSoft.dk/bluezync/ $Id$ - Copyright (C) 2007 Henrik Kaare Poulsen /KaarPoSoft + Copyright (C) 2007-2009 Henrik Kaare Poulsen /KaarPoSoft This plugin is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -506,11 +506,10 @@ OSyncList *u; OSyncList *uids = osync_hashtable_get_deleted(pOSyncMozillaDatabase->pOSyncHashTable); - for (u = uids; uids; u = u->next) { + for (u = uids; u; u = u->next) { OSyncChange *change = osync_change_new(&pError); if (!change) { LOG_EXIT_REPORT_ERROR_OSYNC(0, pOSyncContext, pError); - g_free(uids); osync_error_unref(&pError); continue; } @@ -521,8 +520,7 @@ OSyncData *odata = osync_data_new(NULL, 0, pOSyncObjFormat, &pError); if (!odata) { - LOG_EXIT_REPORT_ERROR_OSYNC(0, pOSyncContext, pError); - g_free(uids); + LOG_EXIT_REPORT_ERROR_OSYNC(0, pOSyncContext, pError); osync_change_unref(change); osync_error_unref(&pError); continue; @@ -537,9 +535,8 @@ osync_hashtable_update_change(pOSyncMozillaDatabase->pOSyncHashTable, change); osync_change_unref(change); - g_free(uids); - } + osync_list_free(uids); osync_context_report_success(pOSyncContext); LOG(10, "Done getting changes for [%s]", osync_objtype_sink_get_name(pOSyncObjTypeSink)); |
From: <svn...@op...> - 2009-03-21 15:30:55
|
Author: paule Date: Sat Mar 21 16:30:49 2009 New Revision: 5297 URL: http://www.opensync.org/changeset/5297 Log: Add requirements section; BusinessWebPage field is now supported; refer to Qtopia4 plugin for Qtopia 4 support Modified: plugins/opie-sync/README Modified: plugins/opie-sync/README ============================================================================== --- plugins/opie-sync/README Sat Mar 21 16:01:25 2009 (r5296) +++ plugins/opie-sync/README Sat Mar 21 16:30:49 2009 (r5297) @@ -18,6 +18,19 @@ development mailing list (ope...@li...). Thanks! +Requirements +------------ + + * Connection: the plugin assumes you have a working network connection + set up between the device and the machine you are running OpenSync on. + This could be ethernet over USB, PPP over serial, wifi, bluetooth etc. - + as long as an IP network is available the transport is not important. + + * The OpenSync xmlformat plugin (now split out from the core) is required. + * libcurl, libxml2, glib-2.0 + * OpenSSH for scp connections (optional) + + Configuration Options --------------------- @@ -165,9 +178,8 @@ Missing fields on contacts - "Business web page", "Gender" and "Children" fields from the Opie side are - not currently handled since OpenSync's internal XML format does not - currently support them. + "Gender" and "Children" fields from the Opie side are not currently handled + since OpenSync's internal XML format does not currently support them. Timezone issues @@ -178,4 +190,5 @@ Qtopia testing / support No testing has yet been done with Qtopia 1.x/2.x on Zaurus devices, only - Opie (version 1.2.0+). In addition Qtopia 4 is not supported. + Opie (version 1.2.0+). In addition Qtopia 4 is not supported (there is a + separate Qtopia4 OpenSync plugin for the latter). |
From: <svn...@op...> - 2009-03-21 15:01:37
|
Author: paule Date: Sat Mar 21 16:01:25 2009 New Revision: 5296 URL: http://www.opensync.org/changeset/5296 Log: Fix incorrect number of parameters in osync_trace format string Modified: plugins/opie-sync/src/opie_sync.c Modified: plugins/opie-sync/src/opie_sync.c ============================================================================== --- plugins/opie-sync/src/opie_sync.c Sat Mar 21 15:59:22 2009 (r5295) +++ plugins/opie-sync/src/opie_sync.c Sat Mar 21 16:01:25 2009 (r5296) @@ -249,7 +249,7 @@ static void opie_sync_connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, sink, info, ctx, data); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, ctx, data); OpieSinkEnv *env = (OpieSinkEnv *)data; OSyncError *error = NULL; |
From: <svn...@op...> - 2009-03-21 14:59:42
|
Author: paule Date: Sat Mar 21 15:59:22 2009 New Revision: 5295 URL: http://www.opensync.org/changeset/5295 Log: Fix for change to plugin sink function signatures Modified: plugins/opie-sync/src/opie_sync.c Modified: plugins/opie-sync/src/opie_sync.c ============================================================================== --- plugins/opie-sync/src/opie_sync.c Tue Mar 17 14:02:07 2009 (r5294) +++ plugins/opie-sync/src/opie_sync.c Sat Mar 21 15:59:22 2009 (r5295) @@ -247,11 +247,10 @@ } -static void opie_sync_connect(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void opie_sync_connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, ctx); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - OpieSinkEnv *env = osync_objtype_sink_get_userdata(sink); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, sink, info, ctx, data); + OpieSinkEnv *env = (OpieSinkEnv *)data; OSyncError *error = NULL; @@ -316,15 +315,14 @@ osync_error_unref(&error); } -static void opie_sync_get_changes(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void opie_sync_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, ctx); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - OpieSinkEnv *env = osync_objtype_sink_get_userdata(sink); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %d, %p)", __func__, sink, info, ctx, slow_sync, data); + OpieSinkEnv *env = (OpieSinkEnv *)data; OSyncError *error = NULL; - if (osync_objtype_sink_get_slowsync(sink)) { + if (slow_sync) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); if (!osync_hashtable_slowsync(env->hashtable, &error)) { @@ -446,11 +444,10 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static void opie_sync_commit_change(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change) +static void opie_sync_commit_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, ctx); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - OpieSinkEnv *env = osync_objtype_sink_get_userdata(sink); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p, %p)", __func__, sink, info, ctx, change, data); + OpieSinkEnv *env = (OpieSinkEnv *)data; OSyncError *error = NULL; const char *ext_uid = osync_change_get_uid(change); @@ -551,11 +548,10 @@ osync_error_unref(&error); } -static void opie_sync_sync_done(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void opie_sync_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, userdata, info, ctx); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - OpieSinkEnv *env = osync_objtype_sink_get_userdata(sink); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, ctx, data); + OpieSinkEnv *env = (OpieSinkEnv *)data; OSyncError *error = NULL; if ( !opie_put_sink(env) ) { @@ -585,10 +581,9 @@ osync_error_unref(&error); } -static void opie_sync_disconnect(void *userdata, OSyncPluginInfo *info, OSyncContext *ctx) +static void opie_sync_disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - OpieSinkEnv *env = osync_objtype_sink_get_userdata(sink); + OpieSinkEnv *env = (OpieSinkEnv *)data; /* Close the hashtable */ osync_hashtable_unref(env->hashtable); |
From: <svn...@op...> - 2009-03-18 20:15:10
|
Author: bellmich Date: Wed Mar 18 21:14:53 2009 New Revision: 1003 URL: http://libsyncml.opensync.org/changeset/1003 Log: added better traces to detect UTC/localtime usage Modified: trunk/libsyncml/data_sync_api/data_sync_common.c Modified: trunk/libsyncml/data_sync_api/data_sync_common.c ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync_common.c Wed Mar 18 19:36:46 2009 (r1002) +++ trunk/libsyncml/data_sync_api/data_sync_common.c Wed Mar 18 21:14:53 2009 (r1003) @@ -78,10 +78,13 @@ if (!next) goto error; time_t htime = time(NULL); - if (datastore->dsObject->onlyLocaltime) + if (datastore->dsObject->onlyLocaltime) { + smlTrace(TRACE_INTERNAL, "%s: use localtime", __func__); strftime(next, 17, "%Y%m%dT%H%M%SZ", localtime(&htime)); - else + } else { + smlTrace(TRACE_INTERNAL, "%s: use UTC", __func__); strftime(next, 17, "%Y%m%dT%H%M%SZ", gmtime(&htime)); + } } else { if (last == NULL) { |
From: <svn...@op...> - 2009-03-18 18:37:10
|
Author: bellmich Date: Wed Mar 18 19:36:46 2009 New Revision: 1002 URL: http://libsyncml.opensync.org/changeset/1002 Log: fixed traces Modified: trunk/libsyncml/transports/http_client.c Modified: trunk/libsyncml/transports/http_client.c ============================================================================== --- trunk/libsyncml/transports/http_client.c Wed Mar 18 18:41:45 2009 (r1001) +++ trunk/libsyncml/transports/http_client.c Wed Mar 18 19:36:46 2009 (r1002) @@ -438,13 +438,15 @@ g_memdup(data->data, data->size), data->size); #ifdef HAVE_LIBSOUP22 - smlTrace(TRACE_INTERNAL, "%s: data: %s", __func__, VA_STRING(msg->request.body)); + smlTrace(TRACE_INTERNAL, "%s: data length: %i", __func__, msg->request.length); + #else smlTrace(TRACE_INTERNAL, "%s: data length: %i", __func__, msg->request_body->length); #endif #ifdef HAVE_LIBSOUP22_SOLARIS soup_session_send_message(env->session, msg); + smlTrace(TRACE_INTERNAL, "%s: sent message and starting callback", __func__); smlTransportHttpClientCallback(msg, userdata); g_object_unref(msg); /* synchronous mode !!! */ #else |
From: <svn...@op...> - 2009-03-18 17:41:49
|
Author: bellmich Date: Wed Mar 18 18:41:45 2009 New Revision: 1001 URL: http://libsyncml.opensync.org/changeset/1001 Log: replaced deprecated functions Modified: trunk/tests/check_devinf.c trunk/tests/check_sync.c Modified: trunk/tests/check_devinf.c ============================================================================== --- trunk/tests/check_devinf.c Wed Mar 18 18:41:03 2009 (r1000) +++ trunk/tests/check_devinf.c Wed Mar 18 18:41:45 2009 (r1001) @@ -161,7 +161,7 @@ usleep(100); } - SmlDevInf *devinf2 = smlDevInfAgentGetDevInf(agent); + SmlDevInf *devinf2 = smlDevInfAgentGetSessionDevInf(agent, servertracker->session); sml_fail_unless(devinf2 != NULL, NULL); sml_fail_unless(transport_errors == 0, NULL); @@ -303,26 +303,26 @@ sml_fail_unless(smlSessionFlush(clienttracker->session, TRUE, &error), NULL); sml_fail_unless(error == NULL, NULL); - while (num_sessions != 2 || !smlDevInfAgentGetDevInf(serveragent)) { + while (num_sessions != 2 || !smlDevInfAgentGetSessionDevInf(serveragent, servertracker->session)) { smlManagerDispatch(servermanager); smlManagerDispatch(clientmanager); usleep(100); } - SmlDevInf *recvClientDevInf = smlDevInfAgentGetDevInf(serveragent); + SmlDevInf *recvClientDevInf = smlDevInfAgentGetSessionDevInf(serveragent, servertracker->session); sml_fail_unless(recvClientDevInf != NULL, NULL); sml_fail_unless(smlDevInfNumDataStores(recvClientDevInf) == 1, NULL); sml_fail_unless(servertracker->session != NULL, NULL); sml_fail_unless(smlSessionFlush(servertracker->session, TRUE, &error), NULL); - while (!smlDevInfAgentGetDevInf(clientagent)) { + while (!smlDevInfAgentGetSessionDevInf(clientagent, clienttracker->session)) { smlManagerDispatch(servermanager); smlManagerDispatch(clientmanager); usleep(100); } - SmlDevInf *recvServerDevInf = smlDevInfAgentGetDevInf(clientagent); + SmlDevInf *recvServerDevInf = smlDevInfAgentGetSessionDevInf(clientagent, clienttracker->session); sml_fail_unless(recvServerDevInf != NULL, NULL); sml_fail_unless(smlDevInfNumDataStores(recvServerDevInf) == 1, NULL); Modified: trunk/tests/check_sync.c ============================================================================== --- trunk/tests/check_sync.c Wed Mar 18 18:41:03 2009 (r1000) +++ trunk/tests/check_sync.c Wed Mar 18 18:41:45 2009 (r1001) @@ -273,7 +273,7 @@ smlTrace(TRACE_EXIT, "%s", __func__); } -static SmlErrorType _recv_san(SmlDsServer *server, SmlAlertType type, void *userdata) +static SmlErrorType _recv_san(SmlDsServer *server, SmlSession *session, SmlAlertType type, void *userdata) { smlTrace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, server, type, userdata); sml_fail_unless(GPOINTER_TO_INT(userdata) == 1, NULL); @@ -1264,7 +1264,7 @@ smlDsSessionGetAlert(servertracker->dssessions[1], _recv_alert, GINT_TO_POINTER(1)); smlDsSessionGetAlert(servertracker->dssessions[2], _recv_alert, GINT_TO_POINTER(1)); - while (alerts_received < 3 || !smlDevInfAgentGetDevInf(serveragent)) { + while (alerts_received < 3 || !smlDevInfAgentGetSessionDevInf(serveragent, servertracker->session)) { smlDsSessionDispatch(servertracker->dssessions[0]); smlDsSessionDispatch(servertracker->dssessions[1]); smlDsSessionDispatch(servertracker->dssessions[2]); @@ -1272,7 +1272,7 @@ sml_fail_unless(eventError == NULL, "%s", smlErrorPrint(&eventError)); } - SmlDevInf *recvClientDevInf = smlDevInfAgentGetDevInf(serveragent); + SmlDevInf *recvClientDevInf = smlDevInfAgentGetSessionDevInf(serveragent, servertracker->session); sml_fail_unless(recvClientDevInf != NULL, NULL); sml_fail_unless(smlDevInfNumDataStores(recvClientDevInf) == 3, NULL); sml_fail_unless(smlDevInfSupportsNumberOfChanges(recvClientDevInf) == TRUE, NULL); @@ -1311,7 +1311,7 @@ sml_fail_unless(smlSessionGetRemoteMaxMsgSize(clienttracker->session) == TEST_DEFAULT_MAX_MSG_SIZE, NULL); sml_fail_unless(smlSessionGetRemoteMaxObjSize(servertracker->session) == TEST_DEFAULT_MAX_OBJ_SIZE, NULL); - SmlDevInf *recvServerDevInf = smlDevInfAgentGetDevInf(clientagent); + SmlDevInf *recvServerDevInf = smlDevInfAgentGetSessionDevInf(clientagent, clienttracker->session); sml_fail_unless(recvServerDevInf != NULL, NULL); sml_fail_unless(smlDevInfNumDataStores(recvServerDevInf) == 3, NULL); sml_fail_unless(smlDevInfSupportsNumberOfChanges(recvServerDevInf) == TRUE, NULL); @@ -1572,9 +1572,9 @@ clienttracker->ds[0] = smlDsClientNew(SML_ELEMENT_TEXT_VCARD, loc1, loc1, &error); clienttracker->ds[1] = smlDsClientNew(SML_ELEMENT_TEXT_VCAL, loc2, loc2, &error); clienttracker->ds[2] = smlDsClientNew(SML_ELEMENT_TEXT_PLAIN, loc3, loc3, &error); - smlDsServerSetSanCallback(clienttracker->ds[0], _recv_san, GINT_TO_POINTER(1)); - smlDsServerSetSanCallback(clienttracker->ds[1], _recv_san, GINT_TO_POINTER(1)); - smlDsServerSetSanCallback(clienttracker->ds[2], _recv_san, GINT_TO_POINTER(1)); + smlDsServerSetSanSessionCallback(clienttracker->ds[0], _recv_san, GINT_TO_POINTER(1)); + smlDsServerSetSanSessionCallback(clienttracker->ds[1], _recv_san, GINT_TO_POINTER(1)); + smlDsServerSetSanSessionCallback(clienttracker->ds[2], _recv_san, GINT_TO_POINTER(1)); smlDsServerRegister(clienttracker->ds[0], clientmanager, &error); smlDsServerRegister(clienttracker->ds[1], clientmanager, &error); smlDsServerRegister(clienttracker->ds[2], clientmanager, &error); @@ -1851,9 +1851,9 @@ clienttracker->ds[0] = smlDsClientNew(SML_ELEMENT_TEXT_VCARD, loc1, loc1, &error); clienttracker->ds[1] = smlDsClientNew(SML_ELEMENT_TEXT_VCAL, loc2, loc2, &error); clienttracker->ds[2] = smlDsClientNew(SML_ELEMENT_TEXT_PLAIN, loc3, loc3, &error); - smlDsServerSetSanCallback(clienttracker->ds[0], _recv_san, GINT_TO_POINTER(1)); - smlDsServerSetSanCallback(clienttracker->ds[1], _recv_san, GINT_TO_POINTER(1)); - smlDsServerSetSanCallback(clienttracker->ds[2], _recv_san, GINT_TO_POINTER(1)); + smlDsServerSetSanSessionCallback(clienttracker->ds[0], _recv_san, GINT_TO_POINTER(1)); + smlDsServerSetSanSessionCallback(clienttracker->ds[1], _recv_san, GINT_TO_POINTER(1)); + smlDsServerSetSanSessionCallback(clienttracker->ds[2], _recv_san, GINT_TO_POINTER(1)); smlDsServerRegister(clienttracker->ds[0], clientmanager, &error); smlDsServerRegister(clienttracker->ds[1], clientmanager, &error); smlDsServerRegister(clienttracker->ds[2], clientmanager, &error); |
From: <svn...@op...> - 2009-03-18 17:41:19
|
Author: bellmich Date: Wed Mar 18 18:41:03 2009 New Revision: 1000 URL: http://libsyncml.opensync.org/changeset/1000 Log: fixed comment Modified: trunk/libsyncml/data_sync_api/data_sync_callbacks.c Modified: trunk/libsyncml/data_sync_api/data_sync_callbacks.c ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync_callbacks.c Wed Mar 18 18:40:51 2009 (r999) +++ trunk/libsyncml/data_sync_api/data_sync_callbacks.c Wed Mar 18 18:41:03 2009 (r1000) @@ -456,9 +456,8 @@ /* If the device information was not sent together with the * alerts and it was not cached then the device information - * then the device information can be received together with - * the sync command(s). This can happen with OMA DS clients - * and servers. + * can be received together with the sync command(s). + * This can happen with OMA DS clients and servers. */ if (!smlDataSyncManageDevInf(datastore->dsObject, &error)) goto error; |