1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

gcoap: drop duplicate context field from coap_request_ctx_t

This commit is contained in:
Benjamin Valentin 2022-09-02 13:43:13 +02:00
parent f068fbccb6
commit 1552267d19
3 changed files with 1 additions and 5 deletions

View File

@ -709,7 +709,6 @@ static size_t _handle_req(gcoap_socket_t *sock, coap_pkt_t *pdu, uint8_t *buf,
coap_request_ctx_t ctx = {
.resource = resource,
.context = resource->context,
.tl_type = (uint32_t)sock->type,
.remote = remote,
};

View File

@ -463,7 +463,6 @@ ssize_t coap_tree_handler(coap_pkt_t *pkt, uint8_t *resp_buf,
else {
coap_request_ctx_t ctx = {
.resource = resource,
.context = resource->context,
};
return resource->handler(pkt, resp_buf, resp_buf_len, &ctx);
}
@ -1244,7 +1243,7 @@ const char *coap_request_ctx_get_path(const coap_request_ctx_t *ctx)
void *coap_request_ctx_get_context(const coap_request_ctx_t *ctx)
{
return ctx->context;
return ctx->resource->context;
}
uint32_t coap_request_ctx_get_tl_type(const coap_request_ctx_t *ctx)

View File

@ -35,8 +35,6 @@ extern "C" {
*/
struct _coap_request_ctx {
const coap_resource_t *resource; /**< resource of the request */
void *context; /**< request context, needed to supply
the remote for the forward proxy */
#if defined(MODULE_GCOAP) || DOXYGEN
/**
* @brief transport the packet was received over