From 770fc69429e6b61ca648b15816fd003819abe3e2 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sat, 12 Aug 2017 23:09:10 +0200 Subject: conn_close handler added --- code/core/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'code/core/core.c') diff --git a/code/core/core.c b/code/core/core.c index 069c910..a7ef3de 100644 --- a/code/core/core.c +++ b/code/core/core.c @@ -580,7 +580,10 @@ int ecp_conn_close(ECPConnection *conn, unsigned int timeout) { if (refcount) return ECP_ERR_TIMEOUT; #endif - if (!conn->out) { + if (conn->out) { + ecp_conn_close_t *handler = conn->sock->ctx->handler[conn->type] ? conn->sock->ctx->handler[conn->type]->conn_close : NULL; + if (handler) handler(conn); + } else { ecp_conn_destroy_t *handler = conn->sock->ctx->handler[conn->type] ? conn->sock->ctx->handler[conn->type]->conn_destroy : NULL; if (handler) handler(conn); if (conn->proxy) { -- cgit v1.2.3