1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gcoap/forward_proxy: set payload length in forwarded PDU

This commit is contained in:
Fabian Hüßler 2024-05-28 16:26:35 +02:00
parent c12375eec4
commit f50dd7dade

View File

@ -400,6 +400,7 @@ static int _gcoap_forward_proxy_copy_options(coap_pkt_t *pkt,
/* copy payload from client_pkt to pkt */
memcpy(pkt->payload, client_pkt->payload, client_pkt->payload_len);
pkt->payload_len = client_pkt->payload_len;
len += client_pkt->payload_len;
return len;
@ -460,7 +461,7 @@ static int _gcoap_forward_proxy_via_coap(coap_pkt_t *client_pkt,
/* copy all options from client_pkt to pkt */
len = _gcoap_forward_proxy_copy_options(&client_ep->pdu, client_pkt, client_ep, urip);
if (len == -EINVAL) {
if (len < 0) {
_free_client_ep(client_ep);
return -EINVAL;
}