From ca41e5b94a9bf6e8261cdf47081a9c5b002f8dbb Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sat, 11 May 2024 16:10:25 +0200 Subject: fixed transport error reporting --- ecp/src/ecp/core.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'ecp/src') diff --git a/ecp/src/ecp/core.c b/ecp/src/ecp/core.c index 3063fd2..d666d32 100644 --- a/ecp/src/ecp/core.c +++ b/ecp/src/ecp/core.c @@ -75,13 +75,10 @@ ECPConnHandler *ecp_ctx_get_handler(ECPContext *ctx, unsigned char ctype) { } int ecp_addr_init(ecp_tr_addr_t *addr, void *addr_s) { - int rv = ECP_OK; + int rv; memset(addr, 0, sizeof(ecp_tr_addr_t)); - if (addr_s) { - rv = ecp_tr_addr_set(addr, addr_s); - } - + rv = ecp_tr_addr_set(addr, addr_s); return rv; } @@ -111,9 +108,7 @@ int ecp_node_set_addr(ECPNode *node, void *addr) { int rv; rv = ecp_tr_addr_set(&node->addr, addr); - if (rv) return ECP_ERR_ADDR; - - return ECP_OK; + return rv; } static int conn_table_create(ECPConnTable *conn_table) { @@ -2702,8 +2697,6 @@ ssize_t ecp_pkt_send(ECPSocket *sock, ECPBuffer *packet, size_t pkt_size, unsign } rv = ecp_tr_send(sock, packet, pkt_size, addr, flags); - if (rv < 0) return rv; - return rv; } -- cgit v1.2.3