重构key keeper创建keyring的代码。修复除 #97 外的valgrind definitely lost。

This commit is contained in:
zhengchao
2018-11-29 19:02:07 +08:00
parent cc5420d158
commit a5ca97d91e
5 changed files with 36 additions and 103 deletions

View File

@@ -886,7 +886,6 @@ static void cache_query_obj_on_succ(future_result_t * result, void * user)
//last call.
ATOMIC_DEC(&(ctx->ref_handle->stat_val[STAT_CACHE_READING]));
promise_dettach_ctx(p);
promise_finish(p);
last_call=1;
break;
case RESULT_TYPE_BODY:
@@ -896,8 +895,11 @@ static void cache_query_obj_on_succ(future_result_t * result, void * user)
break;
}
promise_success(p, ctx);
if(last_call) cache_query_ctx_free_cb(ctx);
if(last_call)
{
cache_query_ctx_free_cb(ctx);
promise_finish(p);
}
return;
}
static void cache_query_obj_on_fail(enum e_future_error err, const char * what, void * user)

View File

@@ -801,7 +801,7 @@ struct http_half_private * hf_private_create(tfe_http_direction ht_dir, short ma
hf_private->hf_public.ops = &__http_half_ops;
/* PRIVATE */
hf_private->parse_object = (struct http_parser *) malloc(sizeof(struct http_parser));
hf_private->parse_object = ALLOC(struct http_parser, 1);
assert(hf_private->parse_object != NULL);
if (ht_dir == TFE_HTTP_REQUEST)