From: <svn...@op...> - 2009-10-18 10:23:42
|
Author: bellmich Date: Sun Oct 18 12:23:27 2009 New Revision: 1345 URL: http://libsyncml.opensync.org/changeset/1345 Log: better debugging for problems with space calculation Modified: trunk/libsyncml/sml_parse.c Modified: trunk/libsyncml/sml_parse.c ============================================================================== --- trunk/libsyncml/sml_parse.c Sat Oct 17 18:01:15 2009 (r1344) +++ trunk/libsyncml/sml_parse.c Sun Oct 18 12:23:27 2009 (r1345) @@ -645,8 +645,12 @@ */ if (smlCommandGetType(cmd) == SML_COMMAND_TYPE_ADD || smlCommandGetType(cmd) == SML_COMMAND_TYPE_REPLACE) - size -= strlen(sml_data_sync_change_item_get_data(smlCommandGetNthChange(cmd, 0))); - + { + gsize length = strlen(sml_data_sync_change_item_get_data(smlCommandGetNthChange(cmd, 0))); + smlTrace(TRACE_INTERNAL, "%s: item data size %d", __func__, length); + size -= length; + } + if (limit <= size) *space = 0; else @@ -721,11 +725,11 @@ goto error; if (size > limit) { - /* The status does not fit. Remove it again */ + /* The status/command does not fit. Remove it again */ if (!assm->functions.rem_cmd(assm->assm_userdata, parentID, error)) goto error; - smlTrace(TRACE_EXIT, "%s: Mismatch", __func__); + smlTrace(TRACE_EXIT, "%s: Mismatch => size (%d) > limit (%d)", __func__, size, limit); return SML_ASSEMBLER_RESULT_MISMATCH; } smlTrace(TRACE_INTERNAL, "%s: size %i, limit %i", __func__, size, limit); |