Re: internal redirect and module context

2022-01-22 Thread Dk Jack
That is exactly what I needed. Thank you. Dk. On Sat, Jan 22, 2022 at 11:08 AM Maxim Dounin wrote: > Hello! > > On Sat, Jan 22, 2022 at 02:19:05AM -0800, Dk Jack wrote: > > > Maxim, > > Thanks for responding to my query. I am passing the original context > > pointer to the clean up handler.

Re: internal redirect and module context

2022-01-22 Thread Maxim Dounin
Hello! On Sat, Jan 22, 2022 at 02:19:05AM -0800, Dk Jack wrote: > Maxim, > Thanks for responding to my query. I am passing the original context > pointer to the clean up handler. When my cleanup handler is called I am > retrieving the context pointer to clean up external resources. Based on >

Re: internal redirect and module context

2022-01-22 Thread Dk Jack
l_redirect() clears the r->ctx[] array of pointers: /* clear the modules contexts */ ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); That is, the actual memory you've used for your module context will be intact, but the pointer you've saved into request with ngx_http_set_mo

Re: internal redirect and module context

2022-01-21 Thread Maxim Dounin
redirect looks something like this: > > ngx_http_internal_redirect(r, _uri, >args); > ngx_http_finalize_request(r, NGX_DONE); > > According to the documentation > http://nginx.org/en/docs/dev/development_guide.html#http_request_redirection > > it says, on calling internal_redirect, the module c

internal redirect and module context

2022-01-21 Thread Dk Jack
Hi, I have a question related to internal redirect, I am hoping someone from this forum can clarify. The email is a bit long since I wanted to provide enough background for my situation. In my module, I am creating my module context and saving some state. Some of this state is allocated using

module context.

2020-08-18 Thread Dk Jack
Hi, I have a module. I am saving some data in my module context. However, in certain cases, I am doing an internal redirect. When I do an internal redirect my context is cleared as per the nginx development guide. Is there a way to save the context data. Since this data is specific to the request