Merge pull request #350 from lewixliu/develop

Fixed two minor bugs in endpoint free and session address update
This commit is contained in:
obgm authored and GitHub committed 2019-06-28 17:11:41 +02:00
commit 27eec0c1c5
6 files changed
+5 -11

No files matched your search

-3
View File
@@ -164,9 +164,6 @@ void coap_packet_get_memmapped(struct coap_packet_t *packet,
unsigned char **address,
size_t *length);
void coap_packet_set_addr( struct coap_packet_t *packet, const coap_address_t *src,
const coap_address_t *dst );
#ifdef WITH_LWIP
/**
* Get the pbuf of a packet. The caller takes over responsibility for freeing
-1
View File
@@ -112,7 +112,6 @@ global:
coap_package_name;
coap_package_version;
coap_packet_get_memmapped;
coap_packet_set_addr;
coap_pdu_clear;
coap_pdu_encode_header;
coap_pdu_init;
-1
View File
@@ -110,7 +110,6 @@ coap_opt_value
coap_package_name
coap_package_version
coap_packet_get_memmapped
coap_packet_set_addr
coap_pdu_clear
coap_pdu_encode_header
coap_pdu_init
-5
View File
@@ -919,11 +919,6 @@ coap_packet_get_memmapped(coap_packet_t *packet, unsigned char **address, size_t
*length = packet->length;
}
void coap_packet_set_addr(coap_packet_t *packet, const coap_address_t *src, const coap_address_t *dst) {
coap_address_copy(&packet->src, src);
coap_address_copy(&packet->dst, dst);
}
ssize_t
coap_network_read(coap_socket_t *sock, coap_packet_t *packet) {
ssize_t len = -1;
+3
View File
@@ -949,6 +949,9 @@ coap_free_endpoint(coap_endpoint_t *ep) {
}
}
if (ep->context) {
LL_DELETE(ep->context->endpoint, ep);
}
coap_mfree_endpoint(ep);
}
}
+2 -1
View File
@@ -1144,7 +1144,8 @@ coap_read_session(coap_context_t *ctx, coap_session_t *session, coap_tick_t now)
coap_log(LOG_DEBUG, "* %s: received %zd bytes\n",
coap_session_str(session), bytes_read);
session->last_rx_tx = now;
coap_packet_set_addr(packet, &session->remote_addr, &session->local_addr);
coap_address_copy(&session->remote_addr, &packet->src);
coap_address_copy(&session->local_addr, &packet->dst);
coap_handle_dgram_for_proto(ctx, session, packet);
}
} else {