Commit cfea59ca authored by Grigorii Demidov's avatar Grigorii Demidov Committed by Petr Špaček

daemon: avoid memory leaks under heavy load when using tls over outgoing tcp connection

parent 4486595b
......@@ -1041,12 +1041,14 @@ int tls_client_set_hs_state(struct tls_client_ctx_t *ctx, tls_client_hs_state_t
}
int tls_client_ctx_set_params(struct tls_client_ctx_t *ctx,
const struct tls_client_paramlist_entry *entry)
const struct tls_client_paramlist_entry *entry,
struct session *session)
{
if (!ctx) {
return kr_error(EINVAL);
}
ctx->params = entry;
ctx->session = session;
return kr_ok();
}
......
......@@ -115,4 +115,5 @@ tls_client_hs_state_t tls_client_get_hs_state(const struct tls_client_ctx_t *ctx
int tls_client_set_hs_state(struct tls_client_ctx_t *ctx, tls_client_hs_state_t state);
int tls_client_ctx_set_params(struct tls_client_ctx_t *ctx,
const struct tls_client_paramlist_entry *entry);
const struct tls_client_paramlist_entry *entry,
struct session *session);
......@@ -1627,7 +1627,7 @@ static int qr_task_step(struct qr_task *task,
subreq_finalize(task, packet_source, packet);
return qr_task_step(task, NULL, NULL);
}
tls_client_ctx_set_params(tls_ctx, entry);
tls_client_ctx_set_params(tls_ctx, entry, session);
session->tls_client_ctx = tls_ctx;
session->has_tls = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment