summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-03-24smltk+DevInf decoding: avoid a possible infinite loopcongwuChen Congwu1-1/+4
For DevInf 1.1 parsing, DevInf decoding will cause an infinite loop if there is an empty <PropName> tag (found from Nokia N900, Nokia 7210c): eg: <CTCap> <CTType>text/plain</CTType> <PropName/> </CTCap> buildDevInfProperty will return OK without further processing if encountering an empty tag (in this case <PropName>) and the caller buildDevInfCtCap will re-evaluate the tag without advancing the parser, the re-evaluation can only end if current tag is an end tag or an unknown tag, otherwize it will call buildDevInfProperty with exactly the same environment again.
2010-03-24smltk: DevInf decodingChen Congwu1-1/+4
Some Nokia phones (N900) sent a nor-wellformed DevInf: The DevInf version was declared as 1.2, while <CTCAP> was not inside <Datastore>(which is the DevInf 1.1 behaviour). In addition, the content inside <CTCAP> was in DevInf 1.2 format. The original approach detects whether this is a DevInf 1.2 or 1.1 by testing whether <CTCAP> was inside <datastore>, thus will think this is a DevInf 1.1 when decoding the <CTCAP> which fails. The patch worked around this, when decoding <CTCAP> (precisely the <Property> or <PropName> inside <CTCAP>), use 1.2 style if we are decoding <Property> and 1.1 stype when decoding <PropName>
2010-03-22.gitignore: add SDK_EXCLUDE_FILESPatrick Ohly1-0/+1
The recently introduced SDK_EXCLUDE_FILES temporary file in src, used by gen-makefile-am.sh, has to be listed in .gitignore to get a clean "git status" output.
2010-03-19Build: pull blob.h/blob.cpp in libsynthesissdk dynamic buildChen Congwu1-2/+0
This is needed for blob db api, it was previously enabled only libsynthesis engine.
2010-03-18syserial.h: New SYSER_PRODFLAG_CLIENT_APP flaglibsynthesis_3.4.0.6Lukas Zeller1-2/+3
2010-03-18sysync_b64: added b64::free() that can be called to dispose blocks allocated ↵Lukas Zeller10-17/+29
by b64::decode/encode As sysync_b64 was made independent, it can't use sysync_malloc() any more, but uses normal malloc(). However, all blocks allocated and returned by b64::encode/decode were still returned with sysync_free(). This only did not hurt because sysync_free was mapped to free in most (all?) builds. Anyway, that was ugly so sysync_b64 now includes b64::free() to clean up the situation. This patch changes all occurrences of sysync_free() returning blocks allocated by b64:: routines with b64::free().
2010-03-18MIME-DIR "group" feature: fixed extra increment of array index in some casesLukas Zeller1-16/+21
In some cases, the array index was incremented twice, such that an empty row was inserted into the "table" represented by the array fields building a grouped property (like ORG, TITLE and ORG_GROUP).
2010-03-18engine: compilable again without engineinterface and AsKeyLukas Zeller1-0/+2
2010-03-18pluginapids: ReadNextItem can now return error without causing exceptions.Lukas Zeller2-16/+39
In particular, LOCERR_USERSUSPEND can be returned to signal that the plugin has detected a external condition that should suspend the session. All other errors abort the session.
2010-03-18Merge remote branch 'moblin/master' into luzLukas Zeller2-2/+12
2010-03-18engine 3.4.0.5: new version for SAN 1.1 related changes in file location etc.Lukas Zeller1-2/+2
2010-03-18SAN 1.1: fix needed to compile Synthesis internal projects again with ↵Lukas Zeller1-0/+3
changes related to SAN 1.1
2010-03-18Merge remote branch 'moblin/san11' into luzLukas Zeller19-64/+447
2010-03-18SAN 1.1 preparation: when moving sysync_utils, these (included) files need ↵Lukas Zeller2-0/+0
to be moved as well to support the Chinese character set (CHINESE_SUPPORT #defineD)
2010-03-17engine: fix for very late suspendLukas Zeller1-2/+9
When a client was requested to suspend, datastores that had already successfully finished syncing were still considered "aborted" and thus did not save their anchors properly. With this change a late suspend will only affect datastores that were still in progress at the time of suspend. Already completed datastores will save anchors and will NOT resume in the next sync.
2010-03-17engine: getItemByID: made sure newly inserted items can be retrievedLukas Zeller1-7/+21
getItemByID assumed that all items to be read were part of the syncset which is obviously not the case for newly inserted items. So in case the item is not found in the sync set, we must try to directly load it from the DB. This bug only affects customimpl on binfile AND change detection by CRC enabled. No product before the Android client used this combination so far so it did not surface until now.
2010-03-16Merge remote branch 'refs/remotes/moblin/subdatastores-devinf' into luzLukas Zeller1-3/+10
2010-03-15resume + pending item fix in SyncML serverPatrick Ohly1-2/+7
When an item that was split among messages was finally reassembled and processed by the server, the status sent to the client was not properly stored in the admin data. As a result of that, when the session got suspended directly after sending that status, the client would resume, send the last item chunk again, but then not get the previous status. Instead the server attempted to parse the incomplete item and failed. The root cause was that TSyncSession::process() was called recursively. The inner one for the incomplete command saved the status in fLastItemStatus. The outer one then later didn't have a status pointer, fell back to status 0 and overwrote the valid status. This patch solves this by suppressing that second updating of fLastItemStatus and all related fields if the item was handled by an inner process() call.
2010-03-11Valgrind warning fixed: initialize the conditonal variablesmb10091Chen Congwu1-0/+5
2010-03-11Build script and code changes for the new moved utility code.san11Chen Congwu9-59/+117
stringutil is inflated to add several functions from stringutils so that we can keep stringutil as enough for SDKs Unnecessary needed utility functions in sysync_utils is disabled in SDK build by wrapping inside #ifdef SYSYNC_ENGINE
2010-03-11SAN 1.1 generation support: Moved utility code from engine to sdkChen Congwu6-0/+0
2010-03-09SAN parsing version check fix: should be && instead of ||Chen Congwu1-2/+2
2010-03-09San1.1 : compiler warning fixedChen Congwu2-2/+2
2010-03-05TBlob: export Init() properties read-onlyPatrick Ohly1-0/+6
Making these properties available for a user of TBlob is useful because then the user can computer some values, call Init() and later retrieve them without having to store its own copy. SyncEvolution does that with the blob path. The other properties are added in this patch for the sake of completeness.
2010-03-05SAN 1.0/1.1 generation: check for invalid SAN packageChen Congwu2-12/+23
1. We check the 'version' field in the SAN package to match 1.0/1.1/1.2, otherwise we consider this as invalid. 2. The PassSan API is changed to add a new parameter 'mode', which defaults to 0 (try both SAN 1.2 and SAN 1.1 if applicable), however user can also set 'mode' to 1 to try SAN 1.1 only and to 2 to try SAN 1.2 only. 3. workspaceSize is enlarged from 1024 to 1024*30 since we may accept invalid resonably large SAN message.
2010-03-05SAN 1.0/1.1 generation supportChen Congwu3-2/+165
Use PreparePackage and GetPackageLegacy to generate a 1.0/1.1 version SAN package. Linker script it updated to expose the used API.
2010-03-05Accept SAN 1.0 pacakge (only wbxml is supported)Chen Congwu6-3/+137
Linker script is updated to expose the newly used API.
2010-03-05Server: made silently swallow garbage after end of incoming SyncML messageChen Congwu1-0/+11
The problem was already fixed in client mode, the same problem and fix applied for server mode.
2010-03-05server engine: added missing check for re-sent <Add> during resume.Lukas Zeller2-13/+31
This remained undetected because most clients, including libsynthesis itself before a few months ago, always used <Replace> and never <Add> (which is ok for a client to do). Now an <Add> with an already known remoteID will be detected and causes implProcessItem() to return status 418. This status will be either reported back to the client in a resumed session, or in a non-resumed session with updates not explicitly ignored the operation will be implicitly converted to a <Replace>. In the server case, 208 status will be returned. Note that for the client case, duplicate adds are detected and prevented entirely differently (by checking against list of pending maps = IDs of not completely confirmed and mapped adds from the previous session).
2010-03-04server engine: added option to implement client resent message handling.Lukas Zeller3-7/+38
- added <buffersretryanswer> config flag to signal that transport buffers server responses and can re-send them when needed. - SessionStep() in server case may (if <buffersretryanswer> is enabled) return STEPCMD_RESENDDATA to indicate that the previous response should be resent to the client. After that, the state machine is expecting STEPCMD_SENTDATA again. Note that the engine does NOT provide the data to be resent, so don't call GetSyncMLBuffer after STEPCMD_RESENDDATA. The caller must buffer the data itself.
2010-03-04Fixed server case of superdatastore which was broken by 6626a57e9e (Engine ↵Lukas Zeller1-1/+7
3.4.0.5: implemented client-side superdatastores...) In both server and client case, status 508 is ok and must not abort processing subdatastores. In server case, the presence of a subalertcmdP already means that the processing is ok, so the check needs only be done for subalertcmdP==NULL (i.e. client case and server problem case)
2010-02-25debuglogger: avoid segfault when log file cannot be reopenedPatrick Ohly1-10/+11
While a SyncML server session was active, I removed the directory and the log file that the server was using. The next time the server tried to log something, it segfaulted in the fclose(fFile) because of the NULL pointer from fopen(). Don't do anything if the file cannot be opened.
2010-02-23.so version bumped to 0.3.1 (minor revision increased)libsynthesis_3.4.0.5+syncevolution-1-0-beta-2Patrick Ohly1-1/+1
The API should be unchanged compared to previous releases, but the implementation has been improved.
2010-02-22DevInf + superdatastore: avoid redundant <DataStore>subdatastores-devinfPatrick Ohly1-3/+10
When the client has alerted a superdatastore in a SyncML server and then is sent DevInf, the server produced a <DataStore> entry <DevInf> for the superdatastore and each sub-datastore, all with the same <LocURL> (the one that was alerted). This is redundant at best, and confusing the client at worst. This patch detects that a datastore was alerted as a sub-datastore and skips it when generating <DevInf>.
2010-02-19Merge remote branch 'moblin/master' into luzLukas Zeller8-9/+30
2010-02-19Engine 3.4.0.5: implemented client-side superdatastores according to ↵Lukas Zeller9-122/+305
suggestion/draft implementation of Patrick - Re-implemented along Patrick's changes in his working implementation, but making it generic and no longer depending on binfile classes, such that it should work with console clients as well. - changed the superdatastore trigger syntax from <super:remotepath> to the already discussed <super>remotepath - tested ok against synthesis IOT calendar (with iPhone client).
2010-02-18engine: now shows engine-determined OS/version as well as configured hwv/fwv ↵Lukas Zeller1-0/+7
in log
2010-02-18engine: added more configurable devInf data via config variablesLukas Zeller1-2/+22
The following config variables can now be used to override default (hardcoded and/or from platform adapter): customdevicetype, customfirmwareversion, customhardwareversion, custommodel, custommanufacturer Note that the same can also be overridden in the config using <devicetype>,<firmwareversion>, <hardwareversion>, <model>, <manufacturer> (since early 2009)
2010-02-18engine: added configurable device ID (via "customdeviceid" config variable)Lukas Zeller4-8/+27
when "customdeviceid" is defined it will be used instead of the id determined by platform adapters. Notes: - "customdeviceid" is considered to be truly unique when defined. - The value used for the device ID on the SyncML level might be a MD5 hash of the real device ID and the user name when required. - the "device_uri" predefined config variable always returns the device ID as determined by platform adapters.
2010-02-11xmltk fixes for Nokia ovi serviceChen Congwu4-2/+7
It uses syncml:syncml as the namespace where we only support SYNCML:SYNCML before; It sends '+' as an html entity "#43" which the libary did not handles.
2010-02-09TEngineModuleBase::Connect() - fixed compiler warningPatrick Ohly1-1/+1
cbVersion is only used inside the #ifdef. When that code is not active, gcc warns about it being unused and (with -Werror) refuses to compile.
2010-02-09do not treat 418 = "item exists" as an errorPatrick Ohly1-1/+9
418 = item already exits: sent by Funambol server when both client and and server have a new item which is considered identical by the server (must be really identical, minor difference will lead to a merged item which is sent back to the client without the 418). This patch treats 418 as an "okay" status code and lets the session continue. Found in SyncEvolution, see Moblin Bugzilla #4599.
2010-02-09LOCERR_DATASTORE_ABORT: abort store, not sessionPatrick Ohly2-5/+13
Calling ABORTDATASTORE() normally aborts the whole session. Passing the new LOCERR_DATASTORE_ABORT avoids that. However, servers might get confused when a client stops sending information about one store, so someone using this special status code should better know what they are doing...
2010-02-05Engine 3.4.0.4: enhanced remote rules with subrules and multiple active ↵Lukas Zeller7-139/+223
rules per session - as before, unless a rule has the <finalrule> flag set, all remote rules will be checked for a match, and all matching rule's behaviour flags will be combined. - UNLIKE before (where the last matching rule was considered the one and only "active" rule), now all matching rules are kept in a list and all considered active. - Using <include rule="..."/> in a remote rule, a matching rule can activate other rules. - Using <subrule> (instead of <remoterule>), rules can be defined that never match by themselves, but can only be activated using <include name="..."/> - The REMOTERULENAME() script function still returns the name of the LAST activated rule (which, unless <include> is used, is the LAST matching rule, and is therefore backwards compatible with pre 3.4.0.4 configs. - A new ISACTIVERULE() script function allows to test if a certain rule is active (by name). This is meant to replace REMOTERULENAME()=="xxx" checks. - Rule-specific property definitions (<property rule="xxx") and rule-specific datatype usage (<use datatype="x" ... rulematch="rule"/>) now are activated by ANY of the active rules .
2010-02-05Merge remote branch 'moblin/master' into luzLukas Zeller73-48/+2401
2010-02-03target_options for basic DBG engine: cosmetic cleanup, not relevant for ↵libsynthesis_3.4.0.3Lukas Zeller1-5/+3
normal libsynthesis builds
2010-02-03Android: configfiles: avoid double slash in path nameBeat Forster1-2/+7
2010-02-03SDK_util.c : cosmetic - renamed defineBeat Forster1-5/+5
2010-02-03sync_dbapidef.h:Beat Forster1-1/+3
- Comment 1.7.0 adapted correctly - DBG_GET_SET_VALUE added
2010-02-02XML config samples: split up into individual fragmentsPatrick Ohly73-42/+2396
The sample configs contain common elements (datatypes, scripts, remote rules, debug settings) which are maintained as separate files in the corresponding directories. When modifying those common elements, run "update-samples.pl" in this directory to update the sample configs. The complete samples are under version control for several reasons: 1. avoid dependency on Perl unless common elements need to be updated 2. effect of changes on complete config show up in patches 3. the file layout and unshared parts (<client> and <server>) are determined by the sample configs The naming of common elements determines the order in which they get inserted. Files not ending in .xml are ignored. Elements that only apply to a client or server are stored in the corresponding sub directories, while the shared elements are in the "debug/scripting/datatypes/remoterules". It is a somewhat subjective choice which elements are stored in one file and which ones are split up. The three elements of a datatype definition (field list, profile, datatype) where split up because there might be multiple different profiles using the same field list and some users of these files might want to replace the default one. This patch unifies some definitions in client and servers. These user-visible changes are: - <folding>auto</folding> and <disable option="match"/> added to client - unused SYNCLVL field added to client - bookmark CATEGORIES definition in client updated to the more versatile one from the server - minor white space and comment changes - "note" -> "note10", "vbookmark" -> "vBookmark", "vbookmark" -> "vBookmark10" renames in server to be consistent with client As Lukas pointed out, the email scripts and datatypes are server specific because they depend on server-only methods. A normal client doesn't need them anyway resp. has to implement email support differently.