Hi Patrick,

It looks to me this is the same situation that Congwu has already solved (see thread "Discussion: Client+Resend data: bug#3427, add sysync::STEP_RESENDDATA").

Just issue a STEP_RESENDDATA instead of repeating STEPCMD_SENTDATA. This is essentially a NOP, except that it issues a "send start" progress event again, so the UI would correctly show "Sending..." and not "Waiting..." (our standard UI, that is - I don't know how that is handled in your UI).

After STEP_RESENDDATA you can again send a STEPCMD_SENTDATA, to get into STEPCMD_NEEDDATA state and then continue with STEPCMD_GOTDATA.

Best Regards,

Lukas Zeller


On Sep 17, 2009, at 19:35 , Patrick Ohly wrote:

Hello!

I have the following situation:
     * engine prepares data, returns STEPCMD_SENDDATA
     * client sends data, calls engine with STEPCMD_SENTDATA, engine
       replies with STEPCMD_NEEDDATA
     * transport is called, replies with "data not ready yet", engine
       is called again with STEPCMD_SENTDATA => error, in state
ces_needdata (syncclient.cpp TSyncClient::SessionStep) this step
       isn't handled, leading to a return error code

I could change our loop so that the transport is called again
immediately instead of going through the engine. However, it looks
better to give the engine a chance to react. Therefore I suggest to
accept STEPCMD_SENTDATA in the ces_needdata state like this:

diff --git a/src/sysync/syncclient.cpp b/src/sysync/syncclient.cpp
index 79f4692..e26c7ee 100755
--- a/src/sysync/syncclient.cpp
+++ b/src/sysync/syncclient.cpp
@@ -455,6 +455,11 @@ TSyError TSyncClient::SessionStep(uInt16 &aStepCmd,
TEngineProgressInfo *aInfoP)

OBJ_PROGRESS_EVENT(getSyncAppBase(),pev_sendstart,NULL,0,0,0);
          sta = LOCERR_OK;
          break;
+        case STEPCMD_SENTDATA :
+          // no state change, keep asking for the data
+          aStepCmd = STEPCMD_NEEDDATA;
+          sta = LOCERR_OK;
+          break;
      } // switch stepCmdIn for ces_needdata
      break;

We didn't run into this situation before, although the code was there,
because our traditional HTTP transports didn't return prematurely. Now I
have added a transport for the D-Bus API which does that. The patch
solves the problem for me. Any comments?

--
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.



_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Lukas Zeller ([email protected])
-
Synthesis AG, SyncML Solutions  & Sustainable Software Concepts
[email protected], http://www.synthesis.ch





_______________________________________________
os-libsynthesis mailing list
[email protected]
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to