通过增加promise_finish函数,实现future的cancel。

This commit is contained in:
zhengchao
2018-11-23 20:15:01 +08:00
parent 6cd2b8186b
commit 5d20a52552
3 changed files with 54 additions and 10 deletions

View File

@@ -707,10 +707,10 @@ failed:
return;
}
static void ssl_async_peek_client_hello(struct future * future, evutil_socket_t fd, struct event_base * evbase,
static void ssl_async_peek_client_hello(struct future * f, evutil_socket_t fd, struct event_base * evbase,
void * logger)
{
struct promise * p = future_to_promise(future);
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->logger = logger;