summaryrefslogtreecommitdiff
path: root/ecp/src/platform
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2024-05-16 01:44:50 +0200
committerUros Majstorovic <majstor@majstor.org>2024-05-16 01:44:50 +0200
commit7f06f7fb26ee52547d30b620a4137bca0395da6d (patch)
tree43a6bee535afcef99f6ed9c35cc5ce5f927dfd47 /ecp/src/platform
parente870fe53f71c88c636b7c4aadd5655c0fe15bde3 (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')
-rw-r--r--ecp/src/platform/fe310/features_tmpl.mk1
-rw-r--r--ecp/src/platform/fe310/transport.c11
-rw-r--r--ecp/src/platform/posix/features_tmpl.mk3
3 files changed, 6 insertions, 9 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 {
diff --git a/ecp/src/platform/posix/features_tmpl.mk b/ecp/src/platform/posix/features_tmpl.mk
index a840328..2887e08 100644
--- a/ecp/src/platform/posix/features_tmpl.mk
+++ b/ecp/src/platform/posix/features_tmpl.mk
@@ -2,6 +2,3 @@ with_pthread = yes
with_htable = yes
with_vconn = yes
with_dir = yes
-with_debug = yes
-#with_rbuf = yes
-#with_msgq = yes