RekGRpth
May 05, 2022 11:40PM
In which places my module misuses parts of the upstream module
infrastructure, notably upstream blocks and balancers, for its own
needs?

чт, 5 мая 2022 г. в 09:22, RekGRpth <rekgrpth@gmail.com>:
>
> 1) The proper way is use cleanup handler? Is this right?
> https://github.com/RekGRpth/ngx_pg_module/blob/25db8706e6268f8197002012e9044be64f698ef3/ngx_pg_module.c#L1422-L1424
> 2) Why my module is a hack by design?
>
> пн, 2 мая 2022 г. в 08:41, RekGRpth <rekgrpth@gmail.com>:
> >
> > I think, my suggested in patch solution is more clear and easy and
> > beauty, than using cleanup handler to save any connection-specific
> > data within a cached connection.
> >
> > вс, 1 мая 2022 г. в 07:46, RekGRpth <rekgrpth@gmail.com>:
> > >
> > > now, for example, I do very dirty hack for this:
> > > https://github.com/RekGRpth/ngx_pg_module/blob/06eab53160fcff2b19e73ed5bc787f534c2a4c2e/ngx_pg_module.c#L1382-L1385
> > > for save and https://github.com/RekGRpth/ngx_pg_module/blob/06eab53160fcff2b19e73ed5bc787f534c2a4c2e/ngx_pg_module.c#L1362
> > > for restore
> > >
> > > вс, 1 мая 2022 г. в 03:19, Maxim Dounin <mdounin@mdounin.ru>:
> > > >
> > > > Hello!
> > > >
> > > > On Sat, Apr 30, 2022 at 10:03:42AM +0500, RekGRpth wrote:
> > > >
> > > > > # HG changeset patch
> > > > > # User RekGRpth <rekgrpth@gmail.com>
> > > > > # Date 1651294527 -18000
> > > > > # Sat Apr 30 09:55:27 2022 +0500
> > > > > # Node ID 7b38618adf6317fc268315b8134a5e2b1bc96269
> > > > > # Parent a736a7a613ea6e182ff86fbadcb98bb0f8891c0b
> > > > > upstream keepalive: save and restore connection data
> > > > >
> > > > > save connection data before keep it
> > > > > and
> > > > > restore connection data after yuild it
> > > > >
> > > > > diff -r a736a7a613ea -r 7b38618adf63 src/http/modules/ngx_http_upstream_keepalive_module.c
> > > > > --- a/src/http/modules/ngx_http_upstream_keepalive_module.c Tue Feb 08 17:35:27 2022 +0300
> > > > > +++ b/src/http/modules/ngx_http_upstream_keepalive_module.c Sat Apr 30 09:55:27 2022 +0500
> > > > > @@ -34,6 +34,8 @@
> > > > > socklen_t socklen;
> > > > > ngx_sockaddr_t sockaddr;
> > > > >
> > > > > + void *data;
> > > > > +
> > > > > } ngx_http_upstream_keepalive_cache_t;
> > > > >
> > > > >
> > > > > @@ -284,7 +286,7 @@
> > > > >
> > > > > c->idle = 0;
> > > > > c->sent = 0;
> > > > > - c->data = NULL;
> > > > > + c->data = item->data;
> > > > > c->log = pc->log;
> > > > > c->read->log = pc->log;
> > > > > c->write->log = pc->log;
> > > > > @@ -390,6 +392,7 @@
> > > > > c->write->handler = ngx_http_upstream_keepalive_dummy_handler;
> > > > > c->read->handler = ngx_http_upstream_keepalive_close_handler;
> > > > >
> > > > > + item->data = c->data;
> > > > > c->data = item;
> > > > > c->idle = 1;
> > > > > c->log = ngx_cycle->log;
> > > >
> > > > Thanks for the patch.
> > > >
> > > > You may want to be more specific on what problem you are trying to
> > > > solve by this patch.
> > > >
> > > > --
> > > > Maxim Dounin
> > > > http://mdounin.ru/
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[PATCH] upstream keepalive: save and restore connection data

RekGRpth 612 April 30, 2022 01:04AM

Re: [PATCH] upstream keepalive: save and restore connection data

Maxim Dounin 108 April 30, 2022 06:20PM

Re: [PATCH] upstream keepalive: save and restore connection data

RekGRpth 200 April 30, 2022 10:48PM

Re: [PATCH] upstream keepalive: save and restore connection data

Maxim Dounin 140 May 01, 2022 11:56AM

Re: [PATCH] upstream keepalive: save and restore connection data

RekGRpth 112 May 01, 2022 11:44PM

Re: [PATCH] upstream keepalive: save and restore connection data

Maxim Dounin 93 May 02, 2022 04:12PM

Re: [PATCH] upstream keepalive: save and restore connection data

RekGRpth 93 May 05, 2022 12:24AM

Re: [PATCH] upstream keepalive: save and restore connection data

Maxim Dounin 144 May 05, 2022 05:38PM

Re: [PATCH] upstream keepalive: save and restore connection data

RekGRpth 106 May 05, 2022 11:40PM

Re: [PATCH] upstream keepalive: save and restore connection data

Maxim Dounin 105 May 06, 2022 09:30AM

Re: [PATCH] upstream keepalive: save and restore connection data

RekGRpth 119 May 06, 2022 09:58AM



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

Online Users

Guests: 245
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