From 57f5a4d906ff973409ef90fa1ae53fb071d9f410 Mon Sep 17 00:00:00 2001 From: luqiuwen Date: Sun, 2 Jun 2019 16:29:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0sender=5Fscm=E7=9A=84?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/include/internal/proxy.h | 2 ++ platform/include/internal/sender_scm.h | 3 ++- platform/src/proxy.cpp | 4 ++++ platform/test/test_sender_scm.cpp | 7 +++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/platform/include/internal/proxy.h b/platform/include/internal/proxy.h index c3db0f9..02c3a56 100644 --- a/platform/include/internal/proxy.h +++ b/platform/include/internal/proxy.h @@ -2,6 +2,7 @@ #include #include +#include #include struct ssl_mgr; @@ -99,6 +100,7 @@ struct tfe_proxy struct acceptor_kni_v1 * kni_v1_acceptor; struct acceptor_kni_v2 * kni_v2_acceptor; + struct sender_scm * scm_sender; /* DEBUG OPTIONS */ unsigned int tcp_all_passthrough; diff --git a/platform/include/internal/sender_scm.h b/platform/include/internal/sender_scm.h index b773059..94f9ab1 100644 --- a/platform/include/internal/sender_scm.h +++ b/platform/include/internal/sender_scm.h @@ -1,4 +1,5 @@ +#pragma once + struct sender_scm; -struct sender_scm* sender_scm_init(const char *profile, void *logger); void send_scm_destroy(struct sender_scm *sender); struct sender_scm* sender_scm_init(const char *profile, const char *section, void *logger); diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index fe605ae..46ddc97 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -435,6 +435,10 @@ int main(int argc, char * argv[]) tfe_proxy_work_thread_create_ctx(g_default_proxy); tfe_proxy_acceptor_init(g_default_proxy, main_profile); + /* SCM Sender */ + g_default_proxy->scm_sender = sender_scm_init(main_profile, "sender_scm", g_default_logger); + CHECK_OR_EXIT(g_default_proxy->scm_sender != NULL, "Failed at creating scm sender, Exit."); + /* PLUGIN INIT */ unsigned int plugin_iterator = 0; for (struct tfe_plugin * plugin_iter = tfe_plugin_iterate(&plugin_iterator); diff --git a/platform/test/test_sender_scm.cpp b/platform/test/test_sender_scm.cpp index 03da435..0a1a12e 100644 --- a/platform/test/test_sender_scm.cpp +++ b/platform/test/test_sender_scm.cpp @@ -3,6 +3,12 @@ #include "sender_scm.h" #include "tfe_cmsg.h" +int main() +{ + return 0; +} + +#if 0 int main(){ struct tfe_cmsg *cmsg = tfe_cmsg_init(); @@ -31,3 +37,4 @@ int main(){ } return 0; } +#endif