From 2ed64875968ec722a5c8e669c01b1def7a46c13e Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 25 Jul 2023 23:16:44 +0800 Subject: [PATCH] ses topo --- ses_step_topo.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/ses_step_topo.c b/ses_step_topo.c index cc0e5fd..a26dfb3 100644 --- a/ses_step_topo.c +++ b/ses_step_topo.c @@ -168,10 +168,33 @@ static int _topo_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t* scf_logw("i: %ld\n", i); - __dfs_path(f, c, p, ctx, &path); + int ret = __dfs_path(f, c, p, ctx, &path); + if (ret < 0) + return ret; - printf("\n"); + printf("ret: %d\n\n", ret); + + if (!path) + continue; + + if (ret > 0) { + scf_vector_clear(path, NULL); + continue; + } + + if (scf_vector_add(ctx->paths, path) < 0) { + scf_vector_free(path); + return -ENOMEM; + } + + path = NULL; } + + if (path) { + scf_vector_free(path); + path = NULL; + } + #if 1 for (i = 0; i < ctx->paths->size; i++) { path = ctx->paths->data[i]; -- 2.25.1