diff --git a/plugin/business/pangu-http/src/pangu_http.cpp b/plugin/business/pangu-http/src/pangu_http.cpp index 26e7cad..177e8d5 100644 --- a/plugin/business/pangu-http/src/pangu_http.cpp +++ b/plugin/business/pangu-http/src/pangu_http.cpp @@ -462,8 +462,12 @@ void http_repl_ctx_free(struct replace_ctx* rep_ctx) evbuffer_free(rep_ctx->http_body); rep_ctx->http_body = NULL; } - //todo destroy http_half; - assert(rep_ctx->replacing == NULL); + //On session recycled. + if(rep_ctx->replacing) + { + tfe_http_half_free(rep_ctx->replacing); + rep_ctx->replacing=NULL; + } FREE(&rep_ctx); return; } @@ -499,13 +503,30 @@ static void pangu_http_ctx_free(struct pangu_http_ctx * ctx) web_cache_update_end(ctx->cache_update_ctx); ctx->cache_update_ctx=NULL; } - assert(ctx->cached_response==NULL); + + //On session recycle + if(ctx->cache_revalidate_req) + { + tfe_http_half_free(ctx->cache_revalidate_req); + ctx->cache_revalidate_req=NULL; + } + if(ctx->cached_response) + { + tfe_http_half_free(ctx->cached_response); + ctx->cached_response=NULL; + } if(ctx->f_cache_query) { future_destroy(ctx->f_cache_query); ctx->f_cache_query=NULL; } + if(ctx->f_cache_pending) + { + future_destroy(ctx->f_cache_pending); + ctx->f_cache_pending=NULL; + } + ctx->magic_num=0; FREE(&ctx); }