修正当ssl在以peek方式解析clienthello并返回not_enough_buff时,没有传入ev_base导致的连接建立失败的问题。

This commit is contained in:
luqiuwen
2019-05-21 17:15:05 +08:00
parent 1a45ea858c
commit 3dfe680a76

View File

@@ -764,7 +764,7 @@ static void peek_client_hello_cb(evutil_socket_t fd, short what, void * arg)
peek_client_hello_ctx_free(ctx);
break;
}
case CHELLO_PARSE_NOT_ENOUGH_BUFF:
case CHELLO_PARSE_NOT_ENOUGH_BUFF:
{
ssl_chello_free(chello);
chello=NULL;
@@ -819,6 +819,8 @@ static void ssl_async_peek_client_hello(struct future * f, evutil_socket_t fd, s
struct promise * p = future_to_promise(f);
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->evbase = evbase;
ctx->parse_client_cipher=parse_cipher;
ctx->logger = logger;
promise_set_ctx(p, (void *) ctx, peek_client_hello_ctx_free_cb);
event_add(ctx->ev, NULL);