Changeset 3185
- Timestamp:
- 02/22/08 12:01:40 (9 months ago)
- Files:
-
- plugins/syncml/src/syncml_callbacks.c (modified) (3 diffs)
- plugins/syncml/src/syncml_common.c (modified) (2 diffs)
- plugins/syncml/src/syncml_common.h (modified) (1 diff)
- plugins/syncml/src/syncml_ds_server.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/syncml/src/syncml_callbacks.c
r3183 r3185 192 192 193 193 if (database->commitCtx) { 194 /* If this is a server which received a map 195 * then libsyncml does not disconnect 196 * automatically. So the commit must be 197 * managed similar to the change context. 198 * 199 * NOTE: this function only perform an action 200 * if a map was received. 194 /* If a sync command was sent then it is 195 * good idea to commit manually and not 196 * to rely on the disconnect which does 197 * not work properly for example if a 198 * client sends a map. 201 199 */ 202 200 _init_commit_ctx_cleanup(database, &error); … … 287 285 break; 288 286 case SML_DS_EVENT_COMMITEDCHANGES: 289 /* This event only happens if a map was received 290 * and completely handled. So this is an OMA DS 291 * server and it is necessary to commit the 292 * stuff here manually 293 * because the automatic disconnect of libsyncml 294 * only works if the last message does not 295 * contain any commands (a map is a command). 287 /* This event only happens if a sync reply was 288 * received and completely handled. 296 289 */ 297 database-> gotMap= TRUE;290 database->commitWrite = TRUE; 298 291 _init_commit_ctx_cleanup(database, &error); 299 292 break; … … 346 339 SmlDatabase *database = (SmlDatabase*) userdata; 347 340 348 osync_trace(TRACE_INTERNAL, "Received a nreply to our Alert - %s\n", database->objtype);341 osync_trace(TRACE_INTERNAL, "Received a reply to our Alert - %s\n", database->objtype); 349 342 350 343 /* If we talk as an OMA DS client with server like an OCS plugins/syncml/src/syncml_common.c
r3183 r3185 233 233 void _init_commit_ctx_cleanup(SmlDatabase *database, SmlError **error) 234 234 { 235 osync_trace(TRACE_ENTRY, "%s( gotMap: %i, gotFinal %i)", __func__,236 database-> gotMap, database->env->gotFinal);235 osync_trace(TRACE_ENTRY, "%s(commitWrite: %i, gotFinal %i)", __func__, 236 database->commitWrite, database->env->gotFinal); 237 237 238 238 g_assert(database->commitCtx); … … 244 244 // gotFinal must be resetted at every new message 245 245 // until we received a sync command (not alert) 246 if (database->env->gotFinal && database-> gotMap) {247 osync_trace(TRACE_INTERNAL, "%s: reported success on server c hangecontext.", __func__);246 if (database->env->gotFinal && database->commitWrite) { 247 osync_trace(TRACE_INTERNAL, "%s: reported success on server commit context.", __func__); 248 248 report_success_on_context(&(database->commitCtx)); 249 249 } plugins/syncml/src/syncml_common.h
r3183 r3185 156 156 osync_bool gotChanges; 157 157 unsigned int pendingChanges; 158 osync_bool gotMap;158 osync_bool commitWrite; 159 159 160 160 OSyncContext *syncModeCtx; plugins/syncml/src/syncml_ds_server.c
r3183 r3185 136 136 if (!send_sync_message(database, _recv_sync_reply, &oserror)) 137 137 goto oserror; 138 139 /* If there are no changes then commit here because there will be no events. */140 if (num == 0)141 report_success_on_context(&(database->commitCtx));142 138 143 139 osync_trace(TRACE_EXIT, "%s", __func__);
