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-10-06 12:01:36
|
Author: bellmich Date: Tue Oct 6 14:01:22 2009 New Revision: 1316 URL: http://libsyncml.opensync.org/changeset/1316 Log: - If a transport is freed without an earlier finalization because of an error then the transport is automatically finalized. - removed a useless state change Modified: trunk/libsyncml/sml_transport.c Modified: trunk/libsyncml/sml_transport.c ============================================================================== --- trunk/libsyncml/sml_transport.c Tue Oct 6 12:37:22 2009 (r1315) +++ trunk/libsyncml/sml_transport.c Tue Oct 6 14:01:22 2009 (r1316) @@ -862,6 +862,24 @@ { smlTrace(TRACE_ENTRY, "%s(%p)", __func__, tsp); smlAssert(tsp); + GError *error = NULL; + + /* If somebody forgets to finalize the transport after an error happened + * then the finalization is done automatically here. + */ + + if (tsp->state == SML_TRANSPORT_ERROR && + tsp->transport_data) + { + g_warning("smlTransportFree will finalize the transport because of a poor error handling."); + if (!smlTransportFinalize(tsp, &error)) + { + g_warning("The library libsyncml cannot finalize the transport implementation. %s", + error->message); + g_error_free(error); + error = NULL; + } + } /* smlTransportFree can only be called if * @@ -891,7 +909,6 @@ * by a special thread. */ - GError *error = NULL; if (tsp->transport_data) { /* Check the correct state - never initialized. */ @@ -1316,9 +1333,7 @@ _smlTransportStop(tsp); tsp->transport_data = NULL; - - tsp->state = SML_TRANSPORT_UNINITIALIZED; - + /* If this is a server then the server is shutdown now. */ if (smlTransportIsServer(tsp)) tsp->connected = FALSE; |
From: <svn...@op...> - 2009-10-06 10:37:33
|
Author: bellmich Date: Tue Oct 6 12:37:22 2009 New Revision: 1315 URL: http://libsyncml.opensync.org/changeset/1315 Log: enforce default testbed behaviour (especially for Valgrind exceptions) Modified: trunk/tests/check_xml_parser.c Modified: trunk/tests/check_xml_parser.c ============================================================================== --- trunk/tests/check_xml_parser.c Mon Oct 5 14:47:07 2009 (r1314) +++ trunk/tests/check_xml_parser.c Tue Oct 6 12:37:22 2009 (r1315) @@ -1235,7 +1235,7 @@ START_TEST (xml_parser_devinf) { - g_type_init(); + setup_testbed(NULL); const char *data = "<?xml version=\"1.0\"?><!DOCTYPE SyncML PUBLIC \"-//SYNCML//DTD SyncML 1.1//EN\" \"http://www.syncml.org/docs/syncml_represent_v11_20020213.dtd\"><SyncML xmlns=\"syncml:SYNCML1.1\"><SyncHdr><VerDTD>1.1</VerDTD><VerProto>SyncML/1.1</VerProto><SessionID>21</SessionID><MsgID>1</MsgID><Target><LocURI>PC Suite</LocURI></Target><Source><LocURI>IMEI:XXXX</LocURI></Source><Meta><MaxMsgSize xmlns=\"syncml:metinf\">10000</MaxMsgSize></Meta></SyncHdr><SyncBody><Put><CmdID>8</CmdID><Meta><Type xmlns=\"syncml:metinf\">application/vnd.syncml-devinf+xml</Type></Meta><Item><Source><LocURI>./devinf11</LocURI></Source><Data><DevInf xmlns=\"syncml:devinf\"><VerDTD>1.1</VerDTD><Man>NOKIA</Man><Mod>6680</Mod><SwV>3.04.37</SwV><DevID>IMEI:XXXX</DevID><DevTyp>phone</DevTyp><SupportLargeObjs/><SupportNumberOfChanges/><DataStore><SourceRef>./C\\Systemata\\Calendar</SourceRef><MaxGUIDSize>8</MaxGUIDSize><Rx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Rx-Pref><Rx><CTType>text/calendar</CTType><VerCT>2.0</VerCT></Rx><Tx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Tx-Pref><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>3</SyncType><SyncType>4</SyncType><SyncType>5</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>./C\\System\\\\\\Data\\Contacts.cdb</SourceRef><MaxGUIDSize>8</MaxGUIDSize><Rx-Pref><CTType>text/x-vcard</CTType><VerCT>2.1</VerCT></Rx-Pref><Rx><CTType>text/vcard</CTType><VerCT>3.0</VerCT></Rx><Tx-Pref><CTType>text/x-vcard</CTType><VerCT>2.1</VerCT></Tx-Pref><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>3</SyncType><SyncType>4</SyncType><SyncType>5</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>./C\\System\\Data\\Notepad.dat</SourceRef><MaxGUIDSize>8</MaxGUIDSize><Rx-Pref><CTType>text/plain</CTType><VerCT>1.0</VerCT></Rx-Pref><Rx><CTType>text/plain</CTType><VerCT>1.0</VerCT></Rx><Tx-Pref><CTType>text/plain</CTType><VerCT>1.0</VerCT></Tx-Pref><Tx><CTType>text/plain</CTType><VerCT>1.0</VerCT></Tx><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>3</SyncType><SyncType>4</SyncType><SyncType>5</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><CTCap><CTType>text/x-vcalendar</CTType><PropName>BEGIN</PropName><ValEnum>VCALENDAR</ValEnum><ValEnum>VEVENT</ValEnum><ValEnum>VTODO</ValEnum><PropName>END</PropName><ValEnum>VCALENDAR</ValEnum><ValEnum>VEVENT</ValEnum><ValEnum>VTODO</ValEnum><PropName>VERSION</PropName><ValEnum>1.0</ValEnum><PropName>UID</PropName><PropName>SUMMARY</PropName><PropName>DESCRIPTION</PropName><PropName>DTEND</PropName><PropName>DTSTART</PropName><PropName>AALARM</PropName><ParamName>TYPE</ParamName><PropName>CLASS</PropName><ValEnum>PUBLIC</ValEnum><ValEnum>PRIVATE</ValEnum><ValEnum>CONFIDENTIAL</ValEnum><PropName>COMPLETED</PropName><PropName>LOCATION</PropName><PropName>DCREATED</PropName><PropName>LAST-MODIFIED</PropName><PropName>PRIORITY</PropName><PropName>STATUS</PropName><PropName>RRULE</PropName><PropName>DUE</PropName><PropName>EXDATE</PropName><PropName>X-EPOCAGENDAENTRYTYPE</PropName><CTType>text/calendar</CTType><PropName>BEGIN</PropName><ValEnum>VCALENDAR</ValEnum><ValEnum>VEVENT</ValEnum><ValEnum>VTODO</ValEnum><PropName>END</PropName><ValEnum>VCALENDAR</ValEnum><ValEnum>VEVENT</ValEnum><ValEnum>VTODO</ValEnum><PropName>VERSION</PropName><ValEnum>2.0</ValEnum><PropName>UID</PropName><PropName>SUMMARY</PropName><PropName>DESCRIPTION</PropName><PropName>DTEND</PropName><PropName>DTSTART</PropName><PropName>AALARM</PropName><ParamName>TYPE</ParamName><PropName>CLASS</PropName><ValEnum>PUBLIC</ValEnum><ValEnum>PRIVATE</ValEnum><ValEnum>CONFIDENTIAL</ValEnum><PropName>COMPLETED</PropName><PropName>LOCATION</PropName><PropName>DCREATED</PropName><PropName>LAST-MODIFIED</PropName><PropName>PRIORITY</PropName><PropName>STATUS</PropName><PropName>RRULE</PropName><PropName>DUE</PropName><PropName>EXDATE</PropName><PropName>X-EPOCAGENDAENTRYTYPE</PropName><CTType>text/x-vcard</CTType><PropName>BEGIN</PropName><ValEnum>VCARD</ValEnum><PropName>END</PropName><ValEnum>VCARD</ValEnum><PropName>VERSION</PropName><ValEnum>2.1</ValEnum><PropName>REV</PropName><PropName>N</PropName><PropName>ADR</PropName><ParamName>HOME</ParamName><ParamName>WORK</ParamName><PropName>TEL</PropName><ParamName>HOME</ParamName><ParamName>WORK</ParamName><ParamName>CELL</ParamName><ParamName>PAGER</ParamName><ParamName>FAX</ParamName><ParamName>VIDEO</ParamName><PropName>FN</PropName><PropName>EMAIL</PropName><ParamName>INTERNET</ParamName><ParamName>HOME</ParamName><ParamName>WORK</ParamName><PropName>URL</PropName><ParamName>HOME</ParamName><ParamName>WORK</ParamName><PropName>NOTE</PropName><PropName>TITLE</PropName><PropName>ORG</PropName><PropName>PHOTO</PropName><PropName>BDAY</PropName><PropName>SOUND</PropName><ParamName>X-IRMC-N</ParamName><CTType>text/vcard</CTType><PropName>BEGIN</PropName><ValEnum>VCARD</ValEnum><PropName>END</PropName><ValEnum>VCARD</ValEnum><PropName>VERSION</PropName><ValEnum>3.0</ValEnum><PropName>REV</PropName><PropName>N</PropName><PropName>ADR</PropName><ParamName>HOME</ParamName><ParamName>WORK</ParamName><PropName>TEL</PropName><ParamName>HOME</ParamName><ParamName>WORK</ParamName><ParamName>CELL</ParamName><ParamName>PAGER</ParamName><ParamName>FAX</ParamName><ParamName>VIDEO</ParamName><PropName>FN</PropName><PropName>EMAIL</PropName><ParamName>INTERNET</ParamName><ParamName>HOME</ParamName><ParamName>WORK</ParamName><PropName>URL</PropName><ParamName>HOME</ParamName><ParamName>WORK</ParamName><PropName>NOTE</PropName><PropName>TITLE</PropName><PropName>ORG</PropName><PropName>PHOTO</PropName><PropName>BDAY</PropName><PropName>SOUND</PropName><ParamName>X-IRMC-N</ParamName><CTType>text/plain</CTType></CTCap></DevInf></Data></Item></Put><Final/></SyncBody></SyncML>"; GError *error = NULL; @@ -1294,7 +1294,7 @@ START_TEST (xml_parser_devinf_ctcap) { - g_type_init(); + setup_testbed(NULL); const char *data = "<?xml version=\"1.0\"?><!DOCTYPE SyncML PUBLIC \"-//SYNCML//DTD SyncML 1.2//EN\" \"http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_RepPro_DTD-V1_2.dtd\"><SyncML xmlns=\"syncml:SYNCML1.2\"><SyncHdr><VerDTD>1.2</VerDTD><VerProto>SyncML/1.2</VerProto><SessionID>1</SessionID><MsgID>1</MsgID><Target><LocURI>LibSyncML Test Suite</LocURI></Target><Source><LocURI>IMEI:xxxxxxxxxxxxxxx</LocURI></Source><Meta><MaxMsgSize xmlns=\"syncml:metinf\">6000</MaxMsgSize></Meta></SyncHdr><SyncBody><Put><CmdID>1</CmdID><Meta><Type xmlns=\"syncml:metinf\">application/vnd.syncml-devinf+wbxml</Type></Meta><Item><Source><LocURI>./devinf12</LocURI></Source><Data><DevInf xmlns=\"syncml:devinf\"><VerDTD>1.2</VerDTD><Man>SonyEricsson</Man><Mod>K850i</Mod><FwV>R1CA029</FwV><SwV>R7A</SwV><HwV>R6A</HwV><DevID>IMEI:xxxxxxxxxxxxxxx</DevID><DevTyp>phone</DevTyp><UTC/><SupportNumberOfChanges/><SupportLargeObjs/><DataStore><SourceRef>Contacts</SourceRef><DisplayName>Contacts</DisplayName><MaxGUIDSize>64</MaxGUIDSize><Rx-Pref><CTType>text/x-vcard</CTType><VerCT>2.1</VerCT></Rx-Pref><Rx><CTType>text/vcard</CTType><VerCT>3.0</VerCT></Rx><Tx-Pref><CTType>text/x-vcard</CTType><VerCT>2.1</VerCT></Tx-Pref><CTCap><CTType>text/x-vcard</CTType><VerCT>2.1</VerCT><Property><PropName>X-IRMC-LUID</PropName><Size>12</Size></Property><Property><PropName>GEO</PropName></Property><Property><PropName>PHOTO</PropName><Size>10000</Size><NoTruncate/><PropParam><ParamName>ENCODING</ParamName><ValEnum>BASE64</ValEnum></PropParam></Property><Property><PropName>BDAY</PropName><Size>8</Size></Property><Property><PropName>URL</PropName><Size>120</Size></Property><Property><PropName>TITLE</PropName><Size>30</Size></Property><Property><PropName>ORG</PropName><Size>30</Size></Property><Property><PropName>EMAIL</PropName><MaxOccur>3</MaxOccur><Size>128</Size><NoTruncate/><PropParam><ParamName>TYPE</ParamName><ValEnum>WORK</ValEnum><ValEnum>HOME</ValEnum></PropParam></Property><Property><PropName>ADR</PropName><MaxOccur>2</MaxOccur><Size>125</Size><PropParam><ParamName>TYPE</ParamName><ValEnum>WORK</ValEnum><ValEnum>HOME</ValEnum></PropParam></Property><Property><PropName>NOTE</PropName><Size>512</Size></Property><Property><PropName>TEL</PropName><MaxOccur>7</MaxOccur><Size>80</Size><NoTruncate/><PropParam><ParamName>TYPE</ParamName><ValEnum>CELL;WORK</ValEnum><ValEnum>CELL;HOME</ValEnum><ValEnum>CELL</ValEnum><ValEnum>HOME</ValEnum><ValEnum>FAX</ValEnum><ValEnum>WORK</ValEnum></PropParam></Property><Property><PropName>N</PropName><Size>60</Size></Property><Property><PropName>VERSION</PropName><ValEnum>2.1</ValEnum></Property><Property><PropName>END</PropName><ValEnum>VCARD</ValEnum></Property><Property><PropName>BEGIN</PropName><ValEnum>VCARD</ValEnum></Property></CTCap><CTCap><CTType>text/vcard</CTType><VerCT>3.0</VerCT><Property><PropName>X-IRMC-LUID</PropName><Size>12</Size></Property><Property><PropName>GEO</PropName></Property><Property><PropName>PHOTO</PropName><Size>10000</Size><NoTruncate/><PropParam><ParamName>ENCODING</ParamName><ValEnum>BASE64</ValEnum></PropParam></Property><Property><PropName>BDAY</PropName><Size>8</Size></Property><Property><PropName>URL</PropName><Size>120</Size></Property><Property><PropName>TITLE</PropName><Size>30</Size></Property><Property><PropName>ORG</PropName><Size>30</Size></Property><Property><PropName>EMAIL</PropName><MaxOccur>3</MaxOccur><Size>128</Size><NoTruncate/><PropParam><ParamName>TYPE</ParamName><ValEnum>WORK</ValEnum><ValEnum>HOME</ValEnum></PropParam></Property><Property><PropName>ADR</PropName><MaxOccur>2</MaxOccur><Size>125</Size><PropParam><ParamName>TYPE</ParamName><ValEnum>WORK</ValEnum><ValEnum>HOME</ValEnum></PropParam></Property><Property><PropName>NOTE</PropName><Size>512</Size></Property><Property><PropName>TEL</PropName><MaxOccur>7</MaxOccur><Size>80</Size><NoTruncate/><PropParam><ParamName>TYPE</ParamName><ValEnum>CELL;WORK</ValEnum><ValEnum>CELL;HOME</ValEnum><ValEnum>CELL</ValEnum><ValEnum>HOME</ValEnum><ValEnum>FAX</ValEnum><ValEnum>WORK</ValEnum></PropParam></Property><Property><PropName>N</PropName><Size>60</Size></Property><Property><PropName>VERSION</PropName><ValEnum>3.0</ValEnum></Property><Property><PropName>END</PropName><ValEnum>VCARD</ValEnum></Property><Property><PropName>BEGIN</PropName><ValEnum>VCARD</ValEnum></Property></CTCap><DSMem><MaxID>5000</MaxID></DSMem><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>Calendar</SourceRef><DisplayName>Calendar</DisplayName><MaxGUIDSize>64</MaxGUIDSize><Rx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Rx-Pref><Tx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Tx-Pref><CTCap><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT><Property><PropName>X-IRMC-LUID</PropName><Size>12</Size></Property><Property><PropName>X-SONYERICSSON-DST</PropName></Property><Property><PropName>DAYLIGHT</PropName></Property><Property><PropName>LAST-MODIFIED</PropName></Property><Property><PropName>EXDATE</PropName></Property><Property><PropName>RRULE</PropName><Size>50</Size></Property><Property><PropName>CLASS</PropName><ValEnum>PUBLIC</ValEnum></Property><Property><PropName>CATEGORIES</PropName><ValEnum>BIRTHDAY</ValEnum><ValEnum>HOLIDAY</ValEnum><ValEnum>VACATION</ValEnum><ValEnum>TRAVEL</ValEnum><ValEnum>PHONE CALL</ValEnum><ValEnum>MISCELLANEOUS</ValEnum><ValEnum>MEETING</ValEnum></Property><Property><PropName>AALARM</PropName></Property><Property><PropName>DALARM</PropName></Property><Property><PropName>DTEND</PropName></Property><Property><PropName>DTSTART</PropName></Property><Property><PropName>DESCRIPTION</PropName><Size>512</Size></Property><Property><PropName>LOCATION</PropName><Size>50</Size></Property><Property><PropName>SUMMARY</PropName><Size>200</Size></Property><Property><PropName>VERSION</PropName><ValEnum>1.0</ValEnum></Property><Property><PropName>END</PropName><ValEnum>VEVENT</ValEnum><ValEnum>VCALENDAR</ValEnum></Property><Property><PropName>BEGIN</PropName><ValEnum>VEVENT</ValEnum><ValEnum>VCALENDAR</ValEnum></Property></CTCap><DSMem><MaxID>1000</MaxID></DSMem><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>Tasks</SourceRef><DisplayName>Tasks</DisplayName><MaxGUIDSize>64</MaxGUIDSize><Rx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Rx-Pref><Tx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Tx-Pref><CTCap><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT><Property><PropName>X-IRMC-LUID</PropName><Size>12</Size></Property><Property><PropName>X-SONYERICSSON-DST</PropName></Property><Property><PropName>DAYLIGHT</PropName></Property><Property><PropName>LAST-MODIFIED</PropName></Property><Property><PropName>CLASS</PropName><ValEnum>PUBLIC</ValEnum></Property><Property><PropName>CATEGORIES</PropName><ValEnum>BIRTHDAY</ValEnum><ValEnum>HOLIDAY</ValEnum><ValEnum>VACATION</ValEnum><ValEnum>TRAVEL</ValEnum><ValEnum>PHONE CALL</ValEnum><ValEnum>MISCELLANEOUS</ValEnum><ValEnum>MEETING</ValEnum></Property><Property><PropName>STATUS</PropName><ValEnum>COMPLETED</ValEnum><ValEnum>NEEDS ACTION</ValEnum><ValEnum>ACCEPTED</ValEnum></Property><Property><PropName>PRIORITY</PropName></Property><Property><PropName>DUE</PropName></Property><Property><PropName>COMPLETED</PropName></Property><Property><PropName>AALARM</PropName></Property><Property><PropName>DALARM</PropName></Property><Property><PropName>DESCRIPTION</PropName><Size>512</Size></Property><Property><PropName>SUMMARY</PropName><Size>200</Size></Property><Property><PropName>VERSION</PropName><ValEnum>1.0</ValEnum></Property><Property><PropName>END</PropName><ValEnum>VCALENDAR</ValEnum><ValEnum>VTODO</ValEnum></Property><Property><PropName>BEGIN</PropName><ValEnum>VCALENDAR</ValEnum><ValEnum>VTODO</ValEnum></Property></CTCap><DSMem><MaxID>250</MaxID></DSMem><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>Notes</SourceRef><DisplayName>Notes</DisplayName><MaxGUIDSize>64</MaxGUIDSize><Rx-Pref><CTType>text/plain</CTType><VerCT>1.0</VerCT></Rx-Pref><Tx-Pref><CTType>text/plain</CTType><VerCT>1.0</VerCT></Tx-Pref><CTCap><CTType>text/plain</CTType><VerCT>1.0</VerCT><Property><PropName>BODY</PropName><Size>254</Size></Property></CTCap><DSMem><MaxID>50</MaxID></DSMem><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>Bookmarks</SourceRef><DisplayName>Bookmarks</DisplayName><MaxGUIDSize>64</MaxGUIDSize><Rx-Pref><CTType>text/x-vbookmark</CTType><VerCT>1.0</VerCT></Rx-Pref><Tx-Pref><CTType>text/x-vbookmark</CTType><VerCT>1.0</VerCT></Tx-Pref><CTCap><CTType>text/x-vbookmark</CTType><VerCT>1.0</VerCT><Property><PropName>X-SONYERICSSON-ICON</PropName><Size>256</Size><PropParam><ParamName>ENCODING</ParamName><ValEnum>BASE64</ValEnum></PropParam></Property><Property><PropName>X-IRMC-URL</PropName></Property><Property><PropName>URL</PropName><Size>1024</Size></Property><Property><PropName>TITLE</PropName><Size>31</Size></Property><Property><PropName>BEGIN</PropName><ValEnum>VENV</ValEnum><ValEnum>VBKM</ValEnum></Property><Property><PropName>END</PropName><ValEnum>VENV</ValEnum><ValEnum>VBKM</ValEnum></Property><Property><PropName>VERSION</PropName><ValEnum>1.0</ValEnum></Property></CTCap><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore></DevInf></Data></Item></Put><Final/></SyncBody></SyncML>"; GError *error = NULL; @@ -1351,7 +1351,7 @@ START_TEST (xml_parser_devinf12) { - g_type_init(); + setup_testbed(NULL); /* The following string has been sent by a SE P1i */ const char *data = "<?xml version=\"1.0\"?><!DOCTYPE SyncML PUBLIC \"-//SYNCML//DTD SyncML 1.2//EN\" \"http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_RepPro_DTD-V1_2.dtd\"><SyncML xmlns=\"syncml:SYNCML1.2\"><SyncHdr><VerDTD>1.2</VerDTD><VerProto>SyncML/1.2</VerProto><SessionID>9284</SessionID><MsgID>1</MsgID><Target><LocURI>http://192.168.1.102:8080</LocURI></Target><Source><LocURI>IMEI:xxxxxxxxxxxxxxx</LocURI></Source><Meta><MaxMsgSize xmlns=\"syncml:metinf\">10000</MaxMsgSize></Meta></SyncHdr><SyncBody><Put><CmdID>1</CmdID><Meta><Type xmlns=\"syncml:metinf\">application/vnd.syncml-devinf+wbxml</Type></Meta><Item><Source><LocURI>./devinf12</LocURI></Source><Data><DevInf xmlns=\"syncml:devinf\"><VerDTD>1.2</VerDTD><Man>Sony Ericsson</Man><Mod>P1i</Mod><OEM>SymbianUK</OEM><FwV>0</FwV><SwV>Z1.0.1</SwV><HwV>1.0</HwV><DevID>IMEI:xxxxxxxxxxxxxxx</DevID><DevTyp>smartphone</DevTyp><UTC/><SupportLargeObjs/><SupportNumberOfChanges/><DataStore><SourceRef>C:Calendar</SourceRef><DisplayName>Agenda</DisplayName><Rx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Rx-Pref><Tx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Tx-Pref><Rx><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Rx><Tx><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Tx><CTCap><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT><Property><PropName>AALARM</PropName><DataType>text</DataType></Property><Property><PropName>ATTACH</PropName><DataType>text</DataType></Property><Property><PropName>ATTENDEE</PropName><DataType>text</DataType><PropParam><ParamName>EXPECT</ParamName><DataType>text</DataType></PropParam><PropParam><ParamName>ROLE</ParamName><DataType>text</DataType></PropParam><PropParam><ParamName>RSVP</ParamName><DataType>text</DataType></PropParam><PropParam><ParamName>STATUS</ParamName><DataType>text</DataType></PropParam></Property><Property><PropName>BEGIN</PropName><DataType>text</DataType><ValEnum>VCALENDAR</ValEnum><ValEnum>VEVENT</ValEnum><ValEnum>VTODO</ValEnum></Property><Property><PropName>CATEGORIES</PropName><DataType>text</DataType></Property><Property><PropName>COMPLETED</PropName><DataType>text</DataType></Property><Property><PropName>CLASS</PropName><DataType>text</DataType><ValEnum>PUBLIC</ValEnum><ValEnum>PRIVATE</ValEnum><ValEnum>CONFIDENTIAL</ValEnum></Property><Property><PropName>DAYLIGHT</PropName><DataType>text</DataType></Property><Property><PropName>DCREATED</PropName><DataType>text</DataType></Property><Property><PropName>DESCRIPTION</PropName><DataType>text</DataType></Property><Property><PropName>DTSTART</PropName><DataType>text</DataType></Property><Property><PropName>DTEND</PropName><DataType>text</DataType></Property><Property><PropName>DUE</PropName><DataType>text</DataType></Property><Property><PropName>END</PropName><DataType>text</DataType><ValEnum>VCALENDAR</ValEnum><ValEnum>VEVENT</ValEnum><ValEnum>VTODO</ValEnum></Property><Property><PropName>EXDATE</PropName><DataType>text</DataType></Property><Property><PropName>LAST-MODIFIED</PropName><DataType>text</DataType></Property><Property><PropName>LOCATION</PropName><DataType>text</DataType></Property><Property><PropName>PRIORITY</PropName><DataType>text</DataType></Property><Property><PropName>RRULE</PropName><DataType>text</DataType></Property><Property><PropName>STATUS</PropName><DataType>text</DataType></Property><Property><PropName>SUMMARY</PropName><DataType>text</DataType></Property><Property><PropName>UID</PropName><DataType>text</DataType></Property><Property><PropName>VERSION</PropName><DataType>text</DataType><ValEnum>1.0</ValEnum></Property><Property><PropName>X-EPOCALARM</PropName><DataType>text</DataType><PropParam><ParamName>VALUE</ParamName><DataType>text</DataType><ValEnum>INLINE</ValEnum><ValEnum>URL</ValEnum></PropParam><PropParam><ParamName>ENCODING</ParamName><DataType>text</DataType><ValEnum>BASE64</ValEnum></PropParam><PropParam><ParamName>X-CONTENTTYPE</ParamName><DataType>text</DataType></PropParam></Property><Property><PropName>X-EPOCAGENDAENTRYTYPE</PropName><DataType>text</DataType><ValEnum>APPOINTMENT</ValEnum><ValEnum>ANNIVERSARY</ValEnum><ValEnum>EVENT</ValEnum><ValEnum>TODO</ValEnum><ValEnum>REMINDER</ValEnum></Property></CTCap><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>3</SyncType><SyncType>5</SyncType><SyncType>6</SyncType><SyncType>4</SyncType><SyncType>7</SyncType></SyncCap></DataStore></DevInf></Data></Item></Put><Final/></SyncBody></SyncML>"; @@ -1411,7 +1411,7 @@ START_TEST (xml_parser_devinf_ext) { - g_type_init(); + setup_testbed(NULL); /* The following test ensures that the parser tolerates Ext in DevInf * like this one from a ticket: * <Ext> @@ -1580,7 +1580,7 @@ START_TEST (xml_parser_ctcap_property_size) { - g_type_init(); + setup_testbed(NULL); const char *data = "<?xml version=\"1.0\"?><!DOCTYPE SyncML PUBLIC \"-//SYNCML//DTD SyncML 1.2//EN\" \"http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_RepPro_DTD-V1_2.dtd\"><SyncML xmlns=\"syncml:SYNCML1.2\"><SyncHdr><VerDTD>1.2</VerDTD><VerProto>SyncML/1.2</VerProto><SessionID>42</SessionID><MsgID>1</MsgID><Target><LocURI>http://www.foo.bar</LocURI></Target><Source><LocURI>IMEI:XXXXXXXXXX</LocURI></Source><Meta><MaxMsgSize xmlns=\"syncml:metinf\">6000</MaxMsgSize></Meta></SyncHdr><SyncBody><Put><CmdID>1</CmdID><Meta><Type xmlns=\"syncml:metinf\">application/vnd.syncml-devinf+wbxml</Type></Meta><Item><Source><LocURI>./devinf12</LocURI></Source><Data><DevInf xmlns=\"syncml:devinf\"><VerDTD>1.2</VerDTD><Man>SonyEricsson</Man><Mod>W580i</Mod><FwV>R6BC002</FwV><SwV>R6A</SwV><HwV>R5A</HwV><DevID>IMEI:XXXXXXXXXXXX</DevID><DevTyp>phone</DevTyp><UTC/><SupportLargeObjs/><DataStore><SourceRef>Contacts</SourceRef><DisplayName>Contacts</DisplayName><MaxGUIDSize>64</MaxGUIDSize><Rx-Pref><CTType>text/x-vcard</CTType><VerCT>2.1</VerCT></Rx-Pref><Rx><CTType>text/vcard</CTType><VerCT>3.0</VerCT></Rx><Tx-Pref><CTType>text/x-vcard</CTType><VerCT>2.1</VerCT></Tx-Pref><CTCap><CTType>text/x-vcard</CTType><VerCT>2.1</VerCT><Property><PropName>BDAY</PropName></Property><Property><PropName>URL</PropName><Size>120</Size></Property><Property><PropName>TITLE</PropName><Size>15</Size></Property><Property><PropName>ORG</PropName><Size>30</Size></Property><Property><PropName>EMAIL</PropName><MaxOccur>3</MaxOccur><Size>50</Size><NoTruncate/><PropParam><ParamName>TYPE</ParamName><ValEnum>INTERNET</ValEnum></PropParam></Property><Property><PropName>ADR</PropName><MaxOccur>2</MaxOccur><PropParam><ParamName>TYPE</ParamName><ValEnum>WORK</ValEnum><ValEnum>HOME</ValEnum></PropParam></Property><Property><PropName>NOTE</PropName><Size>50</Size></Property><Property><PropName>TEL</PropName><MaxOccur>5</MaxOccur><Size>80</Size><NoTruncate/><PropParam><ParamName>TYPE</ParamName><ValEnum>CELL</ValEnum><ValEnum>HOME</ValEnum><ValEnum>FAX</ValEnum><ValEnum>WORK</ValEnum></PropParam></Property><Property><PropName>N</PropName><Size>30</Size></Property><Property><PropName>VERSION</PropName><ValEnum>2.1</ValEnum></Property><Property><PropName>END</PropName><ValEnum>VCARD</ValEnum></Property><Property><PropName>BEGIN</PropName><ValEnum>VCARD</ValEnum></Property></CTCap><CTCap><CTType>text/vcard</CTType><VerCT>3.0</VerCT><Property><PropName>BDAY</PropName></Property><Property><PropName>URL</PropName><Size>120</Size></Property><Property><PropName>TITLE</PropName><Size>15</Size></Property><Property><PropName>ORG</PropName><Size>30</Size></Property><Property><PropName>EMAIL</PropName><MaxOccur>3</MaxOccur><Size>50</Size><NoTruncate/><PropParam><ParamName>TYPE</ParamName><ValEnum>INTERNET</ValEnum></PropParam></Property><Property><PropName>ADR</PropName><MaxOccur>2</MaxOccur><PropParam><ParamName>TYPE</ParamName><ValEnum>WORK</ValEnum><ValEnum>HOME</ValEnum></PropParam></Property><Property><PropName>NOTE</PropName><Size>50</Size></Property><Property><PropName>TEL</PropName><MaxOccur>5</MaxOccur><Size>80</Size><NoTruncate/><PropParam><ParamName>TYPE</ParamName><ValEnum>CELL</ValEnum><ValEnum>HOME</ValEnum><ValEnum>FAX</ValEnum><ValEnum>WORK</ValEnum></PropParam></Property><Property><PropName>N</PropName><Size>30</Size></Property><Property><PropName>VERSION</PropName><ValEnum>3.0</ValEnum></Property><Property><PropName>END</PropName><ValEnum>VCARD</ValEnum></Property><Property><PropName>BEGIN</PropName><ValEnum>VCARD</ValEnum></Property></CTCap><DSMem><MaxID>1000</MaxID></DSMem><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>Calendar</SourceRef><DisplayName>Calendar</DisplayName><MaxGUIDSize>64</MaxGUIDSize><Rx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Rx-Pref><Tx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Tx-Pref><CTCap><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT><Property><PropName>LAST-MODIFIED</PropName></Property><Property><PropName>EXDATE</PropName></Property><Property><PropName>RRULE</PropName><Size>50</Size></Property><Property><PropName>CLASS</PropName><ValEnum>PUBLIC</ValEnum></Property><Property><PropName>CATEGORIES</PropName><ValEnum>VACATION</ValEnum><ValEnum>TRAVEL</ValEnum><ValEnum>PHONE CALL</ValEnum><ValEnum>MISCELLANEOUS</ValEnum><ValEnum>MEETING</ValEnum></Property><Property><PropName>AALARM</PropName></Property><Property><PropName>DALARM</PropName></Property><Property><PropName>DTEND</PropName></Property><Property><PropName>DTSTART</PropName></Property><Property><PropName>DESCRIPTION</PropName><Size>128</Size></Property><Property><PropName>LOCATION</PropName><Size>50</Size></Property><Property><PropName>SUMMARY</PropName><Size>100</Size></Property><Property><PropName>VERSION</PropName><ValEnum>1.0</ValEnum></Property><Property><PropName>END</PropName><ValEnum>VEVENT</ValEnum><ValEnum>VCALENDAR</ValEnum></Property><Property><PropName>BEGIN</PropName><ValEnum>VEVENT</ValEnum><ValEnum>VCALENDAR</ValEnum></Property></CTCap><DSMem><MaxID>300</MaxID></DSMem><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>Tasks</SourceRef><DisplayName>Tasks</DisplayName><MaxGUIDSize>64</MaxGUIDSize><Rx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Rx-Pref><Tx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Tx-Pref><CTCap><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT><Property><PropName>LAST-MODIFIED</PropName></Property><Property><PropName>CLASS</PropName><ValEnum>PUBLIC</ValEnum></Property><Property><PropName>CATEGORIES</PropName><ValEnum>VACATION</ValEnum><ValEnum>TRAVEL</ValEnum><ValEnum>PHONE CALL</ValEnum><ValEnum>MISCELLANEOUS</ValEnum><ValEnum>MEETING</ValEnum></Property><Property><PropName>STATUS</PropName><ValEnum>COMPLETED</ValEnum><ValEnum>NEEDS ACTION</ValEnum><ValEnum>ACCEPTED</ValEnum></Property><Property><PropName>PRIORITY</PropName></Property><Property><PropName>DUE</PropName></Property><Property><PropName>COMPLETED</PropName></Property><Property><PropName>AALARM</PropName></Property><Property><PropName>DALARM</PropName></Property><Property><PropName>DESCRIPTION</PropName><Size>128</Size></Property><Property><PropName>SUMMARY</PropName><Size>100</Size></Property><Property><PropName>VERSION</PropName><ValEnum>1.0</ValEnum></Property><Property><PropName>END</PropName><ValEnum>VCALENDAR</ValEnum><ValEnum>VTODO</ValEnum></Property><Property><PropName>BEGIN</PropName><ValEnum>VCALENDAR</ValEnum><ValEnum>VTODO</ValEnum></Property></CTCap><DSMem><MaxID>80</MaxID></DSMem><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>Notes</SourceRef><DisplayName>Notes</DisplayName><MaxGUIDSize>64</MaxGUIDSize><Rx-Pref><CTType>text/plain</CTType><VerCT>1.0</VerCT></Rx-Pref><Tx-Pref><CTType>text/plain</CTType><VerCT>1.0</VerCT></Tx-Pref><CTCap><CTType>text/plain</CTType><VerCT>1.0</VerCT><Property><PropName>BODY</PropName><Size>254</Size></Property></CTCap><DSMem><MaxID>25</MaxID></DSMem><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>Bookmarks</SourceRef><DisplayName>Bookmarks</DisplayName><MaxGUIDSize>64</MaxGUIDSize><Rx-Pref><CTType>text/x-vbookmark</CTType><VerCT>1.0</VerCT></Rx-Pref><Tx-Pref><CTType>text/x-vbookmark</CTType><VerCT>1.0</VerCT></Tx-Pref><CTCap><CTType>text/x-vbookmark</CTType><VerCT>1.0</VerCT><Property><PropName>X-IRMC-URL</PropName></Property><Property><PropName>URL</PropName></Property><Property><PropName>TITLE</PropName></Property><Property><PropName>BEGIN</PropName><ValEnum>VENV</ValEnum><ValEnum>VBKM</ValEnum></Property><Property><PropName>END</PropName><ValEnum>VENV</ValEnum><ValEnum>VBKM</ValEnum></Property><Property><PropName>VERSION</PropName><ValEnum>1.0</ValEnum></Property></CTCap><DSMem/><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore></DevInf></Data></Item></Put><Alert><CmdID>2</CmdID><Data>201</Data><Item><Target><LocURI>contacts</LocURI></Target><Source><LocURI>Contacts</LocURI></Source><Meta><Anchor xmlns=\"syncml:metinf\"><Last>0</Last><Next>1</Next></Anchor><MaxObjSize xmlns=\"syncml:metinf\">65535</MaxObjSize><Mem xmlns=\"syncml:metinf\"><FreeMem>65469465</FreeMem><FreeID>999</FreeID></Mem></Meta></Item></Alert><Final/></SyncBody></SyncML>"; ; GError *error = NULL; @@ -1642,7 +1642,7 @@ START_TEST (xml_parser_ctcap11_size) { - g_type_init(); + setup_testbed(NULL); const char *data = "<?xml version=\"1.0\"?><!DOCTYPE SyncML PUBLIC \"-//SYNCML//DTD SyncML 1.1//EN\" \"http://www.syncml.org/docs/syncml_represent_v11_20020213.dtd\"><SyncML xmlns=\"syncml:SYNCML1.1\"><SyncHdr><VerDTD>1.1</VerDTD><VerProto>SyncML/1.1</VerProto><SessionID>1</SessionID><MsgID>1</MsgID><Target><LocURI>PC Suite</LocURI></Target><Source><LocURI>IMEI:..............</LocURI></Source><Meta><MaxMsgSize xmlns=\"syncml:metinf\">3584</MaxMsgSize></Meta></SyncHdr><SyncBody><Status><CmdID>1</CmdID><MsgRef>1</MsgRef><CmdRef>0</CmdRef><Cmd>SyncHdr</Cmd><TargetRef>/</TargetRef><SourceRef>PC Suite</SourceRef><Data>200</Data></Status><Status><CmdID>2</CmdID><MsgRef>1</MsgRef><CmdRef>1</CmdRef><Cmd>Alert</Cmd><SourceRef>Contacts</SourceRef><Data>200</Data></Status><Put><CmdID>3</CmdID><Meta><Type xmlns=\"syncml:metinf\">application/vnd.syncml-devinf+xml</Type></Meta><Item><Source><LocURI>./devinf11</LocURI></Source><Data><DevInf xmlns=\"syncml:devinf\"><VerDTD>1.1</VerDTD><Man>Nokia</Man><Mod>Nokia 6300</Mod><FwV>V 05.00\n27-04-07\nRM-217\n(c) N..</FwV><SwV>V 05.00\n27-04-07\nRM-217\n(c) N..</SwV><HwV>4001</HwV><DevID>IMEI:..............</DevID><DevTyp>phone</DevTyp><SupportLargeObjs/><SupportNumberOfChanges/><DataStore><SourceRef>/telecom/pb.vcf</SourceRef><MaxGUIDSize>8</MaxGUIDSize><Rx-Pref><CTType>text/x-vcard</CTType><VerCT>2.1</VerCT></Rx-Pref><Tx-Pref><CTType>text/x-vcard</CTType><VerCT>2.1</VerCT></Tx-Pref><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>/telecom/cal.vcs</SourceRef><MaxGUIDSize>8</MaxGUIDSize><Rx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Rx-Pref><Tx-Pref><CTType>text/x-vcalendar</CTType><VerCT>1.0</VerCT></Tx-Pref><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><DataStore><SourceRef>/telecom/note.txt</SourceRef><MaxGUIDSize>8</MaxGUIDSize><Rx-Pref><CTType>text/plain</CTType><VerCT/></Rx-Pref><Tx-Pref><CTType>text/plain</CTType><VerCT/></Tx-Pref><SyncCap><SyncType>1</SyncType><SyncType>2</SyncType><SyncType>4</SyncType><SyncType>6</SyncType><SyncType>7</SyncType></SyncCap></DataStore><CTCap><CTType>text/x-vcard</CTType><PropName>BEGIN</PropName><ValEnum>VCARD</ValEnum><PropName>VERSION</PropName><ValEnum>2.1</ValEnum><PropName>END</PropName><ValEnum>VCARD</ValEnum><PropName>N</PropName><PropName>FN</PropName><PropName>TEL</PropName><ParamName>PREF</ParamName><ParamName>WORK</ParamName><ParamName>HOME</ParamName><ParamName>VOICE</ParamName><ParamName>FAX</ParamName><ParamName>CELL</ParamName><PropName>NOTE</PropName><PropName>URL</PropName><PropName>EMAIL</PropName><PropName>ADR</PropName><PropName>PHOTO</PropName><PropName>BDAY</PropName><PropName>TITLE</PropName><PropName>ORG</PropName><PropName>X-NICKNAME</PropName></CTCap><CTCap><CTType>text/x-vcalendar</CTType><PropName>BEGIN</PropName><ValEnum>VCALENDAR</ValEnum><ValEnum>VEVENT</ValEnum><ValEnum>VTODO</ValEnum><PropName>VERSION</PropName><ValEnum>1.0</ValEnum><PropName>END</PropName><ValEnum>VCALENDAR</ValEnum><ValEnum>VEVENT</ValEnum><ValEnum>VTODO</ValEnum><PropName>DTSTART</PropName><PropName>DTEND</PropName><PropName>SUMMARY</PropName><PropName>DESCRIPTION</PropName><PropName>DUE</PropName><PropName>AALARM</PropName><PropName>DALARM</PropName><PropName>RRULE</PropName><PropName>CATEGORIES</PropName><ParamName>SPECIAL OCCASION</ParamName><ParamName>MEETING</ParamName><ParamName>PHONE CALL</ParamName><ParamName>MISCELLANEOUS</ParamName><ParamName>REMINDER</ParamName><PropName>LOCATION</PropName><PropName>STATUS</PropName><ParamName>NEEDS ACTION</ParamName><ParamName>COMPLETED</ParamName><PropName>PRIORITY</PropName><ParamName>1</ParamName><ParamName>2</ParamName><ParamName>3</ParamName><PropName>EXDATE</PropName></CTCap><CTCap><CTType>text/plain</CTType><PropName/><DataType>chr</DataType><Size>3000</Size></CTCap></DevInf></Data></Item></Put><Alert><CmdID>4</CmdID><Data>201</Data><Item><Target><LocURI>Contacts</LocURI></Target><Source><LocURI>/telecom/pb.vcf</LocURI></Source><Meta><Anchor xmlns=\"syncml:metinf\"><Last>0</Last><Next>297</Next></Anchor></Meta></Item></Alert><Final/></SyncBody></SyncML>"; |
From: <svn...@op...> - 2009-10-05 12:47:20
|
Author: bellmich Date: Mon Oct 5 14:47:07 2009 New Revision: 1314 URL: http://libsyncml.opensync.org/changeset/1314 Log: fixed several leaking references All fixed reference counters are related to the DevInf implementation. (SyncML 1.2) Modified: trunk/libsyncml/parser/sml_xml_parse.c Modified: trunk/libsyncml/parser/sml_xml_parse.c ============================================================================== --- trunk/libsyncml/parser/sml_xml_parse.c Mon Oct 5 14:41:14 2009 (r1313) +++ trunk/libsyncml/parser/sml_xml_parse.c Mon Oct 5 14:47:07 2009 (r1314) @@ -3420,6 +3420,8 @@ goto error; if (!sml_dev_inf_property_add_param(property, param, error)) goto error; + g_object_unref(param); + param = NULL; break; case SML_DEVINF_CTCAP_SIZE: if (!sml_dev_inf_property_set_size(property, atoi(value), error)) @@ -3539,9 +3541,14 @@ goto error; } } + g_object_unref(ct); + ct = NULL; + if (!sml_dev_inf_add_ctcap(devinf, ctcap, error)) goto error; + g_object_unref(ctcap); + ctcap = NULL; smlTrace(TRACE_EXIT, "%s", __func__); return TRUE; |
From: <svn...@op...> - 2009-10-05 12:41:27
|
Author: bellmich Date: Mon Oct 5 14:41:14 2009 New Revision: 1313 URL: http://libsyncml.opensync.org/changeset/1313 Log: fixed wrong formats in trace statements Modified: trunk/libsyncml/parser/sml_xml_parse.c Modified: trunk/libsyncml/parser/sml_xml_parse.c ============================================================================== --- trunk/libsyncml/parser/sml_xml_parse.c Mon Oct 5 14:38:35 2009 (r1312) +++ trunk/libsyncml/parser/sml_xml_parse.c Mon Oct 5 14:41:14 2009 (r1313) @@ -3251,7 +3251,7 @@ _smlXmlDevInfDataStoreParseCTCap12PropParam (SmlXmlParser *parser, GError **error) { - smlTrace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, parser, error); + smlTrace(TRACE_ENTRY, "%s(%p, %p)", __func__, parser, error); CHECK_ERROR_REF smlAssert(parser); @@ -3336,7 +3336,7 @@ _smlXmlDevInfDataStoreParseCTCap12Property (SmlXmlParser *parser, GError **error) { - smlTrace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, parser, error); + smlTrace(TRACE_ENTRY, "%s(%p, %p)", __func__, parser, error); CHECK_ERROR_REF smlAssert(parser); |
From: <svn...@op...> - 2009-10-05 12:38:53
|
Author: bellmich Date: Mon Oct 5 14:38:35 2009 New Revision: 1312 URL: http://libsyncml.opensync.org/changeset/1312 Log: fixed several leaking references All fixed reference counters are related to the DevInf implementation. Modified: trunk/libsyncml/parser/sml_xml_parse.c Modified: trunk/libsyncml/parser/sml_xml_parse.c ============================================================================== --- trunk/libsyncml/parser/sml_xml_parse.c Mon Oct 5 14:03:10 2009 (r1311) +++ trunk/libsyncml/parser/sml_xml_parse.c Mon Oct 5 14:38:35 2009 (r1312) @@ -3075,14 +3075,17 @@ { if (!sml_dev_inf_property_add_param(property, param, error)) goto error; + g_object_unref(param); param = NULL; } if (!sml_dev_inf_ctcap_add_property(ctcap, property, error)) goto error; + g_object_unref(property); property = NULL; } if (!sml_dev_inf_add_ctcap(devinf, ctcap, error)) goto error; + g_object_unref(ctcap); ctcap = NULL; g_object_unref(ct); ct = NULL; @@ -3110,10 +3113,12 @@ { if (!sml_dev_inf_property_add_param(property, param, error)) goto error; + g_object_unref(param); param = NULL; } if (!sml_dev_inf_ctcap_add_property(ctcap, property, error)) goto error; + g_object_unref(property); property = NULL; } property = sml_dev_inf_property_new(); @@ -3180,6 +3185,7 @@ { if (!sml_dev_inf_property_add_param(property, param, error)) goto error; + g_object_unref(param); param = NULL; } param = sml_dev_inf_prop_param_new(); @@ -3205,12 +3211,24 @@ goto error; } } - if (param != NULL && !sml_dev_inf_property_add_param(property, param, error)) - goto error; - if (property != NULL && !sml_dev_inf_ctcap_add_property(ctcap, property, error)) - goto error; - if (ctcap != NULL && !sml_dev_inf_add_ctcap(devinf, ctcap, error)) - goto error; + if (param != NULL) { + if (!sml_dev_inf_property_add_param(property, param, error)) + goto error; + g_object_unref(param); + param = NULL; + } + if (property != NULL) { + if (!sml_dev_inf_ctcap_add_property(ctcap, property, error)) + goto error; + g_object_unref(property); + property = NULL; + } + if (ctcap != NULL) { + if (!sml_dev_inf_add_ctcap(devinf, ctcap, error)) + goto error; + g_object_unref(ctcap); + ctcap = NULL; + } if (ct != NULL) g_object_unref(ct); @@ -3219,6 +3237,12 @@ error: if (value != NULL) smlSafeCFree(&value); + if (param) + g_object_unref(param); + if (property) + g_object_unref(property); + if (ctcap) + g_object_unref(ctcap); smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, (*error)->message); return FALSE; } @@ -3760,6 +3784,7 @@ if (!sml_dev_inf_add_data_store(devinf, datastore, error)) goto error; + g_object_unref(datastore); smlTrace(TRACE_EXIT, "%s", __func__); return TRUE; |
From: <svn...@op...> - 2009-10-05 12:03:25
|
Author: bellmich Date: Mon Oct 5 14:03:10 2009 New Revision: 1311 URL: http://libsyncml.opensync.org/changeset/1311 Log: fixed cleanup code free transport implementation if the transport was never initialized Modified: trunk/libsyncml/sml_transport.c Modified: trunk/libsyncml/sml_transport.c ============================================================================== --- trunk/libsyncml/sml_transport.c Fri Oct 2 17:07:09 2009 (r1310) +++ trunk/libsyncml/sml_transport.c Mon Oct 5 14:03:10 2009 (r1311) @@ -883,15 +883,27 @@ if (tsp->command_queue) smlQueueFree(tsp->command_queue); - //GError *error = NULL; - //if (tsp->transport_data && - // !tsp->functions.finalize(tsp->transport_data, &error)) - //{ - // g_warning("The library libsyncml cannot free the transport. %s", - // error->message); - // g_error_free(error); - // error = NULL; - //} + /* If transport_data is present + * then the transport implementation was not finalized. + * This means that the transport was never initialized. + * If the transport was never initialized + * then the transport implementation was never run + * by a special thread. + */ + + GError *error = NULL; + if (tsp->transport_data) + { + /* Check the correct state - never initialized. */ + smlAssert(!tsp->thread); + if (!tsp->functions.finalize(tsp->transport_data, &error)) + { + g_warning("The library libsyncml cannot finalize the transport implementation. %s", + error->message); + g_error_free(error); + error = NULL; + } + } if (tsp->context) g_main_context_unref(tsp->context); |
From: <svn...@op...> - 2009-10-02 18:46:54
|
Author: bellmich Date: Fri Oct 2 17:07:09 2009 New Revision: 1310 URL: http://libsyncml.opensync.org/changeset/1310 Log: fixed Valgrind warning The idea was posted from Hendrik Sattler on ope...@li.... Modified: trunk/libsyncml/transports/obex_server.c Modified: trunk/libsyncml/transports/obex_server.c ============================================================================== --- trunk/libsyncml/transports/obex_server.c Fri Oct 2 15:24:09 2009 (r1309) +++ trunk/libsyncml/transports/obex_server.c Fri Oct 2 17:07:09 2009 (r1310) @@ -640,13 +640,14 @@ /* prepare IP address etc. */ if (!env->port) g_warning("Using default INET port."); - size_t size = sizeof(struct sockaddr_in); - struct sockaddr_in *addr = smlTryMalloc0(size, error); + size_t size = sizeof(struct sockaddr_in6); + struct sockaddr_in6 *addr = smlTryMalloc0(size, error); if (!addr) goto error; - addr->sin_family = PF_INET; - addr->sin_port = htons(env->port); - addr->sin_addr.s_addr = INADDR_ANY; + addr->sin6_family = PF_INET6; + addr->sin6_port = htons(env->port); + memcpy(&(addr->sin6_addr), &in6addr_any, sizeof(addr->sin6_addr)); + /* register server */ if (GET_OBEX_RESULT(TcpOBEX_ServerRegister(env->handle, (struct sockaddr *) addr, size)) < 0) { |
From: <svn...@op...> - 2009-10-02 13:24:22
|
Author: bellmich Date: Fri Oct 2 15:24:09 2009 New Revision: 1309 URL: http://libsyncml.opensync.org/changeset/1309 Log: fixed cleanup code Modified: trunk/tests/check_data_sync_api.c Modified: trunk/tests/check_data_sync_api.c ============================================================================== --- trunk/tests/check_data_sync_api.c Fri Oct 2 15:23:37 2009 (r1308) +++ trunk/tests/check_data_sync_api.c Fri Oct 2 15:24:09 2009 (r1309) @@ -470,7 +470,7 @@ goto error; if (!sml_data_sync_set_transport_type(server, SML_TRANSPORT_HTTP_SERVER, &error)) goto error; - } else { + } else { /* OBEX */ GList *list = clients; for (; list; list = list->next) { @@ -572,6 +572,32 @@ sml_fail_unless(FALSE, "%s", error->message); } +void test_ds_api_cleanup_server () +{ + g_object_unref(server); + server = NULL; + g_object_unref(server_data_store); + server_data_store = NULL; +} + +void test_ds_api_cleanup_client () +{ + while (clients) + { + SmlDataSyncTestClient *client = clients->data; + clients = g_list_remove(clients, client); + g_object_unref(client->client); + g_object_unref(client->data_store); + while(client->items) + { + gchar* item = client->items->data; + client->items = g_list_remove(client->items, item); + smlSafeCFree(&item); + } + smlSafeFree((gpointer *)&client); + } +} + void run_testbed() { GError *error = NULL; @@ -634,36 +660,14 @@ /* close the object */ smlTrace(TRACE_INTERNAL, "%s: shutting down all SmlDataSync objects", __func__); - GList *list = clients; - for (; list; list = list->next) - { - SmlDataSyncTestClient *client = list->data; - g_object_unref(client->client); - g_object_unref(client->data_store); - while(client->items) - { - gchar* item = client->items->data; - client->items = g_list_remove(client->items, item); - smlSafeCFree(&item); - } - } - g_object_unref(server); - - /* cleanup clients */ - while (clients) { - SmlDataSyncTestClient *client = clients->data; - clients = g_list_remove(clients, client); - g_object_unref(client->data_store); - g_object_unref(client->client); - smlSafeFree((gpointer *)&client); + if (sml_data_sync_get_transport_type(server) == SML_TRANSPORT_OBEX_CLIENT) { + test_ds_api_cleanup_server(); + test_ds_api_cleanup_client(); + } else { + test_ds_api_cleanup_client(); + test_ds_api_cleanup_server(); } - /* cleanup server */ - g_object_unref(server); - server = NULL; - g_object_unref(server_data_store); - server_data_store = NULL; - return; error: if (runMutex) { |
From: <svn...@op...> - 2009-10-02 13:23:50
|
Author: bellmich Date: Fri Oct 2 15:23:37 2009 New Revision: 1308 URL: http://libsyncml.opensync.org/changeset/1308 Log: - disconnectDone was not set on disconnect - disconnect is not safe against two or more calls Modified: trunk/libsyncml/transports/http_client.c Modified: trunk/libsyncml/transports/http_client.c ============================================================================== --- trunk/libsyncml/transports/http_client.c Fri Oct 2 14:25:02 2009 (r1307) +++ trunk/libsyncml/transports/http_client.c Fri Oct 2 15:23:37 2009 (r1308) @@ -521,6 +521,12 @@ smlAssert(env); smlAssert(env->tsp); + if (env->disconnectDone) + { + smlTrace(TRACE_EXIT, "%s - ignoring because already disconnect", __func__); + return; + } + if (!env->connectDone && !env->session) { /* The client is not connected. */ @@ -544,7 +550,7 @@ env->session = NULL; /* Make a new disconnect object */ - env->disconnectDone = FALSE; + env->disconnectDone = TRUE; smlTransportReceiveEvent(env->tsp, NULL, SML_TRANSPORT_EVENT_DISCONNECT_DONE, NULL, NULL); smlTrace(TRACE_EXIT, "%s", __func__); |
From: <svn...@op...> - 2009-10-02 13:02:01
|
Author: bellmich Date: Fri Oct 2 14:22:46 2009 New Revision: 1306 URL: http://libsyncml.opensync.org/changeset/1306 Log: much more careful Free and Finalize functions Modified: trunk/libsyncml/sml_transport.c trunk/libsyncml/sml_transport_internals.h Modified: trunk/libsyncml/sml_transport.c ============================================================================== --- trunk/libsyncml/sml_transport.c Fri Oct 2 14:21:56 2009 (r1305) +++ trunk/libsyncml/sml_transport.c Fri Oct 2 14:22:46 2009 (r1306) @@ -140,6 +140,7 @@ smlAssert(userdata); SmlTransportCommand *cmd = message; SmlTransport *tsp = userdata; + smlTrace(TRACE_INTERNAL, "%s: type %d", __func__, cmd->type); switch (cmd->type) { case SML_TRANSPORT_CMD_SEND: @@ -861,19 +862,36 @@ { smlTrace(TRACE_ENTRY, "%s(%p)", __func__, tsp); smlAssert(tsp); - + + /* smlTransportFree can only be called if + * + * 1. the transport was never initialized or + * 2. the transport was already finalized. + * + * All other calls to smlTransportFree are invalid. + * So the following states are correct: + * + * 1. UNKNOWN (new but never initialized) + * 2. FINALIZED (ready to cleanup) + * + * If there is an error state then the transport must + * still be finalized. + */ + + smlAssert(tsp->state == SML_TRANSPORT_UNKNOWN || tsp->state == SML_TRANSPORT_FINALIZED); + if (tsp->command_queue) smlQueueFree(tsp->command_queue); - GError *error = NULL; - if (tsp->transport_data && - !tsp->functions.finalize(tsp->transport_data, &error)) - { - g_warning("The library libsyncml cannot free the transport. %s", - error->message); - g_error_free(error); - error = NULL; - } + //GError *error = NULL; + //if (tsp->transport_data && + // !tsp->functions.finalize(tsp->transport_data, &error)) + //{ + // g_warning("The library libsyncml cannot free the transport. %s", + // error->message); + // g_error_free(error); + // error = NULL; + //} if (tsp->context) g_main_context_unref(tsp->context); @@ -1145,6 +1163,31 @@ return TRUE; } +static void +smlTransportCleanupHandler (void *message, + void *userdata) +{ + smlTrace(TRACE_ENTRY, "%s(%p, %p)", __func__, message, userdata); + smlAssert(message); + SmlTransportCommand *cmd = message; + + if (cmd->type == SML_TRANSPORT_CMD_DISCONNECT) + { + /* disconnects will always be executed */ + smlTransportWorkerHandler(message, userdata); + } else { + /* remove the command */ + if (cmd->link) + smlLinkDeref(cmd->link); + if (cmd->data) + smlTransportDataDeref(cmd->data); + smlSafeFree((gpointer *)&cmd); + } + + smlTrace(TRACE_EXIT, "%s", __func__); + return; +} + /** @brief Finalizes the transport * * This function will finalize the transport . The transport must be in the state "Initialized" @@ -1164,24 +1207,23 @@ smlAssert(tsp); smlAssert(tsp->functions.finalize); - if (tsp->connected && !smlTransportIsServer(tsp)) - { - g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, - "If a client transport is connected then it cannot be finalized."); - goto error; - } + /* Only an initialized transport can be finalized. */ - if (tsp->state < SML_TRANSPORT_INITIALIZED) { - g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, "Transport was not in the state \"Initialized\""); + if (tsp->state < SML_TRANSPORT_INITIALIZED) + { + g_set_error (error, SML_ERROR, SML_ERROR_GENERIC, + "Transport was not in the state \"Initialized\""); goto error; } - /* FIXME: Is there a situation where no thread is present? */ - - /* OBEX */ - if (tsp->type != SML_TRANSPORT_HTTP_CLIENT && - tsp->type != SML_TRANSPORT_HTTP_SERVER && tsp->thread) - _smlTransportStop(tsp); + /* smlTransportFinalize is a synchronous function. + * It requires that the transport is no longer disconnected. + * smlTransportDisconnect is an asynchronous function. + * This means that the transport must be synchronized. + * So before the real checking and finalization starts + * the command queue must be stopped and all pending + * commands must have the chance to be executed. + */ /* stop the command queue */ if (tsp->thread) { @@ -1197,6 +1239,14 @@ smlQueueDetach(tsp->command_queue); } + /* If the transport is in an error state + * then the only useful command is a disconnect. + * All other commands of the command queue + * will be ignored. + */ + if (tsp->state == SML_TRANSPORT_ERROR) + smlQueueSetHandler(tsp->command_queue, (SmlQueueHandler)smlTransportCleanupHandler, tsp); + /* give all jobs a chance to finish cleanly */ unsigned int i = 0; unsigned int queueLength = smlQueueLength(tsp->command_queue); @@ -1214,6 +1264,37 @@ smlQueueDispatch(tsp->command_queue); } } + + /* NOTICE: The transport is now synchronized. */ + + /* ensure that all client transorts are really disconnected */ + + if (tsp->connected && + !smlTransportIsServer(tsp) && + tsp->state == SML_TRANSPORT_ERROR) + { + /* If this is a crashed client + * then an automatic graceful disconnect is tried. */ + smlTrace(TRACE_INTERNAL, "%s: try disconnect for client in error state", __func__); + if (!tsp->functions.disconnect) { + smlTransportReceiveEvent(tsp, NULL, SML_TRANSPORT_EVENT_DISCONNECT_DONE, NULL, NULL); + smlTrace(TRACE_INTERNAL, "%s: no disconnect function", __func__); + } else { + tsp->functions.disconnect(tsp->transport_data, NULL); + } + + if (tsp->connected && !smlTransportIsServer(tsp)) + g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, + "If a client transport is connected then it cannot be finalized."); + goto error; + } + + /* stop and finalize the transport */ + + /* OBEX */ + if (tsp->type != SML_TRANSPORT_HTTP_CLIENT && + tsp->type != SML_TRANSPORT_HTTP_SERVER && tsp->thread) + _smlTransportStop(tsp); if (!tsp->functions.finalize(tsp->transport_data, error)) goto error; @@ -1230,9 +1311,11 @@ if (smlTransportIsServer(tsp)) tsp->connected = FALSE; + tsp->state = SML_TRANSPORT_FINALIZED; smlTrace(TRACE_EXIT, "%s", __func__); return TRUE; error: + tsp->state = SML_TRANSPORT_FINALIZED; smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, (*error)->message); return FALSE; } Modified: trunk/libsyncml/sml_transport_internals.h ============================================================================== --- trunk/libsyncml/sml_transport_internals.h Fri Oct 2 14:21:56 2009 (r1305) +++ trunk/libsyncml/sml_transport_internals.h Fri Oct 2 14:22:46 2009 (r1306) @@ -67,7 +67,8 @@ SML_TRANSPORT_CONNECTED = 2, SML_TRANSPORT_DATA_ERROR = 3, SML_TRANSPORT_DISCONNECTED = 4, - SML_TRANSPORT_ERROR = 5 + SML_TRANSPORT_ERROR = 5, + SML_TRANSPORT_FINALIZED = 6 } SmlTransportState; struct SmlTransport { |
From: <svn...@op...> - 2009-10-02 13:01:58
|
Author: bellmich Date: Fri Oct 2 14:25:02 2009 New Revision: 1307 URL: http://libsyncml.opensync.org/changeset/1307 Log: - fixed loop of references which disturb reference counting and garbage collection - fixed wrong comparison <= vs. >= Modified: trunk/libsyncml/data_sync_api/sml_data_sync.c trunk/libsyncml/data_sync_api/sml_data_sync_data_store.c trunk/libsyncml/data_sync_api/sml_data_sync_data_store_private.h Modified: trunk/libsyncml/data_sync_api/sml_data_sync.c ============================================================================== --- trunk/libsyncml/data_sync_api/sml_data_sync.c Fri Oct 2 14:22:46 2009 (r1306) +++ trunk/libsyncml/data_sync_api/sml_data_sync.c Fri Oct 2 14:25:02 2009 (r1307) @@ -117,7 +117,7 @@ if (self->priv->tsp) { GError *error = NULL; if (self->priv->session_type == SML_SESSION_TYPE_CLIENT && - SML_DATA_SYNC_STATE_CONNECTED >= self->priv->state && + SML_DATA_SYNC_STATE_CONNECTED <= self->priv->state && self->priv->state < SML_DATA_SYNC_STATE_DISCONNECTED && !smlTransportDisconnect(self->priv->tsp, NULL, &error)) { @@ -165,6 +165,7 @@ /* cleanup data stores */ while(self->priv->data_stores) { SmlDataSyncDataStore *datastore = self->priv->data_stores->data; + sml_data_sync_data_store_set_data_sync(datastore, NULL); self->priv->data_stores = g_list_remove(self->priv->data_stores, datastore); g_object_unref(datastore); } Modified: trunk/libsyncml/data_sync_api/sml_data_sync_data_store.c ============================================================================== --- trunk/libsyncml/data_sync_api/sml_data_sync_data_store.c Fri Oct 2 14:22:46 2009 (r1306) +++ trunk/libsyncml/data_sync_api/sml_data_sync_data_store.c Fri Oct 2 14:25:02 2009 (r1307) @@ -65,10 +65,7 @@ { switch (property_id) { case PROP_DATA_SYNC: - if (SML_DATA_SYNC_DATA_STORE (object)->priv->data_sync) - g_object_unref (SML_DATA_SYNC_DATA_STORE (object)->priv->data_sync); SML_DATA_SYNC_DATA_STORE (object)->priv->data_sync = SML_DATA_SYNC (value); - g_object_ref(SML_DATA_SYNC (value)); break; case PROP_REMOTE: if (SML_DATA_SYNC_DATA_STORE (object)->priv->remote) @@ -97,7 +94,6 @@ SmlDataSyncDataStore *self = (SmlDataSyncDataStore *) object; if (self->priv->data_sync) { - g_object_unref(self->priv->data_sync); self->priv->data_sync = NULL; } @@ -234,11 +230,13 @@ SmlDataSync* ds) { g_return_if_fail (SML_IS_DATA_SYNC_DATA_STORE (self)); - g_return_if_fail (SML_IS_DATA_SYNC (ds)); - if (self->priv->data_sync) - g_object_unref (self->priv->data_sync); - self->priv->data_sync = g_object_ref (ds); + /* The data sync can be NULL if this function is called from + * the finalize function of the data sync object. + * This is done to avoid invalid references. + */ + + self->priv->data_sync = ds; } /** Modified: trunk/libsyncml/data_sync_api/sml_data_sync_data_store_private.h ============================================================================== --- trunk/libsyncml/data_sync_api/sml_data_sync_data_store_private.h Fri Oct 2 14:22:46 2009 (r1306) +++ trunk/libsyncml/data_sync_api/sml_data_sync_data_store_private.h Fri Oct 2 14:25:02 2009 (r1307) @@ -28,7 +28,16 @@ struct _SmlDataSyncDataStorePrivate { + /* The data sync object is always the parent of the data store. + * Never add reference to the data sync from within a data store. + * This creates a dependency between data sync and data store. + * So the reference counter will never be zero. + * If the data sync is going away and the data store is still there + * then the data sync must cleanup the reference before the + * finalize function returns. + */ SmlDataSync* data_sync; + SmlLocation* remote; SmlLocation* local; gchar* content_type; |
From: <svn...@op...> - 2009-10-02 13:01:54
|
Author: bellmich Date: Fri Oct 2 14:21:56 2009 New Revision: 1305 URL: http://libsyncml.opensync.org/changeset/1305 Log: moved ERROR to info Modified: trunk/libsyncml/transports/obex_server.c Modified: trunk/libsyncml/transports/obex_server.c ============================================================================== --- trunk/libsyncml/transports/obex_server.c Fri Oct 2 14:21:31 2009 (r1304) +++ trunk/libsyncml/transports/obex_server.c Fri Oct 2 14:21:56 2009 (r1305) @@ -841,7 +841,7 @@ if (linkdata) { SmlLinkObexServerEnv *linkenv = linkdata; linkenv->disconnect = TRUE; - smlTrace(TRACE_ERROR, "%s - explicit disconnect by OBEX server", __func__); + smlTrace(TRACE_INTERNAL, "%s - explicit disconnect by OBEX server", __func__); } smlTrace(TRACE_EXIT, "%s", __func__); |
From: <svn...@op...> - 2009-10-02 12:56:58
|
Author: bellmich Date: Fri Oct 2 14:21:31 2009 New Revision: 1304 URL: http://libsyncml.opensync.org/changeset/1304 Log: made the transport visible in traces Modified: trunk/libsyncml/transports/obex_client.c Modified: trunk/libsyncml/transports/obex_client.c ============================================================================== --- trunk/libsyncml/transports/obex_client.c Thu Oct 1 17:12:58 2009 (r1303) +++ trunk/libsyncml/transports/obex_client.c Fri Oct 2 14:21:31 2009 (r1304) @@ -1238,6 +1238,7 @@ smlAssert(userdata); SmlTransportObexClientEnv *env = userdata; smlAssert(env); + smlTrace(TRACE_INTERNAL, "%s: tsp %p)", __func__, env->tsp); if (error) goto error; |
From: <svn...@op...> - 2009-10-01 15:27:04
|
Author: bellmich Date: Thu Oct 1 16:09:51 2009 New Revision: 1296 URL: http://libsyncml.opensync.org/changeset/1296 Log: fixed wrong trace statement Modified: trunk/libsyncml/parser/sml_xml_parse.c Modified: trunk/libsyncml/parser/sml_xml_parse.c ============================================================================== --- trunk/libsyncml/parser/sml_xml_parse.c Thu Oct 1 14:47:47 2009 (r1295) +++ trunk/libsyncml/parser/sml_xml_parse.c Thu Oct 1 16:09:51 2009 (r1296) @@ -3566,7 +3566,7 @@ SmlDevInfDataStore *datastore, GError **error) { - smlTrace(TRACE_ENTRY, "%s(%p, %s, %p, %p, %p)", __func__, parser, VA_STRING(element), datastore, error); + smlTrace(TRACE_ENTRY, "%s(%p, %s, %p, %p)", __func__, parser, VA_STRING(element), datastore, error); CHECK_ERROR_REF smlAssert(parser); smlAssert(element); |
From: <svn...@op...> - 2009-10-01 15:13:10
|
Author: bellmich Date: Thu Oct 1 17:12:58 2009 New Revision: 1303 URL: http://libsyncml.opensync.org/changeset/1303 Log: fixed cleanup code (mainly added unref for data_store_server) Modified: trunk/libsyncml/data_sync_api/sml_data_sync_data_store.c Modified: trunk/libsyncml/data_sync_api/sml_data_sync_data_store.c ============================================================================== --- trunk/libsyncml/data_sync_api/sml_data_sync_data_store.c Thu Oct 1 17:12:33 2009 (r1302) +++ trunk/libsyncml/data_sync_api/sml_data_sync_data_store.c Thu Oct 1 17:12:58 2009 (r1303) @@ -95,18 +95,32 @@ sml_data_sync_data_store_finalize (GObject *object) { SmlDataSyncDataStore *self = (SmlDataSyncDataStore *) object; - if (self->priv->data_sync) + + if (self->priv->data_sync) { g_object_unref(self->priv->data_sync); - if (self->priv->remote) + self->priv->data_sync = NULL; + } + + if (self->priv->data_store_server) { + g_object_unref(self->priv->data_store_server); + self->priv->data_store_server = NULL; + } + + if (self->priv->remote) { g_object_unref(self->priv->remote); - if (self->priv->local) + self->priv->remote = NULL; + } + + if (self->priv->local) { g_object_unref(self->priv->local); - if (self->priv->content_type) + self->priv->local = NULL; + } + + if (self->priv->content_type) { g_free(self->priv->content_type); - self->priv->data_sync = NULL; - self->priv->remote = NULL; - self->priv->local = NULL; - self->priv->content_type = NULL; + self->priv->content_type = NULL; + } + G_OBJECT_CLASS (sml_data_sync_data_store_parent_class)->finalize (object); } |
From: <svn...@op...> - 2009-10-01 15:12:45
|
Author: bellmich Date: Thu Oct 1 17:12:33 2009 New Revision: 1302 URL: http://libsyncml.opensync.org/changeset/1302 Log: added missing trace statement Modified: trunk/libsyncml/data_sync_api/sml_data_sync.c Modified: trunk/libsyncml/data_sync_api/sml_data_sync.c ============================================================================== --- trunk/libsyncml/data_sync_api/sml_data_sync.c Thu Oct 1 17:12:08 2009 (r1301) +++ trunk/libsyncml/data_sync_api/sml_data_sync.c Thu Oct 1 17:12:33 2009 (r1302) @@ -776,6 +776,7 @@ SmlSession *session, GError **error) { + smlTrace(TRACE_ENTRY, "%s (%p, %p, %p)", __func__, self, session, error); g_mutex_lock(self->priv->session_mutex); SmlDataSyncSession *data_sync_session = g_hash_table_lookup(self->priv->sessions, session); if (!data_sync_session) { |
From: <svn...@op...> - 2009-10-01 15:12:21
|
Author: bellmich Date: Thu Oct 1 17:12:08 2009 New Revision: 1301 URL: http://libsyncml.opensync.org/changeset/1301 Log: fixed wrong function call Modified: trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c Modified: trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c ============================================================================== --- trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c Thu Oct 1 17:11:44 2009 (r1300) +++ trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c Thu Oct 1 17:12:08 2009 (r1301) @@ -386,7 +386,7 @@ callback = sml_data_sync_data_store_get_change_status_callback(self->priv->data_store); userdata = sml_data_sync_change_item_get_userdata(change); if (!userdata) - userdata = sml_data_sync_data_store_get_change_status_userdata; + userdata = sml_data_sync_data_store_get_change_status_userdata(self->priv->data_store); if (callback && !callback(self, change, smlStatusGetCode(status), userdata, &error)) goto error; |
From: <svn...@op...> - 2009-10-01 15:11:56
|
Author: bellmich Date: Thu Oct 1 17:11:44 2009 New Revision: 1300 URL: http://libsyncml.opensync.org/changeset/1300 Log: fixed wrong error message Modified: trunk/libsyncml/transports/obex_server.c Modified: trunk/libsyncml/transports/obex_server.c ============================================================================== --- trunk/libsyncml/transports/obex_server.c Thu Oct 1 17:10:55 2009 (r1299) +++ trunk/libsyncml/transports/obex_server.c Thu Oct 1 17:11:44 2009 (r1300) @@ -633,7 +633,7 @@ OBEX_FL_KEEPSERVER); if (!env->handle) { g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, - "Unable to create OBEX IRDA transport."); + "Unable to create OBEX NET transport."); goto error; } OBEX_SetUserData(env->handle, env); |
From: <svn...@op...> - 2009-10-01 15:11:08
|
Author: bellmich Date: Thu Oct 1 17:10:55 2009 New Revision: 1299 URL: http://libsyncml.opensync.org/changeset/1299 Log: - fixed wrong error check - fixed wrong trace statement Modified: trunk/libsyncml/sml_transport.c Modified: trunk/libsyncml/sml_transport.c ============================================================================== --- trunk/libsyncml/sml_transport.c Thu Oct 1 16:12:37 2009 (r1298) +++ trunk/libsyncml/sml_transport.c Thu Oct 1 17:10:55 2009 (r1299) @@ -1171,8 +1171,7 @@ goto error; } - if (tsp->state != SML_TRANSPORT_INITIALIZED && - tsp->state != SML_TRANSPORT_ERROR) { + if (tsp->state < SML_TRANSPORT_INITIALIZED) { g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, "Transport was not in the state \"Initialized\""); goto error; } |
From: <svn...@op...> - 2009-10-01 14:52:08
|
Author: bellmich Date: Thu Oct 1 16:12:37 2009 New Revision: 1298 URL: http://libsyncml.opensync.org/changeset/1298 Log: added missing cleanup code Modified: trunk/tests/check_data_sync_api.c Modified: trunk/tests/check_data_sync_api.c ============================================================================== --- trunk/tests/check_data_sync_api.c Thu Oct 1 16:12:12 2009 (r1297) +++ trunk/tests/check_data_sync_api.c Thu Oct 1 16:12:37 2009 (r1298) @@ -649,6 +649,21 @@ } g_object_unref(server); + /* cleanup clients */ + while (clients) { + SmlDataSyncTestClient *client = clients->data; + clients = g_list_remove(clients, client); + g_object_unref(client->data_store); + g_object_unref(client->client); + smlSafeFree((gpointer *)&client); + } + + /* cleanup server */ + g_object_unref(server); + server = NULL; + g_object_unref(server_data_store); + server_data_store = NULL; + return; error: if (runMutex) { |
From: <svn...@op...> - 2009-10-01 14:33:13
|
Author: bellmich Date: Thu Oct 1 16:12:12 2009 New Revision: 1297 URL: http://libsyncml.opensync.org/changeset/1297 Log: - fixed trace statements - added missing cleanup code - added a missing reference to a data store in sml_data_sync.c Modified: trunk/libsyncml/data_sync_api/sml_data_sync.c trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c trunk/libsyncml/data_sync_api/sml_data_sync_session.c Modified: trunk/libsyncml/data_sync_api/sml_data_sync.c ============================================================================== --- trunk/libsyncml/data_sync_api/sml_data_sync.c Thu Oct 1 16:09:51 2009 (r1296) +++ trunk/libsyncml/data_sync_api/sml_data_sync.c Thu Oct 1 16:12:12 2009 (r1297) @@ -135,6 +135,7 @@ error = NULL; } smlTransportFree(self->priv->tsp); + self->priv->tsp = NULL; } /* cleanup configuration */ @@ -171,21 +172,26 @@ /* cleanup sessions */ g_hash_table_remove_all(self->priv->data_sync_sessions); g_hash_table_remove_all(self->priv->sessions); + g_hash_table_unref(self->priv->data_sync_sessions); + g_hash_table_unref(self->priv->sessions); + self->priv->data_sync_sessions = NULL; + self->priv->sessions = NULL; if (self->priv->session_mutex) g_mutex_free(self->priv->session_mutex); - -// /* cleanup authentication */ -// if ((*dsObject)->auth) -// smlAuthFree((*dsObject)->auth); - -// /* cleanup device information */ -// if ((*dsObject)->localDevInf) -// g_object_unref((*dsObject)->localDevInf); -// if ((*dsObject)->remoteDevInf) -// g_object_unref((*dsObject)->remoteDevInf); -// if ((*dsObject)->agent) -// smlDevInfAgentFree((*dsObject)->agent); + /* cleanup authentication */ + if (self->priv->auth) + smlAuthFree(self->priv->auth); + + /* cleanup device information */ + if (self->priv->local_dev_inf) { + g_object_unref(self->priv->local_dev_inf); + self->priv->local_dev_inf = NULL; + } + if (self->priv->agent) { + smlDevInfAgentFree(self->priv->agent); + self->priv->agent = NULL; + } /* reset everythig to NULL */ @@ -271,6 +277,7 @@ SmlDataSync* sml_data_sync_new (void) { + smlTrace(TRACE_INTERNAL, "%s", __func__); return g_object_new (SML_TYPE_DATA_SYNC, NULL); } @@ -551,6 +558,7 @@ sml_return_val_error_if_fail (SML_IS_DATA_SYNC_DATA_STORE (ds), FALSE, error, SML_ERROR_GENERIC, "There must be a SmlDataSyncDataStore object."); self->priv->data_stores = g_list_append(self->priv->data_stores, ds); + g_object_ref(ds); sml_data_sync_data_store_set_data_sync(ds, self); return TRUE; } Modified: trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c ============================================================================== --- trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c Thu Oct 1 16:09:51 2009 (r1296) +++ trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c Thu Oct 1 16:12:12 2009 (r1297) @@ -63,6 +63,8 @@ { SmlDataSyncDataStoreSession *self = (SmlDataSyncDataStoreSession *) object; + /* cleanup lists */ + while(self->priv->changes) { SmlDataSyncChangeItem *change = self->priv->changes->data; self->priv->changes = g_list_remove(self->priv->changes, change); @@ -75,14 +77,27 @@ g_object_unref(mapping); } - //if (self->priv->remote_next) - // smlSafeCFree(&(self->priv->remote_ext)); - //if (self->priv->local_next) - // smlSafeCFree(&(self->priv->local_next)); - //if (self->priv->session) - // smlDsSessionUnref(self->priv->session); - //if (self->priv->server) - // smlDsServerFree(self->priv->server); + /* cleanup object references */ + + if (self->priv->data_store_session) { + smlDsSessionUnref(self->priv->data_store_session); + self->priv->data_store_session = NULL; + } + if (self->priv->data_store) { + g_object_unref(self->priv->data_store); + self->priv->data_store = NULL; + } + if (self->priv->data_sync_session) { + g_object_unref(self->priv->data_sync_session); + self->priv->data_sync_session = NULL; + } + + /* cleanup sync anchors */ + + if (self->priv->remote_next) + smlSafeCFree(&(self->priv->remote_next)); + if (self->priv->local_next) + smlSafeCFree(&(self->priv->local_next)); G_OBJECT_CLASS (sml_data_sync_data_store_session_parent_class)->finalize (object); } @@ -360,7 +375,7 @@ SmlStatus *status, void *userdata) { - smlTrace(TRACE_ENTRY, "%s(%p, %p, %s, %p)", __func__, dsession, status, userdata); + smlTrace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, dsession, status, userdata); GError *error = NULL; smlAssert(userdata); @@ -393,7 +408,7 @@ SmlMapItem *item, void *userdata) { - smlTrace(TRACE_ENTRY, "%s(%p, %s, %s, %p)", __func__, dsession, item, userdata); + smlTrace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, dsession, item, userdata); GError *error = NULL; SmlDataSyncDataStoreSession *self = userdata; Modified: trunk/libsyncml/data_sync_api/sml_data_sync_session.c ============================================================================== --- trunk/libsyncml/data_sync_api/sml_data_sync_session.c Thu Oct 1 16:09:51 2009 (r1296) +++ trunk/libsyncml/data_sync_api/sml_data_sync_session.c Thu Oct 1 16:12:12 2009 (r1297) @@ -115,6 +115,34 @@ g_hash_table_remove_all(self->priv->hash_dsdss2dsdss); g_hash_table_remove_all(self->priv->hash_ds2dsdss); g_hash_table_remove_all(self->priv->hash_dsds2dsdss); + g_hash_table_unref(self->priv->hash_dsdss2dsdss); + g_hash_table_unref(self->priv->hash_ds2dsdss); + g_hash_table_unref(self->priv->hash_dsds2dsdss); + self->priv->hash_dsdss2dsdss = NULL; + self->priv->hash_ds2dsdss = NULL; + self->priv->hash_dsds2dsdss = NULL; + + /* cleanup remote DevInf */ + if (self->priv->remote_dev_inf) { + g_object_unref(self->priv->remote_dev_inf); + self->priv->remote_dev_inf = NULL; + } + + /* cleanup locations */ + if (self->priv->remote) { + g_object_unref(self->priv->remote); + self->priv->remote = NULL; + } + if (self->priv->local) { + g_object_unref(self->priv->local); + self->priv->local = NULL; + } + + /* cleanup data sync object */ + if (self->priv->data_sync) { + g_object_unref(self->priv->data_sync); + self->priv->data_sync = NULL; + } G_OBJECT_CLASS (sml_data_sync_session_parent_class)->finalize (object); } |
From: <svn...@op...> - 2009-10-01 14:08:40
|
Author: bellmich Date: Thu Oct 1 14:47:47 2009 New Revision: 1295 URL: http://libsyncml.opensync.org/changeset/1295 Log: removed useless code which additionally produced a memory leak Modified: trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c Modified: trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c ============================================================================== --- trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c Wed Sep 30 17:22:41 2009 (r1294) +++ trunk/libsyncml/data_sync_api/sml_data_sync_data_store_session.c Thu Oct 1 14:47:47 2009 (r1295) @@ -342,35 +342,6 @@ sml_data_sync_change_item_get_action(item) == SML_CHANGE_REPLACE) sml_data_sync_change_item_set_action(item, SML_CHANGE_ADD); - /* decode base64 data if necessary */ - gchar *data = NULL; - gsize length = 0; - const gchar *ct = sml_data_sync_data_store_get_content_type(session->priv->data_store); - size_t appClassLength = ((size_t) index(ct, '/')) - - ((size_t) ct); - if ( ( strstr(ct, SML_CONTENT_TYPE_APPLICATION) == ct && - appClassLength == strlen(SML_CONTENT_TYPE_APPLICATION) ) || - ( strstr(ct, SML_CONTENT_TYPE_AUDIO) == ct && - appClassLength == strlen(SML_CONTENT_TYPE_AUDIO) ) || - ( strstr(ct, SML_CONTENT_TYPE_IMAGE) == ct && - appClassLength == strlen(SML_CONTENT_TYPE_IMAGE) ) || - ( strstr(ct, SML_CONTENT_TYPE_MESSAGE) == ct && - appClassLength == strlen(SML_CONTENT_TYPE_MESSAGE) ) || - ( strstr(ct, SML_CONTENT_TYPE_VIDEO) == ct && - appClassLength == strlen(SML_CONTENT_TYPE_AUDIO) ) ) - { - /* binary data must be base64 encoded */ - data = (char *) g_base64_decode(sml_data_sync_change_item_get_data(item), &length); - if (!data) { - g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, - "The base 64 decoding of glib failed."); - goto error; - } - } else { - data = g_strdup(sml_data_sync_change_item_get_data(item)); - length = strlen(data); - } - /* perform callback */ if (!callback (session, item, userdata, error)) goto error; |
From: <svn...@op...> - 2009-09-30 15:22:55
|
Author: bellmich Date: Wed Sep 30 17:22:41 2009 New Revision: 1294 URL: http://libsyncml.opensync.org/changeset/1294 Log: - added a new test to simulate a special case for Final - the number of test items can now be set directly Modified: trunk/tests/CMakeLists.txt trunk/tests/check_data_sync_api.c Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Wed Sep 30 17:21:21 2009 (r1293) +++ trunk/tests/CMakeLists.txt Wed Sep 30 17:22:41 2009 (r1294) @@ -523,6 +523,7 @@ SML_ADD_TESTCASE( ds_api_max_msg_changes_empty ) SML_ADD_TESTCASE( ds_api_max_msg_changes_single ) SML_ADD_TESTCASE( ds_api_max_msg_changes_multi ) + SML_ADD_TESTCASE( ds_api_max_msg_changes_multi_plus_one ) SML_END_TEST() ENDIF ( ENABLE_OPENOBEX_TCP OR ENABLE_HTTP ) Modified: trunk/tests/check_data_sync_api.c ============================================================================== --- trunk/tests/check_data_sync_api.c Wed Sep 30 17:21:21 2009 (r1293) +++ trunk/tests/check_data_sync_api.c Wed Sep 30 17:22:41 2009 (r1294) @@ -904,7 +904,8 @@ void test_ds_api_max_msg_changes (const char *port, - const char *max) + const char *max, + gsize max_items) { GError *error = NULL; init_testbed(1, "HTTP", port); @@ -932,7 +933,6 @@ goto error; /* configure test data */ - int max_items = 1000; int i; for(i = 0; i < max_items; i++) { client->items = g_list_append(client->items, g_strdup_printf("client 1 data %d", (i+1))); @@ -947,19 +947,25 @@ START_TEST (ds_api_max_msg_changes_empty) { - test_ds_api_max_msg_changes("17007", "0"); + test_ds_api_max_msg_changes("17007", "0", 1000); } END_TEST START_TEST (ds_api_max_msg_changes_single) { - test_ds_api_max_msg_changes("17008", "1"); + test_ds_api_max_msg_changes("17008", "1", 100); } END_TEST START_TEST (ds_api_max_msg_changes_multi) { - test_ds_api_max_msg_changes("17009", "5"); + test_ds_api_max_msg_changes("17009", "5", 500); +} +END_TEST + +START_TEST (ds_api_max_msg_changes_multi_plus_one) +{ + test_ds_api_max_msg_changes("17009", "5", 501); } END_TEST |
From: <svn...@op...> - 2009-09-30 15:21:34
|
Author: bellmich Date: Wed Sep 30 17:21:21 2009 New Revision: 1293 URL: http://libsyncml.opensync.org/changeset/1293 Log: added support for flushing after a configured number of change commands Modified: trunk/libsyncml/sml_session.c trunk/libsyncml/sml_session_internals.h Modified: trunk/libsyncml/sml_session.c ============================================================================== --- trunk/libsyncml/sml_session.c Wed Sep 30 13:27:21 2009 (r1292) +++ trunk/libsyncml/sml_session.c Wed Sep 30 17:21:21 2009 (r1293) @@ -177,6 +177,7 @@ session->lastMessageID++; session->hasCommand = FALSE; + session->msgChanges = 0; smlTrace(TRACE_EXIT, "%s", __func__); return TRUE; @@ -293,6 +294,24 @@ CHECK_ERROR_REF SmlPendingStatus *pending = NULL; gboolean fragmented = FALSE; + + /* If the user specified a maximum number of changes per message + * then this is the place to flush the message. + */ + + if (smlCommandGetType(cmd) == SML_COMMAND_TYPE_ADD || + smlCommandGetType(cmd) == SML_COMMAND_TYPE_REPLACE || + smlCommandGetType(cmd) == SML_COMMAND_TYPE_DELETE) + session->msgChanges++; + + if (0 < session->localMaxMsgChanges && + session->localMaxMsgChanges < session->msgChanges) + { + smlTrace(TRACE_INTERNAL, "%s: maximum number of changes per message exceeded", __func__); + if (!_smlSessionFlushInternal(session, FALSE, error)) { + goto error; + } + } if (parent && !session->hasCommand) { GList *c = NULL; @@ -587,7 +606,7 @@ if (addToCommandStack) session->commandStack = g_list_append(session->commandStack, cmd); session->hasCommand = TRUE; - + smlTrace(TRACE_EXIT, "%s", __func__); return SML_ASSEMBLER_RESULT_OK; error: @@ -2047,6 +2066,8 @@ session->reportedEnd = FALSE; session->sessionType = sessionType; session->lastCommandID = 0; + session->localMaxMsgChanges = 0; + session->msgChanges = 0; if (sessionType == SML_SESSION_TYPE_CLIENT) session->sending = TRUE; Modified: trunk/libsyncml/sml_session_internals.h ============================================================================== --- trunk/libsyncml/sml_session_internals.h Wed Sep 30 13:27:21 2009 (r1292) +++ trunk/libsyncml/sml_session_internals.h Wed Sep 30 17:21:21 2009 (r1293) @@ -57,6 +57,8 @@ gsize localMaxMsgSize; gsize localMaxObjSize; gsize localMaxMsgChanges; + + gsize msgChanges; GList *pendingReplies; |
From: <svn...@op...> - 2009-09-30 11:27:36
|
Author: bellmich Date: Wed Sep 30 13:27:21 2009 New Revision: 1292 URL: http://libsyncml.opensync.org/changeset/1292 Log: added two tests for the new option MAX_MSG_CHANGES Modified: trunk/tests/CMakeLists.txt trunk/tests/check_data_sync_api.c Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Wed Sep 30 13:11:44 2009 (r1291) +++ trunk/tests/CMakeLists.txt Wed Sep 30 13:27:21 2009 (r1292) @@ -520,6 +520,9 @@ SML_ADD_TESTCASE( ds_api_single_client_multi_text_vcard_21 ) SML_ADD_TESTCASE( ds_api_multi_client_single_text_vcard_21 ) SML_ADD_TESTCASE( ds_api_multi_client_multi_text_vcard_21 ) + SML_ADD_TESTCASE( ds_api_max_msg_changes_empty ) + SML_ADD_TESTCASE( ds_api_max_msg_changes_single ) + SML_ADD_TESTCASE( ds_api_max_msg_changes_multi ) SML_END_TEST() ENDIF ( ENABLE_OPENOBEX_TCP OR ENABLE_HTTP ) Modified: trunk/tests/check_data_sync_api.c ============================================================================== --- trunk/tests/check_data_sync_api.c Wed Sep 30 13:11:44 2009 (r1291) +++ trunk/tests/check_data_sync_api.c Wed Sep 30 13:27:21 2009 (r1292) @@ -130,8 +130,9 @@ sml_fail_unless(sml_data_sync_data_store_session_add_change(dss, item, NULL, error), "%s", GET_ERROR_MESSAGE((*error))); } - smlTrace(TRACE_EXIT, "%s", __func__); - return sml_data_sync_session_send_changes(session, error); + gboolean result = sml_data_sync_session_send_changes(session, error); + smlTrace(TRACE_EXIT, "%s - %d", __func__); + return result; } static void @@ -141,7 +142,7 @@ void *userdata, const GError *error) { - smlTrace(TRACE_ENTRY, "%s(%p, %i, %p, %p)", __func__, dsObject, type, userdata, error); + smlTrace(TRACE_ENTRY, "%s(%p, %p, %i, %p, %p)", __func__, session, dsObject, type, userdata, error); GError *locerror = NULL; SmlDataSyncTestClient *client = NULL; @@ -901,5 +902,66 @@ } END_TEST +void +test_ds_api_max_msg_changes (const char *port, + const char *max) +{ + GError *error = NULL; + init_testbed(1, "HTTP", port); + if (!sml_data_sync_set_option(server, SML_DATA_SYNC_CONFIG_MAX_MSG_CHANGES, max, &error)) + goto error; + + /* register datastore + * the source must be identical because this is http + */ + + SmlDataSyncTestClient *client = clients->data; + client->data_store = sml_data_sync_data_store_new(); + sml_data_sync_data_store_set_content_type (client->data_store, "text/x-vcard"); + sml_data_sync_data_store_set_local_uri (client->data_store, "contacts"); + sml_data_sync_data_store_register_change_callback(client->data_store, clientRecvChangeCallback, NULL); + if (!sml_data_sync_add_data_store(client->client, client->data_store, &error)) + goto error; + + server_data_store = sml_data_sync_data_store_new(); + sml_data_sync_data_store_set_content_type (server_data_store, "text/x-vcard"); + sml_data_sync_data_store_set_local_uri (server_data_store, "contacts"); + sml_data_sync_data_store_register_change_callback(server_data_store, serverRecvChangeCallback, NULL); + sml_data_sync_data_store_register_mapping_callback(server_data_store, serverRecvMappingCallback, NULL); + if (!sml_data_sync_add_data_store(server, server_data_store, &error)) + goto error; + + /* configure test data */ + int max_items = 1000; + int i; + for(i = 0; i < max_items; i++) { + client->items = g_list_append(client->items, g_strdup_printf("client 1 data %d", (i+1))); + } + + run_testbed(); + + return; +error: + sml_fail_unless(FALSE, "%s", error->message); +} + +START_TEST (ds_api_max_msg_changes_empty) +{ + test_ds_api_max_msg_changes("17007", "0"); +} +END_TEST + +START_TEST (ds_api_max_msg_changes_single) +{ + test_ds_api_max_msg_changes("17008", "1"); +} +END_TEST + +START_TEST (ds_api_max_msg_changes_multi) +{ + test_ds_api_max_msg_changes("17009", "5"); +} +END_TEST + @SML_TESTCASE_CODE@ |