diff options
author | Uros Majstorovic <majstor@majstor.org> | 2024-05-11 16:10:25 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2024-05-11 16:10:25 +0200 |
commit | ca41e5b94a9bf6e8261cdf47081a9c5b002f8dbb (patch) | |
tree | 698c43a6c5b056840fe07040d3493a648d38a971 | |
parent | 7a0e44998f426752c58975ae686d8e88aa131195 (diff) |
fixed transport error reporting
-rw-r--r-- | ecp/src/ecp/core.c | 13 |
1 files changed, 3 insertions, 10 deletions
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; } |