Translated by http://translate.google.de reviewed by author: Buglist the SyncML RTK on 06.03.2001 by Mirko Mrowczynski Stand 03.12.2001 Error Description: undefined reference to "ltoa" The library file libxpthttp.so can not compile, because the File / syncml / xpt / bindings / http / all / xpt-http.c at line 1597 is a function "ltoa (..)" call is not defined. Solution: Insert following function before row 1597. char * ltoa (long val, char * buf, int base) ( ldiv_t r; if (base> 36 | | base <2) ( * buf = '\ 0'; return buf; ) if (val <0) * buf + + = '-'; r = ldiv (labs (val), base); if (r.quot> 0) buf = ltoa (r.quot, buf, base); * buf + + = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ "[(int) r.rem]; * buf = '\ 0'; return buf; ) The "ltoa" (long to ascii) is called only once, with base 16. Therefore it would not be necessary to implement a function with base 2 to 36. -------------------------------------------------- --------------------------- Error description: "get" in the parser If a SyncML document being parsed, that a "get" command contains, then parsing will be aborted with error 0x200b (invalid document). The "get" command is not realised within the parser. Solution: Extend the switch - statement with an "get" entry. Add the call of the callback function. -------------------------------------------------- --------------------------- Error Description: xptReceiveData (..) Communication status When this function is called only once, then the Communication status of the connection will not be changed. The definition of the communication status is in the file syncml / src / xpt / manager / all / xptcomm.c from line 117: # define CI_STATE_READY_FOR_EXCHANGE 1 / / Connection just opened # define CI_STATE_EXPECTING_SET_DOC 2 / / client just exchange initiated # define CI_STATE_EXPECTING_GET_DOC 3 / / exchange server just initiated # define CI_STATE_SENDING 4 / / Okay to send data # define CI_STATE_RECEIVING 5 / / Okay to receive data # define CI_STATE_EXPECTING_END_EXCHANGE 6 / / Sending / receiving finished The status is 5 while calling xptReceiveData (..) and shall be set to 2 on the server and 6 at the client. But this will not happen at the first call of xptReceiveData (..). And if the status was not changed then the following calls of xpt ..- function will return with an Error 0x5017 (Invalid communication status) The error codes are in the file syncml / src / xpt / manager / xpt.h and will be "calculated" there. The search for an error number, therefore will be unsuccessful. Solution: xptReceiveData (..) must be called again after the data has been received. This time without receiving any data. Example: .. datalen = 0; ret = xptReceiveData pConn (, writePtr, free bytes, & tmpdataLen); while (tmpdataLen> 0) (/ / while data is received in the last call datalen = datalen + tmpdataLen; Free bytes = free bytes tmpdataLen -; ret = xptReceiveData (pConn (writePtr + datalen), free bytes, & tmpdataLen); ) .. -------------------------------------------------- --------------------------- Error Description: xptReceiveData (..) receives incorrect data In a part of all communication attempts there are incorrect data. This starts from the position which xptReceiveData (..) has given to the application. Solution: In the file syncml / src / xpt / bindings / http / all / xpt-http.c are from including line 1935 6 lines commented out. (Think about line shifts cause of the ltoa problem). Remove the comments and recompile the toolkit. Then xptReceiveData (..) returns right data. -------------------------------------------------- --------------------------- Error Description: smlTerminateInstance (id) list error Created workspaces are managed in RTK within a list. The application contains after the generation of the workspace an integer value >=1 for the Identification. If you remove with smlTerminateInstance (id) an workspace from the middle of the list, then an error occour in the list. Example: .. smlInitInstance (& callbacks, & options, NULL, & id4reply); / / id4reply = 1 .. smlInitInstance (& callbacks, & options, NULL, & id); / / id = 2 .. smlTerminateInstance (id4reply); .. smlInitInstance (& callbacks, & options, NULL, & id4reply); / / id4reply = 2 / * Here is 2 workspaces with the same ID! * / .. smlTerminateInstance (id); .. smlInitInstance (& callbacks, & options, NULL, & id); / / id = 0 / * Id = 0 is error because 0 List item * / .. smlProcessData (id, SML_ALL_COMMANDS); fault / / Segmentation. Solution: Finish Workspaces in the order you created them. Example: .. smlInitInstance (& callbacks, & options, NULL, & id4reply); / / id4reply = 1 .. smlInitInstance (& callbacks, & options, NULL, & id); / / id = 2 .. smlTerminateInstance (id); .. smlTerminateInstance (id4reply); .. smlInitInstance (& callbacks, & options, NULL, & id4reply); / / id4reply = 1 .. smlInitInstance (& callbacks, & options, NULL, & id); / / id = 2 .. In my implementation it was possible. But there may applications where it does not work. - Good luck.