Close #80 创建ssl upstream发生在KNI accept线程,event_add后又通过promise_set_ctx修改了callback para,此时tfe work thread调用了peek client hello,导致取出空的ctx。
This commit is contained in:
1
cache/src/tango_cache_pending.cpp
vendored
1
cache/src/tango_cache_pending.cpp
vendored
@@ -150,6 +150,7 @@ time_t read_GMT_time(const char* gmt_string)
|
|||||||
{
|
{
|
||||||
time_t expire_rel_time;
|
time_t expire_rel_time;
|
||||||
struct tm expire_gmt_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);
|
strptime(gmt_string, "%a, %d %b %Y %H:%M:%S GMT", &expire_gmt_time);
|
||||||
expire_rel_time = mktime(&expire_gmt_time);
|
expire_rel_time = mktime(&expire_gmt_time);
|
||||||
return expire_rel_time;
|
return expire_rel_time;
|
||||||
|
|||||||
@@ -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);
|
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->ev = event_new(evbase, fd, EV_READ, peek_client_hello_cb, p);
|
||||||
ctx->logger = logger;
|
ctx->logger = logger;
|
||||||
event_add(ctx->ev, NULL);
|
|
||||||
promise_set_ctx(p, (void *) ctx, peek_client_hello_ctx_free_cb);
|
promise_set_ctx(p, (void *) ctx, peek_client_hello_ctx_free_cb);
|
||||||
|
event_add(ctx->ev, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user