@@ -829,6 +829,8 @@ typedef void (*MyTimerCreateFn)(int err_code, MyTimerCtx* ctx, const char* err_m
829829typedef struct { MyTimerCreateFn fn ; void * user_data ; } MyTimerCreateBox ;
830830static void my_timer_create_trampoline (int ret , const char * msg , size_t len , void * ud ) {
831831 MyTimerCreateBox * box = (MyTimerCreateBox * )ud ;
832+ /* Non-terminal progress ping: keep the box for the terminal reply. */
833+ if (ret == NIMFFI_RET_STALE_WARN ) return ;
832834 if (!box -> fn ) {
833835 free (box );
834836 return ;
@@ -940,6 +942,8 @@ typedef void (*MyTimerEchoReplyFn)(int err_code, const EchoResponse* reply, cons
940942typedef struct { MyTimerEchoReplyFn fn ; void * user_data ; } MyTimerEchoCallBox ;
941943static void my_timer_echo_reply_trampoline (int ret , const char * msg , size_t len , void * ud ) {
942944 MyTimerEchoCallBox * box = (MyTimerEchoCallBox * )ud ;
945+ /* Non-terminal progress ping: keep the box for the terminal reply. */
946+ if (ret == NIMFFI_RET_STALE_WARN ) return ;
943947 if (!box -> fn ) {
944948 free (box );
945949 return ;
@@ -1000,6 +1004,8 @@ typedef void (*MyTimerVersionReplyFn)(int err_code, const NimFfiStr* reply, cons
10001004typedef struct { MyTimerVersionReplyFn fn ; void * user_data ; } MyTimerVersionCallBox ;
10011005static void my_timer_version_reply_trampoline (int ret , const char * msg , size_t len , void * ud ) {
10021006 MyTimerVersionCallBox * box = (MyTimerVersionCallBox * )ud ;
1007+ /* Non-terminal progress ping: keep the box for the terminal reply. */
1008+ if (ret == NIMFFI_RET_STALE_WARN ) return ;
10031009 if (!box -> fn ) {
10041010 free (box );
10051011 return ;
@@ -1059,6 +1065,8 @@ typedef void (*MyTimerComplexReplyFn)(int err_code, const ComplexResponse* reply
10591065typedef struct { MyTimerComplexReplyFn fn ; void * user_data ; } MyTimerComplexCallBox ;
10601066static void my_timer_complex_reply_trampoline (int ret , const char * msg , size_t len , void * ud ) {
10611067 MyTimerComplexCallBox * box = (MyTimerComplexCallBox * )ud ;
1068+ /* Non-terminal progress ping: keep the box for the terminal reply. */
1069+ if (ret == NIMFFI_RET_STALE_WARN ) return ;
10621070 if (!box -> fn ) {
10631071 free (box );
10641072 return ;
@@ -1119,6 +1127,8 @@ typedef void (*MyTimerScheduleReplyFn)(int err_code, const ScheduleResult* reply
11191127typedef struct { MyTimerScheduleReplyFn fn ; void * user_data ; } MyTimerScheduleCallBox ;
11201128static void my_timer_schedule_reply_trampoline (int ret , const char * msg , size_t len , void * ud ) {
11211129 MyTimerScheduleCallBox * box = (MyTimerScheduleCallBox * )ud ;
1130+ /* Non-terminal progress ping: keep the box for the terminal reply. */
1131+ if (ret == NIMFFI_RET_STALE_WARN ) return ;
11221132 if (!box -> fn ) {
11231133 free (box );
11241134 return ;
0 commit comments