diff --git a/core/offload.c b/core/offload.c index 08449b18..ea316d4c 100644 --- a/core/offload.c +++ b/core/offload.c @@ -159,6 +159,12 @@ static int u_offload_sendfile_prepare(struct wsgi_request *wsgi_req, struct uwsg } static void uwsgi_offload_close(struct uwsgi_thread *ut, struct uwsgi_offload_request *uor) { + + // call the free function asap + if (uor->free) { + uor->free(uor); + } + // close the socket and the file descriptor if (uor->takeover && uor->s > -1) { close(uor->s); diff --git a/uwsgi.h b/uwsgi.h index b224a183..f965bfef 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -4334,6 +4334,9 @@ struct uwsgi_offload_request { int64_t custom6; int64_t custom7; int64_t custom8; + + void *data; + void (*free)(struct uwsgi_offload_request *); }; struct uwsgi_offload_engine {