diff options
| author | zhengchao <[email protected]> | 2018-10-21 15:03:04 +0800 |
|---|---|---|
| committer | zhengchao <[email protected]> | 2018-10-21 15:03:04 +0800 |
| commit | c5f5ee26557ac29f785ff6404cc30226a3524e97 (patch) | |
| tree | 64516abee2f15d8a8c6d816b7f176f860c9c34ad /platform/src/proxy.cpp | |
| parent | c94b267a6591e0618dd57b18de52dd86c505aa41 (diff) | |
不cache包含Set-cookie的应答。修改多处日志细节。
Diffstat (limited to 'platform/src/proxy.cpp')
| -rw-r--r-- | platform/src/proxy.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index e76d315..4c9e084 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -4,6 +4,7 @@ #include <sys/types.h> #include <sys/socket.h> +#include <sys/prctl.h> #include <netinet/in.h> #include <sys/un.h> #include <assert.h> @@ -14,6 +15,7 @@ #include <errno.h> #include <pthread.h> + #include <event2/event.h> #include <event2/listener.h> #include <event2/bufferevent.h> @@ -135,6 +137,7 @@ void tfe_proxy_free(tfe_proxy * ctx) static void __dummy_event_handler(evutil_socket_t fd, short what, void * arg) { + printf("%s alive\n",__FUNCTION__); return; } @@ -172,7 +175,7 @@ static void __gc_handler_cb(evutil_socket_t fd, short what, void * arg) return; } -static void * __thread_ctx_entry(void * arg) +static void * tfe_work_thread(void * arg) { struct tfe_thread_ctx * ctx = (struct tfe_thread_ctx *) arg; struct timeval timer_delay = {60, 0}; @@ -187,11 +190,15 @@ static void * __thread_ctx_entry(void * arg) evtimer_add(ev, &timer_delay); ctx->running = 1; __currect_thread_id = ctx->thread_id; + char thread_name[16]; + snprintf(thread_name, sizeof(thread_name), "tfe:worker%d", ctx->thread_id); + prctl(PR_SET_NAME,(unsigned long long)thread_name,NULL,NULL,NULL); - TFE_LOG_INFO(g_default_logger, "Thread %u is running...", ctx->thread_id); + TFE_LOG_INFO(g_default_logger, "Work thread %u is running...", ctx->thread_id); event_base_dispatch(ctx->evbase); + assert(0); event_free(ev); - + TFE_LOG_ERROR(g_default_logger, "Work thread %u is exit...", ctx->thread_id); return (void *)NULL; } @@ -215,7 +222,7 @@ int tfe_proxy_work_thread_run(struct tfe_proxy * proxy) for(i=0; i<proxy->nr_work_threads;i++) { __thread_ctx=proxy->work_threads[i]; - ret = pthread_create(&__thread_ctx->thr, NULL, __thread_ctx_entry, (void *)__thread_ctx); + ret = pthread_create(&__thread_ctx->thr, NULL, tfe_work_thread, (void *)__thread_ctx); if (unlikely(ret < 0)) { TFE_LOG_ERROR(proxy->logger, "Failed at pthread_create() for thread %d, error %d: %s", i, errno, strerror(errno)); |
