From 7a0e44998f426752c58975ae686d8e88aa131195 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sat, 11 May 2024 15:58:48 +0200 Subject: added error handler per connection type; improved handlers API and error reporting --- ecp/server/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ecp/server/server.c') diff --git a/ecp/server/server.c b/ecp/server/server.c index 5493762..223c548 100644 --- a/ecp/server/server.c +++ b/ecp/server/server.c @@ -103,7 +103,7 @@ static void conn_free(ECPConnection *conn) { free(conn); } -static int key_check(ECPSocket *sock, ECPConnection *parent, unsigned char ctype, ecp_ecdh_public_t *public) { +static int conn_auth(ECPSocket *sock, ECPConnection *parent, unsigned char ctype, ecp_ecdh_public_t *public) { switch (ctype) { case CTYPE_DIR: { if (public == NULL) return 0; @@ -145,7 +145,7 @@ void log_print(int level, char *format, ...) { int ecp_init(ECPContext *ctx, ECPConnHandler *vconn_handler, ECPConnHandler *vlink_handler) { int rv; - rv = ecp_ctx_init(ctx, handle_err, conn_new, conn_free, key_check); + rv = ecp_ctx_init(ctx, conn_auth, conn_new, conn_free, handle_err); if (rv) return rv; rv = ecp_vconn_handler_init(ctx, vconn_handler); -- cgit v1.2.3