From 89b79eab607f81614dd35b41d3058a51e02ab1c6 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Fri, 7 Sep 2018 15:19:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dssl=5Fstream=5Fnew=E4=B8=AD?= =?UTF-8?q?=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84getpeername=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E7=94=B1=E6=AD=A4=E9=80=A0=E6=88=90=E7=9A=84=E5=86=99?= =?UTF-8?q?=E8=B6=8A=E7=95=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/tfe_future.cpp | 2 +- platform/src/ssl_stream.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/common/src/tfe_future.cpp b/common/src/tfe_future.cpp index 51a7318..1a15624 100644 --- a/common/src/tfe_future.cpp +++ b/common/src/tfe_future.cpp @@ -156,7 +156,7 @@ void future_destroy(struct future * f) struct promise * p = future_to_promise(f); if (p->cb_ctx_destroy != NULL) { - p->cb_ctx_destroy(p); + p->cb_ctx_destroy(p->ctx); } FS_operate(g_FP_instance.fs_handle,g_FP_instance.fsid_f_num, 0, FS_OP_SUB, 1); memset(p, 0, sizeof(struct promise)); diff --git a/platform/src/ssl_stream.cpp b/platform/src/ssl_stream.cpp index 986e0af..6e81a55 100644 --- a/platform/src/ssl_stream.cpp +++ b/platform/src/ssl_stream.cpp @@ -234,14 +234,12 @@ void ssl_free_chello(struct ssl_chello * p) struct ssl_stream * ssl_stream_new(struct ssl_mgr * mgr, evutil_socket_t fd, enum tfe_conn_dir dir, struct ssl_chello * client_hello, struct keyring * kyr) { - struct sockaddr addr; - socklen_t addrlen; + int ret = 0; struct ssl_stream * s_stream = ALLOC(struct ssl_stream, 1); s_stream->dir = dir; s_stream->mgr = mgr; s_stream->_do_not_use.fd = fd; - ret = getpeername(fd, &addr, &addrlen); assert(ret == 0); switch (dir) {