Welcome! Log In Create A New Profile

Advanced

Re: Subrequest without returning to nginx

Maxim Dounin
May 04, 2021 11:00AM
Hello!

On Tue, May 04, 2021 at 04:11:34PM +0200, Alfred Sawaya wrote:

> I am currently converting an Apache module to Nginx. This module uses
> subrequests and needs (for now) to execute the subrequest without
> unwinding the stack (ie without returning to nginx).
>
> I tried to call ngx_http_run_posted_requests by hand, but it does not
> work as the upstream socket needs to get polled some time.
>
> So I wonder, is there any way to do this ?

No. Since nginx is event-driven, you essentially cannot do
anything without returning control back to nginx to execute the
event loop.

> Of course I know that I shouldn't do it like this, but the current
> module is not reentrant and poorly architectured. I will eventually
> refactor it but later.

You may want to start with throwing away the module, and writing
another one for nginx from scratch. "Converting" rarely works
even for simple and well-written modules.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Subrequest without returning to nginx

Alfred Sawaya 293 May 04, 2021 10:12AM

Re: Subrequest without returning to nginx

Dipl. Ing. Sergey Brester 87 May 04, 2021 10:34AM

Re: Subrequest without returning to nginx

Alfred Sawaya 87 May 04, 2021 10:50AM

Re: Subrequest without returning to nginx

Dipl. Ing. Sergey Brester 80 May 04, 2021 11:04AM

Re: Subrequest without returning to nginx

Alfred Sawaya 106 May 04, 2021 11:16AM

Re: Subrequest without returning to nginx

Ranier Vilela 101 May 04, 2021 10:36AM

Re: Subrequest without returning to nginx

Alfred Sawaya 94 May 04, 2021 11:00AM

Re: Subrequest without returning to nginx

Maxim Dounin 85 May 04, 2021 11:00AM

Re: Subrequest without returning to nginx

Alfred Sawaya 133 May 04, 2021 11:26AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 252
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready