|
From: <svn...@op...> - 2010-01-10 16:58:56
|
Author: dgollub Date: Sun Jan 10 17:58:47 2010 New Revision: 5986 URL: http://www.opensync.org/changeset/5986 Log: Marshal/Denmarshal the slow-sync attribute of a ObjtypeSink. This is required to trigger a slow-sync in the initailze state. This coudl happen in case the hashtable got deleted. see #960 Modified: trunk/opensync/ipc/opensync_serializer.c Modified: trunk/opensync/ipc/opensync_serializer.c ============================================================================== --- trunk/opensync/ipc/opensync_serializer.c Sun Jan 10 17:49:19 2010 (r5985) +++ trunk/opensync/ipc/opensync_serializer.c Sun Jan 10 17:58:47 2010 (r5986) @@ -355,6 +355,9 @@ /* enabled */ osync_message_write_int(message, osync_objtype_sink_is_enabled(sink), error); + /* slowsync */ + osync_message_write_int(message, osync_objtype_sink_get_slowsync(sink), error); + /* timeouts */ osync_message_write_int(message, osync_objtype_sink_get_connect_timeout(sink), error); osync_message_write_int(message, osync_objtype_sink_get_disconnect_timeout(sink), error); @@ -381,7 +384,7 @@ char *name = NULL; char *preferred_format = NULL; int num_formats = 0; - int enabled = 0, timeout = 0; + int enabled = 0, timeout = 0, slowsync = 0; int read = 0, get_changes = 0; int i = 0; @@ -396,6 +399,7 @@ * number of format sinks * format sink list (format sinks) * enabled (int) + * slowsync (bool) * timeout connect (int) * timeout disconnect (int) * timeout get_changes (int) @@ -450,6 +454,14 @@ osync_objtype_sink_set_enabled(*sink, enabled); + /* slowsync */ + if (!osync_message_read_int(message, &slowsync, error)) + goto error; + + osync_objtype_sink_set_slowsync(*sink, slowsync); + if (slowsync) + printf("SLOWSYNC marshled!\n"); + /* timeouts */ if (!osync_message_read_int(message, &timeout, error)) goto error; |