diff options
author | Uros Majstorovic <majstor@majstor.org> | 2024-05-16 01:44:50 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2024-05-16 01:44:50 +0200 |
commit | 7f06f7fb26ee52547d30b620a4137bca0395da6d (patch) | |
tree | 43a6bee535afcef99f6ed9c35cc5ce5f927dfd47 /ecp/src/platform/fe310 | |
parent | e870fe53f71c88c636b7c4aadd5655c0fe15bde3 (diff) |
open handler moved to the end of open message; conn authenticator has access to remainder of open req msg; improved logging and error handling; removed extensions
Diffstat (limited to 'ecp/src/platform/fe310')
-rw-r--r-- | ecp/src/platform/fe310/features_tmpl.mk | 1 | ||||
-rw-r--r-- | ecp/src/platform/fe310/transport.c | 11 |
2 files changed, 6 insertions, 6 deletions
diff --git a/ecp/src/platform/fe310/features_tmpl.mk b/ecp/src/platform/fe310/features_tmpl.mk index 39f95cf..54f777c 100644 --- a/ecp/src/platform/fe310/features_tmpl.mk +++ b/ecp/src/platform/fe310/features_tmpl.mk @@ -1,3 +1,2 @@ with_vconn = yes with_dir = yes -with_debug = yes diff --git a/ecp/src/platform/fe310/transport.c b/ecp/src/platform/fe310/transport.c index 35addfa..b53534d 100644 --- a/ecp/src/platform/fe310/transport.c +++ b/ecp/src/platform/fe310/transport.c @@ -1,6 +1,5 @@ #include <stdlib.h> #include <string.h> -#include <stdio.h> #include <ecp/core.h> #include <ecp/tr.h> @@ -12,6 +11,7 @@ ECPSocket *_ecp_tr_sock = NULL; unsigned char pld_buf[ECP_MAX_PLD]; static void packet_handler(unsigned char type, unsigned char *buffer, uint16_t len) { + ECPContext *ctx; ECP2Buffer bufs; ECPBuffer packet; ECPBuffer payload; @@ -33,12 +33,13 @@ static void packet_handler(unsigned char type, unsigned char *buffer, uint16_t l eos_sock_recvfrom(buffer, len, NULL, 0, &addr); + ctx = _ecp_tr_sock->ctx; rv = ecp_pkt_handle(_ecp_tr_sock, NULL, &addr, &bufs, len-EOS_SOCK_SIZE_UDP_HDR); -#ifdef ECP_DEBUG - if (rv < 0) { - printf("RCV ERR:%d\n", rv); + if ((rv < 0) && ctx->logger) { + int _rv = rv; + + ctx->logger("packet_handler: err:%d\n", _rv); } -#endif if (bufs.packet->buffer) { eos_net_free(buffer, 0); } else { |