From 4d4d401b2bec18b3a0c6612c9f46536f08ec21a5 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Wed, 14 Nov 2018 16:01:48 +0800 Subject: [PATCH] =?UTF-8?q?Close=20#80=20=E5=88=9B=E5=BB=BAssl=20upstream?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E5=9C=A8KNI=20accept=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=EF=BC=8Cevent=5Fadd=E5=90=8E=E5=8F=88=E9=80=9A=E8=BF=87promise?= =?UTF-8?q?=5Fset=5Fctx=E4=BF=AE=E6=94=B9=E4=BA=86callback=20para=EF=BC=8C?= =?UTF-8?q?=E6=AD=A4=E6=97=B6tfe=20work=20thread=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E4=BA=86peek=20client=20hello=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=8F=96=E5=87=BA=E7=A9=BA=E7=9A=84ctx=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cache/src/tango_cache_pending.cpp | 1 + platform/src/ssl_stream.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cache/src/tango_cache_pending.cpp b/cache/src/tango_cache_pending.cpp index ab9b69b..9434bbe 100644 --- a/cache/src/tango_cache_pending.cpp +++ b/cache/src/tango_cache_pending.cpp @@ -150,6 +150,7 @@ time_t read_GMT_time(const char* gmt_string) { time_t expire_rel_time; struct tm expire_gmt_time; + memset(&expire_gmt_time, 0, sizeof(expire_gmt_time)); strptime(gmt_string, "%a, %d %b %Y %H:%M:%S GMT", &expire_gmt_time); expire_rel_time = mktime(&expire_gmt_time); return expire_rel_time; diff --git a/platform/src/ssl_stream.cpp b/platform/src/ssl_stream.cpp index 62e271a..33b18ee 100644 --- a/platform/src/ssl_stream.cpp +++ b/platform/src/ssl_stream.cpp @@ -715,8 +715,8 @@ static void ssl_async_peek_client_hello(struct future * future, evutil_socket_t struct peek_client_hello_ctx * ctx = ALLOC(struct peek_client_hello_ctx, 1); ctx->ev = event_new(evbase, fd, EV_READ, peek_client_hello_cb, p); ctx->logger = logger; - event_add(ctx->ev, NULL); promise_set_ctx(p, (void *) ctx, peek_client_hello_ctx_free_cb); + event_add(ctx->ev, NULL); return; }