diff --git a/include/coap/mem.h b/include/coap/mem.h index 64a3efbe..27f49ae2 100644 --- a/include/coap/mem.h +++ b/include/coap/mem.h @@ -38,7 +38,10 @@ typedef enum { COAP_PDU_BUF, COAP_RESOURCE, COAP_RESOURCEATTR, - COAP_SESSION +#ifdef HAVE_LIBTINYDTLS + COAP_DTLS_SESSION, +#endif + COAP_SESSION, } coap_memory_tag_t; #ifndef WITH_LWIP diff --git a/include/coap/pdu.h b/include/coap/pdu.h index 36293755..7bf7e351 100644 --- a/include/coap/pdu.h +++ b/include/coap/pdu.h @@ -17,6 +17,8 @@ #include "uri.h" +struct coap_session_t; + #ifdef WITH_LWIP #include #endif diff --git a/src/coap_io.c b/src/coap_io.c index 8fc65fe1..3bc6f93c 100644 --- a/src/coap_io.c +++ b/src/coap_io.c @@ -500,7 +500,7 @@ coap_network_read(coap_socket_t *sock, coap_packet_t *packet) { #ifdef _WIN32 len = recv(sock->fd, (char *)packet->payload, COAP_RXBUFFER_SIZE, 0); #else - len = recv(sock->fd, (*packet)->payload, coap_get_max_packetlength(*packet), 0); + len = recv(sock->fd, packet->payload, COAP_RXBUFFER_SIZE, 0); #endif if (len < 0) { #ifdef _WIN32