diff options
| author | zhengchao <[email protected]> | 2018-09-05 19:49:37 +0800 |
|---|---|---|
| committer | zhengchao <[email protected]> | 2018-09-05 19:49:37 +0800 |
| commit | 6bc04097563dcdbe6442666e99de26ab9b69526f (patch) | |
| tree | a568a495ba6e76136f489bd57d3d2a80cb9fffc8 /platform/src/proxy.cpp | |
| parent | bec5631a7de2aceb9355849cb947ed22b6710f0e (diff) | |
修复ssl session缓存中对openssl的不正确使用。
Diffstat (limited to 'platform/src/proxy.cpp')
| -rw-r--r-- | platform/src/proxy.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index 74c0c6f..ff9f4b4 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -111,7 +111,6 @@ static void __signal_handler_cb(evutil_socket_t fd, short what, void * arg) { case SIGTERM: case SIGQUIT: - case SIGINT: case SIGHUP: break; case SIGUSR1: @@ -127,9 +126,11 @@ static void __signal_handler_cb(evutil_socket_t fd, short what, void * arg) static void __gc_handler_cb(evutil_socket_t fd, short what, void * arg) { - tfe_proxy * ctx = (tfe_proxy *) arg; +/* tfe_proxy * ctx = (tfe_proxy *) arg; (void)fd; (void)what; + */ + return; } static void * __thread_ctx_entry(void * arg) @@ -166,7 +167,7 @@ struct tfe_thread_ctx * __thread_ctx_create(struct tfe_proxy * proxy, unsigned i int ret = pthread_create(&__thread_ctx->thr, NULL, __thread_ctx_entry, (void *)__thread_ctx); if (unlikely(ret < 0)) { - TFE_LOG_ERROR(proxy->logger, "Failed at pthread_create() for thread %d: %s", strerror(errno)); + TFE_LOG_ERROR(proxy->logger, "Failed at pthread_create() for thread %d: %s",errno, strerror(errno)); goto __errout; } @@ -229,6 +230,13 @@ int main(int argc, char *argv[]) g_default_proxy->kni_acceptor_handler = kni_acceptor_init(g_default_proxy, main_profile, g_default_logger); CHECK_OR_EXIT(g_default_proxy->kni_acceptor_handler, "Failed at init KNI acceptor. Exit. "); + for (size_t i = 0; i < (sizeof(signals) / sizeof(int)); i++) + { + g_default_proxy->sev[i] = evsignal_new(g_default_proxy->evbase, signals[i], __signal_handler_cb, g_default_proxy); + CHECK_OR_EXIT( g_default_proxy->sev[i], "Failed at create signal event. Exit."); + evsignal_add(g_default_proxy->sev[i], NULL); + } + struct timeval gc_delay = {60, 0}; evtimer_add(g_default_proxy->gcev , &gc_delay); |
