ses_steps_analyse()
authoryu.dongliang <18588496441@163.com>
Tue, 31 Oct 2023 11:42:20 +0000 (19:42 +0800)
committeryu.dongliang <18588496441@163.com>
Tue, 31 Oct 2023 11:42:20 +0000 (19:42 +0800)
ses_core.h
ses_step_va.c
ses_step_va_bridge.c
ses_steps.c

index 6ebf8c56d0eea79722683e452920c8ef382b019e..69a49f9baa6dcbaba7ec27bc553de4903e8b07a3 100644 (file)
@@ -93,6 +93,8 @@ struct ses_path_s
 struct ses_ctx_s
 {
        scf_vector_t*  paths;
+
+       int            changed;
 };
 
 struct ses_step_s
index a9d20bd6f51e9995f43406e823c5c90278c94c52..6397362bf8bc4bd7eea2ce3ca278808382a12478 100644 (file)
@@ -277,7 +277,8 @@ static int _va_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t* ct
                printf("\n");
        }
 
-       return changed > 0 ? -EAGAIN : 0;
+       ctx->changed += changed;
+       return 0;
 }
 
 ses_step_t  ses_step_va =
index 886b81a667ad7ba0b3323060a98a84dfba2f4ce2..e603110c3ccdd43bb7586a11fa7977dc3b8381f3 100644 (file)
@@ -87,7 +87,8 @@ static int _va_bridge_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ct
                printf("\n");
        }
 
-       return changed > 0 ? -EAGAIN : 0;
+       ctx->changed += changed;
+       return 0;
 }
 
 ses_step_t  ses_step_va_bridge =
index bf53f4d546ab8a452c7fdfc5c0f0fae386e4be42..479cb00a3018f73b43581cf2d73cb7823f89b78f 100644 (file)
@@ -107,6 +107,8 @@ static int __ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t i, ses_ctx_t
 
        int64_t j;
 
+       ctx->changed = 0;
+
        for (j = 0; j < sizeof(ses_steps_1) / sizeof(ses_steps_1[0]); j++) {
                s  = ses_steps_1[j];
 
@@ -120,7 +122,7 @@ static int __ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t i, ses_ctx_t
                }
        }
 
-       return 0;
+       return ctx->changed > 0 ? -EAGAIN : 0;
 }
 
 int ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t count)