diff options
Diffstat (limited to 'code/fe310/eos/ecp.c')
-rw-r--r-- | code/fe310/eos/ecp.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/code/fe310/eos/ecp.c b/code/fe310/eos/ecp.c index 9301555..61f834a 100644 --- a/code/fe310/eos/ecp.c +++ b/code/fe310/eos/ecp.c @@ -1,5 +1,6 @@ #include <stddef.h> #include <string.h> +#include <stdlib.h> #include "encoding.h" #include "platform.h" @@ -40,7 +41,14 @@ static void packet_handler(unsigned char cmd, unsigned char *buffer, uint16_t le memcpy(addr.host, buffer, sizeof(addr.host)); memcpy(&addr.port, buffer+sizeof(addr.host), sizeof(addr.port)); ssize_t rv = ecp_pkt_handle(_sock, &addr, NULL, &bufs, len-addr_len); - if (rv < 0) DPRINT(rv, "ERR:packet_handler - RV:%d\n", rv); +#ifdef ECP_DEBUG + if (rv < 0) { + char b[16]; + puts("ERR:"); + puts(itoa(rv, b, 10)); + puts("\n"); + } +#endif if (bufs.packet->buffer) eos_net_free(buffer, 0); eos_net_release(0); } |