diff --git a/sys/net/application_layer/gcoap/forward_proxy.c b/sys/net/application_layer/gcoap/forward_proxy.c index 5beb915670..d7aad7c590 100644 --- a/sys/net/application_layer/gcoap/forward_proxy.c +++ b/sys/net/application_layer/gcoap/forward_proxy.c @@ -102,7 +102,7 @@ static ssize_t _forward_proxy_handler(coap_pkt_t *pdu, uint8_t *buf, size_t len, coap_request_ctx_t *ctx) { int pdu_len; - sock_udp_ep_t *remote = coap_request_ctx_get_context(ctx); + sock_udp_ep_t *remote = coap_request_ctx_get_remote_udp(ctx); pdu_len = gcoap_forward_proxy_request_process(pdu, remote); diff --git a/sys/net/application_layer/gcoap/gcoap.c b/sys/net/application_layer/gcoap/gcoap.c index 6550ece755..7c52160abf 100644 --- a/sys/net/application_layer/gcoap/gcoap.c +++ b/sys/net/application_layer/gcoap/gcoap.c @@ -706,21 +706,14 @@ static size_t _handle_req(gcoap_socket_t *sock, coap_pkt_t *pdu, uint8_t *buf, } ssize_t pdu_len; - char *offset; coap_request_ctx_t ctx = { .resource = resource, + .context = resource->context, .tl_type = (uint32_t)sock->type, .remote = remote, }; - if (coap_get_proxy_uri(pdu, &offset) > 0) { - ctx.context = remote; - } - else { - ctx.context = resource->context; - } - pdu_len = resource->handler(pdu, buf, len, &ctx); if (pdu_len < 0) { pdu_len = gcoap_response(pdu, buf, len,